-
Notifications
You must be signed in to change notification settings - Fork 3.8k
[fix](be) Avoid local runtime filter merge deadlock #64866
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
base: master
Are you sure you want to change the base?
Changes from 5 commits
9312248
c3d64bd
e41df92
7d55640
932b37e
a7f3ad4
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -39,19 +39,22 @@ class RuntimeFilterMergerTest : public RuntimeFilterTest { | |
| ASSERT_FALSE(merger->ready()); | ||
| ASSERT_EQ(merger->_wrapper->_state, RuntimeFilterWrapper::State::UNINITED); | ||
|
|
||
| bool ready = false; | ||
| std::shared_ptr<RuntimeFilterProducer> producer; | ||
| FAIL_IF_ERROR_OR_CATCH_EXCEPTION( | ||
| _runtime_states[0]->register_producer_runtime_filter(desc, &producer)); | ||
| producer->set_wrapper_state_and_ready_to_publish(first_product_state); | ||
| FAIL_IF_ERROR_OR_CATCH_EXCEPTION(merger->merge_from(producer.get())); | ||
| FAIL_IF_ERROR_OR_CATCH_EXCEPTION(merger->merge_from(producer.get(), &ready)); | ||
| ASSERT_FALSE(ready); | ||
| ASSERT_FALSE(merger->ready()); | ||
| ASSERT_EQ(merger->_wrapper->_state, first_expected_state); | ||
|
|
||
| std::shared_ptr<RuntimeFilterProducer> producer2; | ||
| FAIL_IF_ERROR_OR_CATCH_EXCEPTION( | ||
| _runtime_states[1]->register_producer_runtime_filter(desc, &producer2)); | ||
| producer2->set_wrapper_state_and_ready_to_publish(second_product_state); | ||
| FAIL_IF_ERROR_OR_CATCH_EXCEPTION(merger->merge_from(producer2.get())); | ||
| FAIL_IF_ERROR_OR_CATCH_EXCEPTION(merger->merge_from(producer2.get(), &ready)); | ||
| ASSERT_TRUE(ready); | ||
| ASSERT_TRUE(merger->ready()); | ||
| ASSERT_EQ(merger->_wrapper->_state, second_expected_state); | ||
| } | ||
|
|
@@ -66,12 +69,14 @@ class RuntimeFilterMergerTest : public RuntimeFilterTest { | |
| merger->set_expected_producer_num(1); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This test file still calls the old |
||
| ASSERT_FALSE(merger->ready()); | ||
|
|
||
| bool ready = false; | ||
| std::shared_ptr<RuntimeFilterProducer> producer; | ||
| FAIL_IF_ERROR_OR_CATCH_EXCEPTION( | ||
| _runtime_states[0]->register_producer_runtime_filter(desc, &producer)); | ||
| FAIL_IF_ERROR_OR_CATCH_EXCEPTION(producer->init(123)); | ||
| producer->set_wrapper_state_and_ready_to_publish(state); | ||
| FAIL_IF_ERROR_OR_CATCH_EXCEPTION(merger->merge_from(producer.get())); | ||
| FAIL_IF_ERROR_OR_CATCH_EXCEPTION(merger->merge_from(producer.get(), &ready)); | ||
| ASSERT_TRUE(ready); | ||
| ASSERT_TRUE(merger->ready()); | ||
|
|
||
| PMergeFilterRequest request; | ||
|
|
@@ -122,18 +127,21 @@ TEST_F(RuntimeFilterMergerTest, invalid_merge) { | |
| ASSERT_FALSE(merger->ready()); | ||
| ASSERT_EQ(merger->_wrapper->_state, RuntimeFilterWrapper::State::UNINITED); | ||
|
|
||
| bool ready = false; | ||
| std::shared_ptr<RuntimeFilterProducer> producer; | ||
| FAIL_IF_ERROR_OR_CATCH_EXCEPTION( | ||
| _runtime_states[0]->register_producer_runtime_filter(desc, &producer)); | ||
| producer->set_wrapper_state_and_ready_to_publish(RuntimeFilterWrapper::State::READY); | ||
| FAIL_IF_ERROR_OR_CATCH_EXCEPTION(merger->merge_from(producer.get())); // ready wrapper | ||
| FAIL_IF_ERROR_OR_CATCH_EXCEPTION(merger->merge_from(producer.get(), &ready)); | ||
| ASSERT_TRUE(ready); | ||
| ASSERT_TRUE(merger->ready()); | ||
| ASSERT_EQ(merger->_wrapper->_state, RuntimeFilterWrapper::State::READY); | ||
|
|
||
| std::shared_ptr<RuntimeFilterProducer> producer2; | ||
| FAIL_IF_ERROR_OR_CATCH_EXCEPTION( | ||
| _runtime_states[1]->register_producer_runtime_filter(desc, &producer2)); | ||
| producer2->set_wrapper_state_and_ready_to_publish(RuntimeFilterWrapper::State::READY); | ||
| auto st = merger->merge_from(producer2.get()); | ||
| auto st = merger->merge_from(producer2.get(), &ready); | ||
| ASSERT_EQ(st.code(), ErrorCode::INTERNAL_ERROR); | ||
| } | ||
|
|
||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.