-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
singleton manager: use ASSERT_IS_MAIN_OR_TEST_THREAD rather than comparing tid directly #34766
Merged
+32
−41
Conversation
This file contains 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
…aring tid directly Signed-off-by: wbpcode <wbphub@live.com>
mattklein123
approved these changes
Jun 17, 2024
wbpcode
pushed a commit
to wbpcode/envoy
that referenced
this pull request
Jun 18, 2024
Signed-off-by: wbpcode <wbphub@live.com>
Nealsoni00
pushed a commit
to Nealsoni00/envoy
that referenced
this pull request
Jun 18, 2024
…aring tid directly (envoyproxy#34766) * singleton manager: use ASSERT_IS_MAIN_OR_TEST_THREAD rather than comparing tid directly Signed-off-by: wbpcode <wbphub@live.com> * fix test Signed-off-by: wbpcode <wbphub@live.com> * fix test Signed-off-by: wbpcode <wbphub@live.com> --------- Signed-off-by: wbpcode <wbphub@live.com> Co-authored-by: wbpcode <wbphub@live.com> Signed-off-by: Neal Soni <Nealsoni00@gmail.com>
wbpcode
added a commit
that referenced
this pull request
Jun 21, 2024
* local rate limit: add cross local cluster rate limit support Signed-off-by: wbpcode <wbphub@live.com> * change log Signed-off-by: wbpcode <wbphub@live.com> * fix typo Signed-off-by: wbpcode <wbphub@live.com> * add integration tests Signed-off-by: wbpcode <wbphub@live.com> * fix test Signed-off-by: wbpcode <wbphub@live.com> * main thread assert Signed-off-by: wbpcode <wbphub@live.com> * Update api/envoy/extensions/common/ratelimit/v3/ratelimit.proto Co-authored-by: Adi (Suissa) Peleg <adip@google.com> Signed-off-by: code <wangbaiping@corp.netease.com> * Update api/envoy/extensions/filters/http/local_ratelimit/v3/local_rate_limit.proto Co-authored-by: Adi (Suissa) Peleg <adip@google.com> Signed-off-by: code <wangbaiping@corp.netease.com> * address comments Signed-off-by: wbpcode <wbphub@live.com> * remove macro after #34766 Signed-off-by: wbpcode <wbphub@live.com> * resolve confliction after merge main Signed-off-by: wbpcode <wbphub@live.com> --------- Signed-off-by: wbpcode <wbphub@live.com> Signed-off-by: code <wangbaiping@corp.netease.com> Co-authored-by: wbpcode <wbphub@live.com> Co-authored-by: Adi (Suissa) Peleg <adip@google.com>
nbaws
pushed a commit
to nbaws/envoy
that referenced
this pull request
Jun 22, 2024
…oxy#34276) * local rate limit: add cross local cluster rate limit support Signed-off-by: wbpcode <wbphub@live.com> * change log Signed-off-by: wbpcode <wbphub@live.com> * fix typo Signed-off-by: wbpcode <wbphub@live.com> * add integration tests Signed-off-by: wbpcode <wbphub@live.com> * fix test Signed-off-by: wbpcode <wbphub@live.com> * main thread assert Signed-off-by: wbpcode <wbphub@live.com> * Update api/envoy/extensions/common/ratelimit/v3/ratelimit.proto Co-authored-by: Adi (Suissa) Peleg <adip@google.com> Signed-off-by: code <wangbaiping@corp.netease.com> * Update api/envoy/extensions/filters/http/local_ratelimit/v3/local_rate_limit.proto Co-authored-by: Adi (Suissa) Peleg <adip@google.com> Signed-off-by: code <wangbaiping@corp.netease.com> * address comments Signed-off-by: wbpcode <wbphub@live.com> * remove macro after envoyproxy#34766 Signed-off-by: wbpcode <wbphub@live.com> * resolve confliction after merge main Signed-off-by: wbpcode <wbphub@live.com> --------- Signed-off-by: wbpcode <wbphub@live.com> Signed-off-by: code <wangbaiping@corp.netease.com> Co-authored-by: wbpcode <wbphub@live.com> Co-authored-by: Adi (Suissa) Peleg <adip@google.com> Signed-off-by: Nigel Brittain <nbaws@amazon.com> change init behaviour Signed-off-by: Nigel Brittain <nbaws@amazon.com> extraneous comments Signed-off-by: Nigel Brittain <nbaws@amazon.com> fix cluster init Signed-off-by: Nigel Brittain <nbaws@amazon.com> cluster fix Signed-off-by: Nigel Brittain <nbaws@amazon.com> format Signed-off-by: Nigel Brittain <nbaws@amazon.com> Signed-off-by: code <wbphub@gmail.com>
antoniovleonti
pushed a commit
to antoniovleonti/envoy
that referenced
this pull request
Jun 26, 2024
…aring tid directly (envoyproxy#34766) * singleton manager: use ASSERT_IS_MAIN_OR_TEST_THREAD rather than comparing tid directly Signed-off-by: wbpcode <wbphub@live.com> * fix test Signed-off-by: wbpcode <wbphub@live.com> * fix test Signed-off-by: wbpcode <wbphub@live.com> --------- Signed-off-by: wbpcode <wbphub@live.com> Co-authored-by: wbpcode <wbphub@live.com> Signed-off-by: antoniovleonti <leonti@google.com>
antoniovleonti
pushed a commit
to antoniovleonti/envoy
that referenced
this pull request
Jun 26, 2024
…oxy#34276) * local rate limit: add cross local cluster rate limit support Signed-off-by: wbpcode <wbphub@live.com> * change log Signed-off-by: wbpcode <wbphub@live.com> * fix typo Signed-off-by: wbpcode <wbphub@live.com> * add integration tests Signed-off-by: wbpcode <wbphub@live.com> * fix test Signed-off-by: wbpcode <wbphub@live.com> * main thread assert Signed-off-by: wbpcode <wbphub@live.com> * Update api/envoy/extensions/common/ratelimit/v3/ratelimit.proto Co-authored-by: Adi (Suissa) Peleg <adip@google.com> Signed-off-by: code <wangbaiping@corp.netease.com> * Update api/envoy/extensions/filters/http/local_ratelimit/v3/local_rate_limit.proto Co-authored-by: Adi (Suissa) Peleg <adip@google.com> Signed-off-by: code <wangbaiping@corp.netease.com> * address comments Signed-off-by: wbpcode <wbphub@live.com> * remove macro after envoyproxy#34766 Signed-off-by: wbpcode <wbphub@live.com> * resolve confliction after merge main Signed-off-by: wbpcode <wbphub@live.com> --------- Signed-off-by: wbpcode <wbphub@live.com> Signed-off-by: code <wangbaiping@corp.netease.com> Co-authored-by: wbpcode <wbphub@live.com> Co-authored-by: Adi (Suissa) Peleg <adip@google.com> Signed-off-by: antoniovleonti <leonti@google.com>
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.
Commit Message: singleton manager: use ASSERT_IS_MAIN_OR_TEST_THREAD rather than comparing tid directly
Additional Description:
Singleton manager is introduced in the #1410 and
tid comparing
is used to ensure the singleton manager is only used in the thread where it's created (main thread or test thread).However, in the integration test, the singleton manager is created in the separated thread and we cannot access it in the test thread.
This PR updated the
tid comparing
to the ASSERT_IS_MAIN_OR_TEST_THREAD to resolve the problem. (And I think the ASSERT_IS_MAIN_OR_TEST_THREAD macro should be an unified way to ensure we are in the main thread)Risk Level: low.
Testing: n/a.
Docs Changes: n/a.
Release Notes: n/a.
Platform Specific Features: n/a.