Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Close response when write transfer error #97

Merged
merged 1 commit into from
Jul 22, 2024

Conversation

ruhan1
Copy link
Contributor

@ruhan1 ruhan1 commented Jul 22, 2024

Close the okhttp3 response object when below error happens. This may have caused the WAIT_CLOSE socket.

2024-07-08 09:32:06,556 ERROR [or.co.in.se.ht.ut.ProxyResponseHelper] (OkHttp http://indy-gateway.indy.svc.cluster.local/...) write transfer error: Connection reset by peer (Write failed): java.net.SocketException: Connection reset by peer (Write failed)
...
at java.base/java.io.FilterOutputStream.write(FilterOutputStream.java:108)
at org.commonjava.indy.service.httprox.util.OutputStreamSinkChannel.write(OutputStreamSinkChannel.java:165)
at org.commonjava.indy.service.httprox.util.ChannelUtils.write(ChannelUtils.java:53)
at org.commonjava.indy.service.httprox.util.HttpConduitWrapper.writeExistingTransfer(HttpConduitWrapper.java:134)
at org.commonjava.indy.service.httprox.util.ProxyResponseHelper.lambda$doTransfer$1(ProxyResponseHelper.java:512)
at io.smallrye.context.impl.wrappers.SlowContextualConsumer.accept(SlowContextualConsumer.java:21)
at io.smallrye.mutiny.helpers.UniCallbackSubscriber.onItem(UniCallbackSubscriber.java:73)
at io.smallrye.mutiny.operators.uni.UniOperatorProcessor.onItem(UniOperatorProcessor.java:47)
...
at org.commonjava.indy.service.httprox.util.WebClientAdapter$CallAdapter$1.onResponse(WebClientAdapter.java:397)
at okhttp3.internal.connection.RealCall$AsyncCall.run(RealCall.kt:519)

@ruhan1 ruhan1 requested a review from sswguo July 22, 2024 04:27
@sswguo
Copy link
Member

sswguo commented Jul 22, 2024

LGTM.

@ruhan1 ruhan1 merged commit a5d968c into Commonjava:main Jul 22, 2024
1 check passed
@ruhan1 ruhan1 deleted the main-close branch July 22, 2024 05:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants