-
Notifications
You must be signed in to change notification settings - Fork 5.5k
fix(ci): Fix flaky test BroadcastTest.endToEndWithMultipleWriteNodes #26461
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
duxiao1212
wants to merge
1
commit into
prestodb:master
Choose a base branch
from
duxiao1212:export-D85685549
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Reviewer's guide (collapsed on small PRs)Reviewer's GuideInjects a delay and lifecycle barrier in BroadcastTest teardown to resolve a race in async cleanup and tidies up argument formatting in executeBroadcastRead. File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
duxiao1212
added a commit
to duxiao1212/presto
that referenced
this pull request
Oct 28, 2025
…restodb#26461) Summary: Fix flaky stress test buck2 test //github/presto-trunk/presto-native-execution/presto_cpp/main/operators/tests:presto_operators_test -- 'BroadcastTest.endToEndWithMultipleWriteNodes/zstd' --stress-runs 100 BroadcastTestParam::TearDown() inherited from OperatorTestBase https://www.internalfb.com/code/fbsource/[37f968940832]/fbcode/velox/exec/tests/utils/OperatorTestBase.cpp?lines=153 , We have an existing exchange source lifecycle protection for LocalExchangeSource https://fburl.com/code/aoz55crb. But our BroadcastTest..endToEndWithMultipleWriteNodes uses BroadcastExchangeSource which lacks this protection. Since it's just a flaky test, the most straightforward way is just inject a latency to handle a race condition in async cleanup. Differential Revision: D85685549
0206523 to
68501a1
Compare
duxiao1212
added a commit
to duxiao1212/presto
that referenced
this pull request
Oct 28, 2025
…stodb#26461) Summary: Fix flaky stress test buck2 test //github/presto-trunk/presto-native-execution/presto_cpp/main/operators/tests:presto_operators_test -- 'BroadcastTest.endToEndWithMultipleWriteNodes/zstd' --stress-runs 100 BroadcastTestParam::TearDown() inherited from OperatorTestBase https://www.internalfb.com/code/fbsource/[37f968940832]/fbcode/velox/exec/tests/utils/OperatorTestBase.cpp?lines=153 , We have an existing exchange source lifecycle protection for LocalExchangeSource https://fburl.com/code/aoz55crb. But our BroadcastTest..endToEndWithMultipleWriteNodes uses BroadcastExchangeSource which lacks this protection. Since it's just a flaky test, the most straightforward way is just inject a latency to handle a race condition in async cleanup. Differential Revision: D85685549
68501a1 to
5533bca
Compare
duxiao1212
added a commit
to duxiao1212/presto
that referenced
this pull request
Oct 29, 2025
…stodb#26461) Summary: Fix flaky stress test buck2 test //github/presto-trunk/presto-native-execution/presto_cpp/main/operators/tests:presto_operators_test -- 'BroadcastTest.endToEndWithMultipleWriteNodes/zstd' --stress-runs 100 BroadcastTestParam::TearDown() inherited from OperatorTestBase https://www.internalfb.com/code/fbsource/[37f968940832]/fbcode/velox/exec/tests/utils/OperatorTestBase.cpp?lines=153 , We have an existing exchange source lifecycle protection for LocalExchangeSource https://fburl.com/code/aoz55crb. But our BroadcastTest..endToEndWithMultipleWriteNodes uses BroadcastExchangeSource which lacks this protection. Since it's just a flaky test, the most straightforward way is just inject a latency to handle a race condition in async cleanup. Differential Revision: D85685549
5533bca to
fdcc383
Compare
duxiao1212
added a commit
to duxiao1212/presto
that referenced
this pull request
Oct 29, 2025
…stodb#26461) Summary: Fix flaky stress test buck2 test //github/presto-trunk/presto-native-execution/presto_cpp/main/operators/tests:presto_operators_test -- 'BroadcastTest.endToEndWithMultipleWriteNodes/zstd' --stress-runs 100 BroadcastTestParam::TearDown() inherited from OperatorTestBase https://www.internalfb.com/code/fbsource/[37f968940832]/fbcode/velox/exec/tests/utils/OperatorTestBase.cpp?lines=153 , We have an existing exchange source lifecycle protection for LocalExchangeSource https://fburl.com/code/aoz55crb. But our BroadcastTest..endToEndWithMultipleWriteNodes uses BroadcastExchangeSource which lacks this protection. Since it's just a flaky test, the most straightforward way is just inject a latency to handle a race condition in async cleanup. Differential Revision: D85685549
fdcc383 to
ee4d09b
Compare
duxiao1212
added a commit
to duxiao1212/presto
that referenced
this pull request
Oct 29, 2025
…stodb#26461) Summary: Fix flaky stress test buck2 test //github/presto-trunk/presto-native-execution/presto_cpp/main/operators/tests:presto_operators_test -- 'BroadcastTest.endToEndWithMultipleWriteNodes/zstd' --stress-runs 100 BroadcastTestParam::TearDown() inherited from OperatorTestBase https://www.internalfb.com/code/fbsource/[37f968940832]/fbcode/velox/exec/tests/utils/OperatorTestBase.cpp?lines=153 , We have an existing exchange source lifecycle protection for LocalExchangeSource https://fburl.com/code/aoz55crb. But our BroadcastTest..endToEndWithMultipleWriteNodes uses BroadcastExchangeSource which lacks this protection. Since it's just a flaky test, the most straightforward way is just inject a latency to handle a race condition in async cleanup. Differential Revision: D85685549
ee4d09b to
5d4704c
Compare
duxiao1212
added a commit
to duxiao1212/presto
that referenced
this pull request
Oct 29, 2025
…stodb#26461) Summary: Fix flaky stress test buck2 test //github/presto-trunk/presto-native-execution/presto_cpp/main/operators/tests:presto_operators_test -- 'BroadcastTest.endToEndWithMultipleWriteNodes/zstd' --stress-runs 100 BroadcastTestParam::TearDown() inherited from OperatorTestBase https://www.internalfb.com/code/fbsource/[37f968940832]/fbcode/velox/exec/tests/utils/OperatorTestBase.cpp?lines=153 , We have an existing exchange source lifecycle protection for LocalExchangeSource https://fburl.com/code/aoz55crb. But our BroadcastTest..endToEndWithMultipleWriteNodes uses BroadcastExchangeSource which lacks this protection. Since it's just a flaky test, the most straightforward way is just inject a latency to handle a race condition in async cleanup. Differential Revision: D85685549
88bf151 to
706aee6
Compare
duxiao1212
added a commit
to duxiao1212/presto
that referenced
this pull request
Oct 31, 2025
…stodb#26461) Summary: Fix flaky stress test buck2 test //github/presto-trunk/presto-native-execution/presto_cpp/main/operators/tests:presto_operators_test -- 'BroadcastTest.endToEndWithMultipleWriteNodes/zstd' --stress-runs 100 BroadcastTestParam::TearDown() inherited from OperatorTestBase https://www.internalfb.com/code/fbsource/[37f968940832]/fbcode/velox/exec/tests/utils/OperatorTestBase.cpp?lines=153 , We have an existing exchange source lifecycle protection for LocalExchangeSource https://fburl.com/code/aoz55crb. But our BroadcastTest..endToEndWithMultipleWriteNodes uses BroadcastExchangeSource which lacks this protection. Task::addExchangeClientPool() creates leaf pool. BroadcastExchangeSource's async work on executor_ captures shared_ptr<ExchangeSource> with buffers allocated from this pool. We need release the leaf pool before resetMemory to avoid arbitrary memory check failure. Differential Revision: D85685549
xiaoxmeng
previously approved these changes
Oct 31, 2025
…stodb#26461) Summary: Fix flaky stress test buck2 test //github/presto-trunk/presto-native-execution/presto_cpp/main/operators/tests:presto_operators_test -- 'BroadcastTest.endToEndWithMultipleWriteNodes/zstd' --stress-runs 100 BroadcastTestParam::TearDown() inherited from OperatorTestBase https://www.internalfb.com/code/fbsource/[37f968940832]/fbcode/velox/exec/tests/utils/OperatorTestBase.cpp?lines=153 , We have an existing exchange source lifecycle protection for LocalExchangeSource https://fburl.com/code/aoz55crb. But our BroadcastTest..endToEndWithMultipleWriteNodes uses BroadcastExchangeSource which lacks this protection. Task::addExchangeClientPool() creates leaf pool. BroadcastExchangeSource's async work on executor_ captures shared_ptr<ExchangeSource> with buffers allocated from this pool. We need release the leaf pool before resetMemory to avoid arbitrary memory check failure. Reviewed By: xiaoxmeng Differential Revision: D85685549
706aee6 to
be2689c
Compare
xiaoxmeng
approved these changes
Oct 31, 2025
duxiao1212
added a commit
to duxiao1212/velox
that referenced
this pull request
Oct 31, 2025
Summary: X-link: prestodb/presto#26461 Fix flaky stress test buck2 test //github/presto-trunk/presto-native-execution/presto_cpp/main/operators/tests:presto_operators_test -- 'BroadcastTest.endToEndWithMultipleWriteNodes/zstd' --stress-runs 100 BroadcastTestParam::TearDown() inherited from OperatorTestBase https://www.internalfb.com/code/fbsource/[37f968940832]/fbcode/velox/exec/tests/utils/OperatorTestBase.cpp?lines=153 , Added executor_.reset() to fix the flakness. Task::addExchangeClientPool() creates leaf pool. BroadcastExchangeSource's async work on executor_ captures shared_ptr<ExchangeSource> with buffers allocated from this pool. We need release the leaf pool before resetMemory to avoid arbitrary memory check failure. The reference chain is: exchangeClient.0.0 [shared_ptr] → node.0 [shared_ptr] → query..2 Without the fix, the destructor of the leaf pool was handled asynchronously in another thread, so that exchangeClient.0.0 pool may be destroyed AFTER SharedArbitrator::shutdown(). executor_.reset() blocks and waits for all queued async work to complete, which includes the ExchangeSource cleanup that eventually destroys the exchangeClient.0.0 leaf pool. This ensures the pool hierarchy is fully cleaned up before OperatorTestBase::TearDown() runs SharedArbitrator::shutdown(). Reviewed By: xiaoxmeng Differential Revision: D85685549
duxiao1212
added a commit
to duxiao1212/velox
that referenced
this pull request
Oct 31, 2025
…bator#15344) Summary: X-link: prestodb/presto#26461 Reset executor before test teardown to ensure async work completes and releases memory pool references before SharedArbitrator shutdown checks. The executor thread pool processes async tasks could hold references to leaf memory pools. Without explicitly resetting the executor, these tasks complete after TearDown(), keeping the pool hierarchy alive during shutdown assertions, causing " Unexpected alive participants" errors. Reviewed By: xiaoxmeng Differential Revision: D85685549
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary:
X-link: #26461
Fix flaky stress test buck2 test //github/presto-trunk/presto-native-execution/presto_cpp/main/operators/tests:presto_operators_test -- 'BroadcastTest.endToEndWithMultipleWriteNodes/zstd' --stress-runs 100
BroadcastTestParam::TearDown() inherited from OperatorTestBase https://www.internalfb.com/code/fbsource/[37f968940832]/fbcode/velox/exec/tests/utils/OperatorTestBase.cpp?lines=153 ,
Added executor_.reset() to fix the flakness.
Task::addExchangeClientPool() creates leaf pool. BroadcastExchangeSource's async work on executor_ captures shared_ptr with buffers allocated from this pool. We need release the leaf pool before resetMemory to avoid arbitrary memory check failure.
The reference chain is: exchangeClient.0.0 [shared_ptr] → node.0 [shared_ptr] → query..2
Without the fix, the destructor of the leaf pool was handled asynchronously in another thread, so that exchangeClient.0.0 pool may be destroyed AFTER SharedArbitrator::shutdown(). executor_.reset() blocks and waits for all queued async work to complete, which includes the ExchangeSource cleanup that eventually destroys the exchangeClient.0.0 leaf pool. This ensures the pool hierarchy is fully cleaned up before OperatorTestBase::TearDown() runs SharedArbitrator::shutdown().
Reviewed By: xiaoxmeng
Differential Revision: D85685549
Differential Revision: D85685549