Skip to content

fix: cancel in-flight REST streaming futures on close - #1202

Open
hutiefang76 wants to merge 1 commit into
a2aproject:mainfrom
hutiefang76:fix/1194-rest-stream-lifecycle
Open

hutiefang76 wants to merge 1 commit into
a2aproject:mainfrom
hutiefang76:fix/1194-rest-stream-lifecycle

Conversation

@hutiefang76

Copy link
Copy Markdown
Contributor

Description

Closing a REST transport now cancels its pending HTTP streaming futures in both native and 0.3 compatibility clients. With the default JDK HTTP provider, this also releases open SSE connections, including when close races with stream setup.

Normal EOF completion notification is deferred because the current error-handler API expects a non-null Throwable. Optional Vert.x and Android providers do not currently propagate future cancellation to their underlying network streams; this change does not add those provider hooks. Borrowed HTTP clients remain caller-owned.

Related: #1194

Validation

  • The affected 13-module reactor passed 649 tests with no failures or errors (Maven/compiler on Java 21; tests on Java 17).
  • Ten new close regressions passed on Java 17 and Java 21, covering multiple streams, completed-future removal, synchronous completion, concurrent setup/close, idempotence, and real JDK HTTP socket release.
  • Before the fix, cancellation assertions and the real-server connection-close assertion failed against the no-op close implementation.

Contribution checklist

  • Follow the CONTRIBUTING guide.
  • Use a Conventional Commits title.
  • Ensure the affected tests pass.
  • Reviewed documentation requirements; no README change is needed.

Track active REST streaming futures in both protocol implementations,
remove completed futures, and cancel pending futures when closing.
Cover completion, shutdown races, idempotence, and JDK socket release.

Related: a2aproject#1194

This branch has not been deployed

No deployments
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.

1 participant