Skip to content

[fix][test] Avoid blocking common-pool workers in ledger shutdown test - #26560

Open
lhotari wants to merge 1 commit into
apache:masterfrom
lhotari:lh-fix-ledger-shutdown-test
Open

[fix][test] Avoid blocking common-pool workers in ledger shutdown test#26560
lhotari wants to merge 1 commit into
apache:masterfrom
lhotari:lh-fix-ledger-shutdown-test

Conversation

@lhotari

@lhotari lhotari commented Sep 12, 2026

Copy link
Copy Markdown
Member

Motivation

ManagedLedgerFactoryShutdownTest.openEncounteredShutdown delays metadata reads by blocking common-pool workers on a latch. Shutdown also schedules completion on that pool, so a small common pool can stall before the test releases the latch.

Modifications

Gate the mocked metadata reads with a CompletableFuture created for each test invocation. Complete the gate after shutdown, preserving the late-read scenario and callback assertions without occupying workers while waiting.

Verifying this change

  • Make sure that the change passes the CI checks.

Verified ManagedLedgerFactoryShutdownTest.openEncounteredShutdown locally with temporary invocationCount = 10: 10/10 passed with retries disabled. With common-pool parallelism set to 2, the original test times out after 5 seconds and the fixed test passes 10/10 invocations. The temporary invocation count was removed.

./gradlew spotlessCheck checkstyleMain checkstyleTest passed.

Does this pull request potentially affect one of the following parts:

  • Dependencies (add or upgrade a dependency)
  • The public API
  • The schema
  • The default values of configurations
  • The threading model
  • The binary protocol
  • The REST endpoints
  • The admin CLI options
  • The metrics
  • Anything that affects deployment

@void-ptr974 void-ptr974 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

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