Skip to content

RLQS: Improve timer lifetime management#44236

Open
yanavlasov wants to merge 1 commit intoenvoyproxy:mainfrom
yanavlasov:rlqs-fix
Open

RLQS: Improve timer lifetime management#44236
yanavlasov wants to merge 1 commit intoenvoyproxy:mainfrom
yanavlasov:rlqs-fix

Conversation

@yanavlasov
Copy link
Copy Markdown
Contributor

  1. Refactored GlobalRateLimitClientImpl to inherit from std::enable_shared_from_this.
  2. Updated all asynchronous callbacks in GlobalRateLimitClientImpl to capture a weak_ptr to 'this' and use the lock-and-check pattern.
  3. Changed TlsStore to hold a std::shared_ptr and implement a custom deleter for std::shared_ptr to ensure main-thread cleanup, even when dropped by worker threads.
  4. Updated LocalRateLimitClientImpl to hold a std::shared_ptr, anchoring the lifetime of the global client and its resources for the duration of the filter.
  5. Updated unit tests to align with the new lifetime management model.

Risk Level: medium
Testing: unit tests
Docs Changes: n/a
Release Notes: n/a
Platform Specific Features: n/a

Signed-off-by: Yan Avlasov <yavlasov@google.com>
@yanavlasov yanavlasov requested a review from tyxia as a code owner April 2, 2026 14:22
@yanavlasov
Copy link
Copy Markdown
Contributor Author

@bsurber for review

Copy link
Copy Markdown
Contributor

@bsurber bsurber left a comment

Choose a reason for hiding this comment

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

LGTM once you have the last bit of coverage

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