René's URL Explorer Experiment


Title: Intermittent "Connection reset by peer" when reusing idle OkHttp connection with Microsoft Graph Java SDK behind HTTP proxy · Issue #2654 · microsoftgraph/msgraph-sdk-java · GitHub

Open Graph Title: Intermittent "Connection reset by peer" when reusing idle OkHttp connection with Microsoft Graph Java SDK behind HTTP proxy · Issue #2654 · microsoftgraph/msgraph-sdk-java

X Title: Intermittent "Connection reset by peer" when reusing idle OkHttp connection with Microsoft Graph Java SDK behind HTTP proxy · Issue #2654 · microsoftgraph/msgraph-sdk-java

Description: Describe the bug Hi Team, We are facing an intermittent issue when using Microsoft Graph Java SDK behind a corporate HTTP proxy. Environment: Java 17 Spring Boot Microsoft Graph SDK 6.56.0 Azure Identity 1.16.0 Azure Core HTTP OkHttp 1.1...

Open Graph Description: Describe the bug Hi Team, We are facing an intermittent issue when using Microsoft Graph Java SDK behind a corporate HTTP proxy. Environment: Java 17 Spring Boot Microsoft Graph SDK 6.56.0 Azure Id...

X Description: Describe the bug Hi Team, We are facing an intermittent issue when using Microsoft Graph Java SDK behind a corporate HTTP proxy. Environment: Java 17 Spring Boot Microsoft Graph SDK 6.56.0 Azure Id...

Opengraph URL: https://github.com/microsoftgraph/msgraph-sdk-java/issues/2654

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Intermittent \"Connection reset by peer\" when reusing idle OkHttp connection with Microsoft Graph Java SDK behind HTTP proxy","articleBody":"### Describe the bug\n\nHi Team,\n\nWe are facing an intermittent issue when using Microsoft Graph Java SDK behind a corporate HTTP proxy.\n\nEnvironment:\n\nJava 17\nSpring Boot\nMicrosoft Graph SDK 6.56.0\nAzure Identity 1.16.0\nAzure Core HTTP OkHttp 1.11.12\nOkHttp Client\nCorporate HTTP Proxy\nScheduler running every 5 minutes\n\nIssue Pattern:\n\nApplication Startup:\n\nNew TCP connection created\nTLS handshake successful\nGraph API call successful\n\nSecond Scheduler Run (5 minutes later):\n\nExisting connection is reused\nNo new TCP connection created\nTLS handshake attempted\nConnection reset by peer\nRequest fails\n\nThird Scheduler Run:\n\nNew TCP connection created\nTLS handshake successful\nGraph API call successful\n\nThe Graph API being called is MailFolders.\n\nAuthentication is successful and token acquisition does not fail.\n\nAzure Identity logs show:\n\nClientSecretCredential => getToken() SUCCESS\n\nThe failure occurs during the Graph API request after token acquisition.\n\nException:\n\njava.net.SocketException: Connection reset by peer\n\nWireshark Analysis:\n\nSuccessful Request:\n\nNew TCP connection\nTLS handshake\nGraph request succeeds\n\nFailed Request:\n\nExisting connection reused\nNo new TCP connection created\nTLS handshake attempted\nConnection reset by peer\n\nNext Request:\n\nNew TCP connection created\nTLS handshake successful\nRequest succeeds\n\nAdditional Observation:\n\nWhen retryOnConnectionFailure(true) is enabled, OkHttp closes the failed connection, creates a new connection and the retry succeeds.\n\nQuestions:\n\nIs GraphServiceClient expected to reuse idle pooled OkHttp connections after several minutes?\nIs there a recommended ConnectionPool configuration for long-running scheduled workloads?\nIs there any recommended configuration for Graph SDK when using an HTTP proxy?\nHas this behavior been observed previously with Graph SDK 6.56.0?\n\nThis application previously worked with the same code and configuration and the issue started only recently without any application code changes.\n\n### Expected behavior\n\nThe Graph API request should succeed on every scheduler execution.\n\nWhen an idle connection becomes invalid, Graph SDK / OkHttp should either:\n\nCreate a new connection automatically, or\nRetry using a new connection without failing the request.\n\nWe expect consistent behavior across all scheduler executions without intermittent \"Connection reset by peer\" errors.\n\n### How to reproduce\n\n1. Create a Spring Boot application using Microsoft Graph Java SDK 6.56.0, Azure Identity 1.16.0 and azure-core-http-okhttp 1.11.12.\n2. Configure GraphServiceClient with OkHttpClient and an HTTP proxy.\n3. Create a scheduler that runs every 5 minutes.\n4. Call Microsoft Graph MailFolders API during every scheduler execution.\n5. Start the application.\n6. Observe that the first execution succeeds.\n7. Wait for the second scheduler execution.\n8. The second execution intermittently fails with:\n\njava.net.SocketException: Connection reset by peer\n\n1. Wait for the next scheduler execution.\n2. The third execution succeeds again.\n\nWireshark observations:\n\n- First execution creates a new TCP connection and succeeds.\n- Second execution reuses an existing connection and fails with connection reset.\n- Third execution creates a new TCP connection and succeeds.\n\nThe issue is reproducible only when connection reuse occurs after an idle period.\n\n### SDK Version\n\n6.56.0\n\n### Latest version known to work for scenario above?\n\nUnknown.  The same application and configuration previously worked successfully. The issue started recently without application code \n\n### Known Workarounds\n\nWe found that enabling retryOnConnectionFailure(true) reduces the occurrence of the issue. When the connection reset occurs, OkHttp closes the failed connection, creates a new connection and retries the request successfully.\nWe are also testing ConnectionPool configuration with a shorter idle timeout to prevent reuse of older idle connections.\nAdditionally, the next scheduler execution usually succeeds because a completely new TCP connection is created.\nThe root cause is still under investigation.\n\n### Debug output\n\n[connection-reset-log-summary.txt](https://github.com/user-attachments/files/30889380/connection-reset-log-summary.txt)\n\nApplication startup:\n\nNew TCP connection created\nTLS handshake completed successfully\nGraph MailFolders API call successful\n\nSecond scheduler execution (approximately 5 minutes later):\n\nExisting connection reused\nNo new TCP connection created\nTLS handshake attempted\nConnection reset by peer\nRequest failed\n\nThird scheduler execution:\n\nNew TCP connection created\nTLS handshake completed successfully\nGraph MailFolders API call successful\n\nAuthentication behavior:\n\nToken acquisition succeeds successfully\nClientSecretCredential getToken returns SUCCESS\nFailure occurs after token acquisition during Graph API execution\n\nObserved exception:\n\njava.net.SocketException: Connection reset by peer\n\nRelevant stack trace location:\n\nHttp1ExchangeCodec.readResponseHeaders\nExchange.readResponseHeaders\nMailFoldersRequestBuilder.get\n\nWireshark observations:\n\nSuccessful execution:\n\nNew TCP connection\nTLS handshake successful\nRequest successful\n\nFailed execution:\n\nExisting connection reused\nNo new TCP connection created\nTLS handshake attempted\nConnection reset by peer\n\nNext execution:\n\nNew TCP connection created\nTLS handshake successful\nRequest successful\n\nAdditional observation:\n\nWhen retryOnConnectionFailure(true) is enabled, the request succeeds because OkHttp creates a new connection and retries automatically.\n\n### Configuration\n\n[GraphServiceClient_Config.txt](https://github.com/user-attachments/files/30889393/GraphServiceClient_Config.txt)\n\nOS:\nAKS (Azure Kubernetes Service) running Linux based containers in production\nMicrosoft Graph Java SDK application deployed as a containerized microservice\nLocal testing performed on Windows Server\n\nIs it specific to this configuration?\nCurrently investigating.\nIssue observed in AKS hosted microservice environment.\nCorporate HTTP proxy is used in both environments.\n\n### Other information\n\nWe believe the issue may be related to connection reuse after an idle period.\n\nObservations:\n\nScheduler runs every 5 minutes.\nFirst Graph API call after application startup always succeeds.\nSecond scheduler execution intermittently fails with \"Connection reset by peer\".\nThird scheduler execution succeeds again.\n\nBased on Wireshark analysis:\n\nSuccessful execution creates a new TCP connection and performs a successful TLS handshake.\nFailed execution attempts to reuse an existing connection.\nNo new TCP connection is established during the failed execution.\nTLS handshake is attempted and the connection is reset.\nThe next successful execution creates a new TCP connection and succeeds.\n\nAdditional observations:\n\nAuthentication is successful.\nAzure Identity token acquisition succeeds.\nFailure occurs during Graph API execution and not during token acquisition.\n\nWorkaround identified:\n\nEnabling retryOnConnectionFailure(true) reduces the issue because OkHttp creates a new connection and retries successfully.\nReducing connection pool idle timeout also appears to reduce the occurrence.\n\nQuestions:\n\nIs this expected behavior when GraphServiceClient is used with OkHttp and a corporate HTTP proxy?\nIs there a recommended connection pool or retry configuration for long-running scheduler workloads?\nIs there any known issue involving reuse of idle connections in this scenario?\n\n[GraphServiceClient_Config.txt](https://github.com/user-attachments/files/30889254/GraphServiceClient_Config.txt)","author":{"url":"https://github.com/AbdulAlSowdhS","@type":"Person","name":"AbdulAlSowdhS"},"datePublished":"2026-08-10T07:19:39Z","url":"https://github.com/microsoftgraph/msgraph-sdk-java/issues/2654"}

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react-reconciler,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@d5750093facf
route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:dd51f4ad-2ac5-2c9e-c16b-0c05532740d3
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-id8B74:2BCB50:A1077:DEEBF:6AF6BAD9
html-safe-nonce6f25026d14a6ea843daef6a8b05b9df89dae3acb8cf63763e2366db95775f63c
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4Qjc0OjJCQ0I1MDpBMTA3NzpERUVCRjo2QUY2QkFEOSIsInZpc2l0b3JfaWQiOiIxMjkxMzIxMDUwNzgzOTg4NDQxIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=
visitor-hmac66b183e0ea0018de34b32f2a287fa7b5af989a38d7937b49b05957c5d17b3414
hovercard-subject-tagissue:5107648240
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/microsoftgraph/msgraph-sdk-java/2654/issue_layout
twitter:imagehttps://opengraph.githubassets.com/96ef84f9e5744c35c8d961274540e2bd38de4cfb1409e096fe3cb63d262eadd9/microsoftgraph/msgraph-sdk-java/issues/2654
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/96ef84f9e5744c35c8d961274540e2bd38de4cfb1409e096fe3cb63d262eadd9/microsoftgraph/msgraph-sdk-java/issues/2654
og:image:altDescribe the bug Hi Team, We are facing an intermittent issue when using Microsoft Graph Java SDK behind a corporate HTTP proxy. Environment: Java 17 Spring Boot Microsoft Graph SDK 6.56.0 Azure Id...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameAbdulAlSowdhS
hostnamegithub.com
expected-hostnamegithub.com
None8dfae1499400ee498ab0f86538d1c034e6c1b4f51c63ecade775c3b0894e3379
turbo-cache-controlno-preview
go-importgithub.com/microsoftgraph/msgraph-sdk-java git https://github.com/microsoftgraph/msgraph-sdk-java.git
octolytics-dimension-user_id17304259
octolytics-dimension-user_loginmicrosoftgraph
octolytics-dimension-repository_id103300409
octolytics-dimension-repository_nwomicrosoftgraph/msgraph-sdk-java
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id103300409
octolytics-dimension-repository_network_root_nwomicrosoftgraph/msgraph-sdk-java
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
releaseee168845eb2be91203b179104ac9977fe4ea69a3
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/microsoftgraph/msgraph-sdk-java/issues/2654#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fmicrosoftgraph%2Fmsgraph-sdk-java%2Fissues%2F2654
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fmicrosoftgraph%2Fmsgraph-sdk-java%2Fissues%2F2654
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=microsoftgraph%2Fmsgraph-sdk-java
Reloadhttps://github.com/microsoftgraph/msgraph-sdk-java/issues/2654
Reloadhttps://github.com/microsoftgraph/msgraph-sdk-java/issues/2654
Reloadhttps://github.com/microsoftgraph/msgraph-sdk-java/issues/2654
microsoftgraphhttps://github.com/microsoftgraph
msgraph-sdk-javahttps://github.com/microsoftgraph/msgraph-sdk-java
Codehttps://github.com/microsoftgraph/msgraph-sdk-java
Issues107 (107)https://github.com/microsoftgraph/msgraph-sdk-java/issues
Pull requests23 (23)https://github.com/microsoftgraph/msgraph-sdk-java/pulls
Actionshttps://github.com/microsoftgraph/msgraph-sdk-java/actions
Projectshttps://github.com/microsoftgraph/msgraph-sdk-java/projects
Security and qualityhttps://github.com/microsoftgraph/msgraph-sdk-java/security
Insightshttps://github.com/microsoftgraph/msgraph-sdk-java/pulse
https://github.com/microsoftgraph/msgraph-sdk-java
New issuehttps://github.com/login?return_to=https://github.com/microsoftgraph/msgraph-sdk-java/issues/2654
New issuehttps://github.com/login?return_to=https://github.com/microsoftgraph/msgraph-sdk-java/issues/2654
Intermittent "Connection reset by peer" when reusing idle OkHttp connection with Microsoft Graph Java SDK behind HTTP proxyhttps://github.com/microsoftgraph/msgraph-sdk-java/issues/2654#top
status:waiting-for-triageAn issue that is yet to be reviewed or assignedhttps://github.com/microsoftgraph/msgraph-sdk-java/issues?q=state%3Aopen%20label%3A%22status%3Awaiting-for-triage%22
type:bugA broken experiencehttps://github.com/microsoftgraph/msgraph-sdk-java/issues?q=state%3Aopen%20label%3A%22type%3Abug%22
https://github.com/AbdulAlSowdhS
AbdulAlSowdhShttps://github.com/AbdulAlSowdhS
on Aug 10, 2026https://github.com/microsoftgraph/msgraph-sdk-java/issues/2654#issue-5107648240
connection-reset-log-summary.txthttps://github.com/user-attachments/files/30889380/connection-reset-log-summary.txt
GraphServiceClient_Config.txthttps://github.com/user-attachments/files/30889393/GraphServiceClient_Config.txt
GraphServiceClient_Config.txthttps://github.com/user-attachments/files/30889254/GraphServiceClient_Config.txt
AbdulAlSowdhShttps://github.com/AbdulAlSowdhS
status:waiting-for-triageAn issue that is yet to be reviewed or assignedhttps://github.com/microsoftgraph/msgraph-sdk-java/issues?q=state%3Aopen%20label%3A%22status%3Awaiting-for-triage%22
type:bugA broken experiencehttps://github.com/microsoftgraph/msgraph-sdk-java/issues?q=state%3Aopen%20label%3A%22type%3Abug%22
on Aug 10, 2026https://github.com/microsoftgraph/msgraph-sdk-java/issues/2654#event-29207772018
Sign up for freehttps://github.com/signup?return_to=https://github.com/microsoftgraph/msgraph-sdk-java/issues/2654
Sign in to commenthttps://github.com/login?return_to=https://github.com/microsoftgraph/msgraph-sdk-java/issues/2654
status:waiting-for-triageAn issue that is yet to be reviewed or assignedhttps://github.com/microsoftgraph/msgraph-sdk-java/issues?q=state%3Aopen%20label%3A%22status%3Awaiting-for-triage%22
type:bugA broken experiencehttps://github.com/microsoftgraph/msgraph-sdk-java/issues?q=state%3Aopen%20label%3A%22type%3Abug%22
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.