René's URL Explorer Experiment


Title: feat: Drain in-flight requests on stop by thced · Pull Request #133 · extenda/openapi-httpserver-java · GitHub

Open Graph Title: feat: Drain in-flight requests on stop by thced · Pull Request #133 · extenda/openapi-httpserver-java

X Title: feat: Drain in-flight requests on stop by thced · Pull Request #133 · extenda/openapi-httpserver-java

Description: Summary OpenApiServer.stop(delay) could wait out the full delay with no request in flight. In the JDK's HttpServer (ServerImpl, JDK 25), if a client closes an idle keep-alive connection just before stop, the connection is cleaned up but the finished latch is never counted down. stop then sleeps the whole delay. A plain-JDK repro stalls in about 1 of 4 rounds. Consumers see it as slow shutdowns and 5 s stalls in tests. OpenApiServer now counts in-flight requests itself: InFlightCounter is a filter, first on every context the server creates. It counts each request through its handler and afterResponse runnables, with the decrement in finally. stop(delay): starts HttpServer.stop(delay) on a virtual thread, so the listener closes at once and new connections are refused as before; waits on the counter for at most delay; calls HttpServer.stop(0), which releases the JDK's latch. Open keep-alive connections are still served until the JDK sees no exchange in flight, as before. Repeated stop: later and concurrent calls wait for the first one to finish. A failure in the first call reaches them as an IllegalStateException. inFlightRequests() is new public API that exposes the count, so callers can build their own drain. Notes feat: new public API, and a second stop call now waits for the first. GracefulStopIT (11 tests, about 3 s): the raw-socket loop and the interrupt test fail on the old stop; the keep-alive client loop is a secondary guard; the rest specify the behaviour. The OpenApiServerIT$Filters hang is unrelated to this change. One mvn verify run hung in postFilterShortStringMatchesNoBranchReturns400. Looping the same scenario hangs on master at the same rate (3 in 12,000, against 1 in 12,000 on this branch). The cause: the server binds the wildcard address on a random port, and another local process can already hold that port on 127.0.0.1, so localhost reaches it instead. A fix would be a separate change: tests bind and call 127.0.0.1. Not changed: the virtual-thread executor is still never closed on stop.

Open Graph Description: Summary OpenApiServer.stop(delay) could wait out the full delay with no request in flight. In the JDK's HttpServer (ServerImpl, JDK 25), if a client closes an idle keep-alive connection just be...

X Description: Summary OpenApiServer.stop(delay) could wait out the full delay with no request in flight. In the JDK's HttpServer (ServerImpl, JDK 25), if a client closes an idle keep-alive connection jus...

Opengraph URL: https://github.com/extenda/openapi-httpserver-java/pull/133

X: @github

direct link

Domain: github.com

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/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:41be3a8b-6d10-6504-a235-bc05175b8e30
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idE448:26463:4EE92:6BA81:6AECF679
html-safe-nonce432830db8a37f581e981a630be321de4c98440c7442efbb10b0fc1d6eb53dc19
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFNDQ4OjI2NDYzOjRFRTkyOjZCQTgxOjZBRUNGNjc5IiwidmlzaXRvcl9pZCI6IjM3NDMzNTgyMzk4Nzc0Mjg4NTciLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmacbbcd46efa725966888b770dde53cd7ce6083dcb1b90afc8967fac4ec146ab8d3
hovercard-subject-tagpull_request:4877217002
github-keyboard-shortcutsrepository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///pull_requests/show/files
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/extenda/openapi-httpserver-java/pull/133/files
twitter:imagehttps://avatars.githubusercontent.com/u/1101587?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/1101587?s=400&v=4
og:image:altSummary OpenApiServer.stop(delay) could wait out the full delay with no request in flight. In the JDK's HttpServer (ServerImpl, JDK 25), if a client closes an idle keep-alive connection just be...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
None80acd59cd7735dad62df7be8125e1689bc132c07bc46e7498af0fcc391b80b4f
turbo-cache-controlno-preview
diff-viewunified
go-importgithub.com/extenda/openapi-httpserver-java git https://github.com/extenda/openapi-httpserver-java.git
octolytics-dimension-user_id5753979
octolytics-dimension-user_loginextenda
octolytics-dimension-repository_id882991450
octolytics-dimension-repository_nwoextenda/openapi-httpserver-java
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id882991450
octolytics-dimension-repository_network_root_nwoextenda/openapi-httpserver-java
turbo-body-classeslogged-out env-production page-responsive full-width
disable-turbotrue
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release711407b7c0a9167a19a52f516c0bf848416bbd1f
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/extenda/openapi-httpserver-java/pull/133/files#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fextenda%2Fopenapi-httpserver-java%2Fpull%2F133%2Ffiles
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%2Fextenda%2Fopenapi-httpserver-java%2Fpull%2F133%2Ffiles
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fpull_requests%2Fshow%2Ffiles&source=header-repo&source_repo=extenda%2Fopenapi-httpserver-java
Reloadhttps://github.com/extenda/openapi-httpserver-java/pull/133/files
Reloadhttps://github.com/extenda/openapi-httpserver-java/pull/133/files
Reloadhttps://github.com/extenda/openapi-httpserver-java/pull/133/files
extendahttps://github.com/extenda
openapi-httpserver-javahttps://github.com/extenda/openapi-httpserver-java
Codehttps://github.com/extenda/openapi-httpserver-java
Issueshttps://github.com/extenda/openapi-httpserver-java/issues
Pull requests2 (2)https://github.com/extenda/openapi-httpserver-java/pulls
Actionshttps://github.com/extenda/openapi-httpserver-java/actions
Security and qualityhttps://github.com/extenda/openapi-httpserver-java/security
Insightshttps://github.com/extenda/openapi-httpserver-java/pulse
Sign up for GitHub https://github.com/signup?return_to=%2Fextenda%2Fopenapi-httpserver-java%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://github.com/login?return_to=%2Fextenda%2Fopenapi-httpserver-java%2Fissues%2Fnew%2Fchoose
thcedhttps://github.com/thced
masterhttps://github.com/extenda/openapi-httpserver-java/tree/master
fix/stop-inflight-counterhttps://github.com/extenda/openapi-httpserver-java/tree/fix/stop-inflight-counter
Conversation 1 https://github.com/extenda/openapi-httpserver-java/pull/133
Commits 3 https://github.com/extenda/openapi-httpserver-java/pull/133/commits
Checks 5 https://github.com/extenda/openapi-httpserver-java/pull/133/checks
Files changed https://github.com/extenda/openapi-httpserver-java/pull/133/files
Please reload this pagehttps://github.com/extenda/openapi-httpserver-java/pull/133/files
feat: Drain in-flight requests on stop https://github.com/extenda/openapi-httpserver-java/pull/133/files#top
Show all changes 3 commits https://github.com/extenda/openapi-httpserver-java/pull/133/files
ef20528 feat: Drain in-flight requests on stop thced Oct 15, 2026 https://github.com/extenda/openapi-httpserver-java/pull/133/commits/ef205287574c8dec2d1071d846bc3b5301d4b62e
84c50c3 feat: Address review and Sonar findings on stop draining thced Oct 15, 2026 https://github.com/extenda/openapi-httpserver-java/pull/133/commits/84c50c34d822ca8fc93dcb826bf274c2c0ae2b48
a1e6809 docs: Add graceful stop drain spec and plan thced Oct 15, 2026 https://github.com/extenda/openapi-httpserver-java/pull/133/commits/a1e6809703c57dfb9ed3f8d00262a6292223323f
Clear filters https://github.com/extenda/openapi-httpserver-java/pull/133/files
Please reload this pagehttps://github.com/extenda/openapi-httpserver-java/pull/133/files
Please reload this pagehttps://github.com/extenda/openapi-httpserver-java/pull/133/files
CLAUDE.md https://github.com/extenda/openapi-httpserver-java/pull/133/files#diff-6ebdb617a8104a7756d0cf36578ab01103dc9f07e4dc6feb751296b9c402faf7
README.md https://github.com/extenda/openapi-httpserver-java/pull/133/files#diff-b335630551682c19a781afebcf4d07bf978fb1f8ac04c6bf87428ed5106870f5
2026-10-15-graceful-stop-drain.md https://github.com/extenda/openapi-httpserver-java/pull/133/files#diff-1b62baf9d885d6e3b4a213767f3616454fdea39a86dbc1382e79eeff7378cfa8
2026-10-15-graceful-stop-drain-design.md https://github.com/extenda/openapi-httpserver-java/pull/133/files#diff-68480cfacb2951328d1f3ab457db4118937f06f7f81bd45c869f681d30eb152c
OpenApiServer.java https://github.com/extenda/openapi-httpserver-java/pull/133/files#diff-3a18cfb76c0dfa3899243b203697e106a4b62c9f26962d4b229f2acbbf6b2290
InFlightCounter.java https://github.com/extenda/openapi-httpserver-java/pull/133/files#diff-ac44ab7be0d9d277a47e940550c622ae2b69069e515db6dc05814b2806e1a4d8
GracefulStopIT.java https://github.com/extenda/openapi-httpserver-java/pull/133/files#diff-d2d10f09b283e3f41eda16e736afbab8276a58c79f9f3bda45b5a2475259fdd6
CLAUDE.mdhttps://github.com/extenda/openapi-httpserver-java/pull/133/files#diff-6ebdb617a8104a7756d0cf36578ab01103dc9f07e4dc6feb751296b9c402faf7
View file https://github.com/extenda/openapi-httpserver-java/blob/a1e6809703c57dfb9ed3f8d00262a6292223323f/CLAUDE.md
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/extenda/openapi-httpserver-java/pull/133/{{ revealButtonHref }}
https://github.com/extenda/openapi-httpserver-java/pull/133/files#diff-6ebdb617a8104a7756d0cf36578ab01103dc9f07e4dc6feb751296b9c402faf7
https://github.com/extenda/openapi-httpserver-java/pull/133/files#diff-6ebdb617a8104a7756d0cf36578ab01103dc9f07e4dc6feb751296b9c402faf7
README.mdhttps://github.com/extenda/openapi-httpserver-java/pull/133/files#diff-b335630551682c19a781afebcf4d07bf978fb1f8ac04c6bf87428ed5106870f5
View file https://github.com/extenda/openapi-httpserver-java/blob/a1e6809703c57dfb9ed3f8d00262a6292223323f/README.md
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/extenda/openapi-httpserver-java/pull/133/{{ revealButtonHref }}
https://github.com/extenda/openapi-httpserver-java/pull/133/files#diff-b335630551682c19a781afebcf4d07bf978fb1f8ac04c6bf87428ed5106870f5
https://github.com/extenda/openapi-httpserver-java/pull/133/files#diff-b335630551682c19a781afebcf4d07bf978fb1f8ac04c6bf87428ed5106870f5
docs/superpowers/plans/2026-10-15-graceful-stop-drain.mdhttps://github.com/extenda/openapi-httpserver-java/pull/133/files#diff-1b62baf9d885d6e3b4a213767f3616454fdea39a86dbc1382e79eeff7378cfa8
View file https://github.com/extenda/openapi-httpserver-java/blob/a1e6809703c57dfb9ed3f8d00262a6292223323f/docs/superpowers/plans/2026-10-15-graceful-stop-drain.md
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/extenda/openapi-httpserver-java/pull/133/{{ revealButtonHref }}
Please reload this pagehttps://github.com/extenda/openapi-httpserver-java/pull/133/files
Please reload this pagehttps://github.com/extenda/openapi-httpserver-java/pull/133/files
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.