Title: ClientException thrown when tcp connection is closed · Issue #313 · microsoftgraph/msgraph-sdk-java · GitHub
Open Graph Title: ClientException thrown when tcp connection is closed · Issue #313 · microsoftgraph/msgraph-sdk-java
X Title: ClientException thrown when tcp connection is closed · Issue #313 · microsoftgraph/msgraph-sdk-java
Description: Expected behavior When a underlying connection okhttp is using is closed okhttp should reopen a new connection without throwing an exception. Actual behavior ClientException is thrown by the graph sdk. Underlying connection okhttp is han...
Open Graph Description: Expected behavior When a underlying connection okhttp is using is closed okhttp should reopen a new connection without throwing an exception. Actual behavior ClientException is thrown by the graph ...
X Description: Expected behavior When a underlying connection okhttp is using is closed okhttp should reopen a new connection without throwing an exception. Actual behavior ClientException is thrown by the graph ...
Opengraph URL: https://github.com/microsoftgraph/msgraph-sdk-java/issues/313
X: @github
Domain: github.com
IPv4 address: 140.82.114.3
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"ClientException thrown when tcp connection is closed","articleBody":"Expected behavior\nWhen a underlying connection okhttp is using is closed okhttp should reopen a new connection without throwing an exception.\nActual behavior\nClientException is thrown by the graph sdk.\nUnderlying connection okhttp is handling is closed causing a EOFException to be thrown. This eventually bubbles up to the sdk library and is caught and rethrown as a ClientException.\nSteps to reproduce the behavior\nMake a number of calls to the graph sdk consistantly over a period of 15-30 minutes and the error should be seen.\nThis looks to be caused by setting okBuilder.retryOnConnectionFailure(false); in CoreHttpProvider. I can't see why this was done but it happened when RetryHandler functionality was added from msgraph-sdk-java-core. Since RetryHandler only retries status code responses of 429 503 504 and doesn't actually do anything about exeptions this should be set to true.\nThere's no way to override this setting the only workaround I've found is to add retry logic into any code that makes a call with the sdk or inject a 'Connection: close' header into every request made making okhttp open a new connection everytime.\nrelevant info: square/okhttp/issues/1873\ncom.microsoft.graph.core.ClientException: Error during http request\ncom.microsoft.graph.http.CoreHttpProvider.sendRequestInternal(CoreHttpProvider.java:422) ~[microsoft-graph-1.6.0.jar!/:na]\\tat com.microsoft.graph.http.CoreHttpProvider.send(CoreHttpProvider.java:204) ~[microsoft-graph-1.6.0.jar!/:na]\n com.microsoft.graph.http.CoreHttpProvider.send(CoreHttpProvider.java:184) ~[microsoft-graph-1.6.0.jar!/:na]\n com.microsoft.graph.http.BaseCollectionRequest.send(BaseCollectionRequest.java:89) ~[microsoft-graph-1.6.0.jar!/:na]\n com.microsoft.graph.requests.extensions.UserCollectionRequest.get(UserCollectionRequest.java:52) ~[microsoft-graph-1.6.0.jar!/:na]\n.......\n org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) [tomcat-embed-core-9.0.24.jar!/:9.0.24]\n java.lang.Thread.run(Thread.java:748) [na:1.8.0_222]\nCaused by: java.io.IOException: unexpected end of stream on https://graph.microsoft.com/...\n okhttp3.internal.http1.Http1ExchangeCodec.readResponseHeaders(Http1ExchangeCodec.java:236) ~[okhttp-3.14.4.jar!/:na]\n okhttp3.internal.connection.Exchange.readResponseHeaders(Exchange.java:115) ~[okhttp-3.14.4.jar!/:na]\n okhttp3.internal.http.CallServerInterceptor.intercept(CallServerInterceptor.java:94) ~[okhttp-3.14.4.jar!/:na]\n okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:142) ~[okhttp-3.14.4.jar!/:na]\n okhttp3.internal.connection.ConnectInterceptor.intercept(ConnectInterceptor.java:43) ~[okhttp-3.14.4.jar!/:na]\n okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:142) ~[okhttp-3.14.4.jar!/:na]\n okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:117) ~[okhttp-3.14.4.jar!/:na]\n okhttp3.internal.cache.CacheInterceptor.intercept(CacheInterceptor.java:94) ~[okhttp-3.14.4.jar!/:na]\n okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:142) ~[okhttp-3.14.4.jar!/:na]\n okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:117) ~[okhttp-3.14.4.jar!/:na]\n okhttp3.internal.http.BridgeInterceptor.intercept(BridgeInterceptor.java:93) ~[okhttp-3.14.4.jar!/:na]\n okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:142) ~[okhttp-3.14.4.jar!/:na]\n okhttp3.internal.http.RetryAndFollowUpInterceptor.intercept(RetryAndFollowUpInterceptor.java:88) ~[okhttp-3.14.4.jar!/:na]\n okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:142) ~[okhttp-3.14.4.jar!/:na]\n okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:117) ~[okhttp-3.14.4.jar!/:na]\n com.microsoft.graph.httpcore.TelemetryHandler.intercept(TelemetryHandler.java:35) ~[microsoft-graph-core-1.0.0.jar!/:na]\n okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:142) ~[okhttp-3.14.4.jar!/:na]\n okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:117) ~[okhttp-3.14.4.jar!/:na]\n com.microsoft.graph.httpcore.RedirectHandler.intercept(RedirectHandler.java:123) ~[microsoft-graph-core-1.0.0.jar!/:na]\n okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:142) ~[okhttp-3.14.4.jar!/:na]\n okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:117) ~[okhttp-3.14.4.jar!/:na]\n com.microsoft.graph.httpcore.RetryHandler.intercept(RetryHandler.java:140) ~[microsoft-graph-core-1.0.0.jar!/:na]\n okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:142) ~[okhttp-3.14.4.jar!/:na]\n okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:117) ~[okhttp-3.14.4.jar!/:na]\n com.microsoft.graph.httpcore.AuthenticationHandler.intercept(AuthenticationHandler.java:31) ~[microsoft-graph-core-1.0.0.jar!/:na]\n okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:142) ~[okhttp-3.14.4.jar!/:na]\n okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:117) ~[okhttp-3.14.4.jar!/:na]\n okhttp3.RealCall.getResponseWithInterceptorChain(RealCall.java:229) ~[okhttp-3.14.4.jar!/:na]\n okhttp3.RealCall.execute(RealCall.java:81) ~[okhttp-3.14.4.jar!/:na]\n com.microsoft.graph.http.CoreHttpProvider.sendRequestInternal(CoreHttpProvider.java:356) ~[microsoft-graph-1.6.0.jar!/:na]\n... 105 common frames omitted\nCaused by: java.io.EOFException: \n not found: limit=0 content=…\n okio.RealBufferedSource.readUtf8LineStrict(RealBufferedSource.java:240) ~[okio-1.17.2.jar!/:na]\n okhttp3.internal.http1.Http1ExchangeCodec.readHeaderLine(Http1ExchangeCodec.java:242) ~[okhttp-3.14.4.jar!/:na]\\tat okhttp3.internal.http1.Http1ExchangeCodec.readResponseHeaders(Http1ExchangeCodec.java:213) ~[okhttp-3.14.4.jar!/:na]\n\\t... 134 common frames omitted\n[AB#6038](https://microsoftgraph.visualstudio.com/0985d294-5762-4bc2-a565-161ef349ca3e/_workitems/edit/6038)","author":{"url":"https://github.com/James-Ronayne","@type":"Person","name":"James-Ronayne"},"datePublished":"2019-10-24T20:19:50Z","url":"https://github.com/microsoftgraph/msgraph-sdk-java/issues/313"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:20ebc682-feb8-5d3f-940f-5cb0de56dc5c |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | D270:27A67B:21059D2:2B2778D:6B053DC3 |
| html-safe-nonce | 512990eba3132e9021e2d25620b324abfd8dad9f00ff3cbe091f8334845982af |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEMjcwOjI3QTY3QjoyMTA1OUQyOjJCMjc3OEQ6NkIwNTNEQzMiLCJ2aXNpdG9yX2lkIjoiMTI0ODk0Njk4MDc1MjAxNDc4NyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | fbbb89d26352a0746849dd5778193286d52b03a47c7a886f1a9b7048c7825fd5 |
| hovercard-subject-tag | issue:512160345 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/microsoftgraph/msgraph-sdk-java/313/issue_layout |
| twitter:image | https://opengraph.githubassets.com/c71b9582f2d602847515c93c8af8cfb59904d81c89c41b436f1230234e5eec26/microsoftgraph/msgraph-sdk-java/issues/313 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/c71b9582f2d602847515c93c8af8cfb59904d81c89c41b436f1230234e5eec26/microsoftgraph/msgraph-sdk-java/issues/313 |
| og:image:alt | Expected behavior When a underlying connection okhttp is using is closed okhttp should reopen a new connection without throwing an exception. Actual behavior ClientException is thrown by the graph ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | James-Ronayne |
| hostname | github.com |
| expected-hostname | github.com |
| None | 854d880890b5e847b3fce9d1b31f032107baeddeebad2aa379c48aa4f1451f6b |
| turbo-cache-control | no-preview |
| go-import | github.com/microsoftgraph/msgraph-sdk-java git https://github.com/microsoftgraph/msgraph-sdk-java.git |
| octolytics-dimension-user_id | 17304259 |
| octolytics-dimension-user_login | microsoftgraph |
| octolytics-dimension-repository_id | 103300409 |
| octolytics-dimension-repository_nwo | microsoftgraph/msgraph-sdk-java |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 103300409 |
| octolytics-dimension-repository_network_root_nwo | microsoftgraph/msgraph-sdk-java |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 220e980097d94ce616d5d11fbd5316d208e3fc93 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
| Server | github.com |
| Content-Type | text/html; charset=utf-8 |
| Cache-Control | max-age=0, private, must-revalidate |
Viewport: width=device-width