Skip to content

test(pool): cover cancellation during bounded acquisition - #286

Merged
tisonkun merged 1 commit into
apache:mainfrom
QwQBiG:test/pool-acquire-cancellation
Sep 7, 2026
Merged

test(pool): cover cancellation during bounded acquisition#286
tisonkun merged 1 commit into
apache:mainfrom
QwQBiG:test/pool-acquire-cancellation

Conversation

@QwQBiG

@QwQBiG QwQBiG commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

Summary

Motivated by reviewing OpenDAL's proposed Asyncband migration in apache/opendal#8219. Its Memcached connection acquisition races pool.get() against a ten-second timeout, so an unfinished acquisition can be cancelled.

Add bounded pool tests for cancellation:

  • while waiting for capacity;
  • after notification but before the acquisition is polled again;
  • during object creation, with another acquisition waiting.

These complement the existing recycling and replenishment cancellation tests by checking acquisition cancellation through the public pool API. They verify waiter progress, capacity recovery, and object reuse.

The tests use controlled polling without network calls or wall-clock timeouts. They check wake-driven progress without requiring FIFO notification order. Production code is unchanged; this is coverage for the existing cancellation contract, not a fix for an observed downstream failure.

Validation

  • 23 pool integration tests passed on stable and Rust 1.86.
  • cargo x test: 476 tests and doctests passed.
  • Targeted Clippy, rustfmt, typos, and Hawkeye checks passed.

Validation was performed locally in my WSL Linux.

Signed-off-by: QwQBiG <baigaozi114514@gmail.com>
@QwQBiG

QwQBiG commented Sep 5, 2026

Copy link
Copy Markdown
Contributor Author

This is a non-blocking, test-only follow-up and can wait until after the 0.7.2 release.

@tisonkun tisonkun left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your contribution @QwQBiG! LGTM.

Merging ...

@tisonkun

tisonkun commented Sep 7, 2026

Copy link
Copy Markdown
Member

can wait until after the 0.7.2 release.

Need not to wait for release. I generally consider our release model as a release train model where if a release failed, we start a new release from the new latest commit.

@tisonkun
tisonkun merged commit a839dfc into apache:main Sep 7, 2026
10 checks passed
@QwQBiG

QwQBiG commented Sep 7, 2026

Copy link
Copy Markdown
Contributor Author

release train model where if a release failed, we start a new release from the new latest commit.

Got it~ Thanks for the clarification and the merge~

@QwQBiG
QwQBiG deleted the test/pool-acquire-cancellation branch September 7, 2026 10:25
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.

2 participants