Skip to content

fix: make async client close graceful - #114

Merged
xxvw merged 3 commits into
mainfrom
agent/async-close-lifecycle
Jul 27, 2026
Merged

xxvw merged 3 commits into
mainfrom
agent/async-close-lifecycle

Conversation

@xxvw

@xxvw xxvw commented Jul 27, 2026 •

Copy link
Copy Markdown
Member

Summary

  • reject new async operations immediately after close while allowing queued and in-flight work to finish
  • close the underlying transport exactly once after the final accepted operation
  • preserve caller-owned executors and shut down only the client-owned default executor
  • make submit/close races non-blocking and preserve CompletionException identity and cleanup failures
  • document the lifecycle contract and add deterministic concurrency tests

Related Issue

Closes #109

Type of Change

  • Feature
  • Bug fix
  • Test
  • Documentation
  • Refactor
  • Build / CI
  • Release

Checklist

  • I created a branch before making changes.
  • I did not commit directly to main.
  • I used this pull request template.
  • I linked the relevant issue where possible.
  • I added or updated tests.
  • I updated documentation if needed.
  • Unreleased notes are consolidated in feat: improve environment-based client setup #113 to avoid cross-PR conflicts.
  • I ran mvn clean verify.
  • I did not include names of automated development tools in project artifacts.
  • I did not expose API tokens, secrets, private keys, account IDs, database IDs, customer data, or sensitive data.
  • I did not add new runtime dependencies without an issue and maintainer approval.

Testing

mvn -B clean verify javadoc:javadoc

All 113 tests passed, including deterministic queued, in-flight, acceptance-race, executor-rejection, post-close, cleanup-failure, and exception-identity cases.

Notes

close() remains non-blocking for accepted work. Deferred transport cleanup failures are surfaced through the final accepted future. Merge #113 after this pull request to add the consolidated changelog entry.

@xxvw xxvw mentioned this pull request Jul 27, 2026
16 of 18 tasks
@xxvw
xxvw marked this pull request as ready for review July 27, 2026 06:50
@xxvw
xxvw merged commit f183f35 into main Jul 27, 2026
6 checks passed
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.

[Bug]: Allow accepted async operations to finish during close

1 participant