-
Notifications
You must be signed in to change notification settings - Fork 734
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
subscriber: clear per-layer interest when short circuiting #1569
Merged
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
Signed-off-by: Eliza Weisman <[email protected]>
Signed-off-by: Eliza Weisman <[email protected]>
This test repros the bug the assertion was *supposed* to prevent. Signed-off-by: Eliza Weisman <[email protected]>
Signed-off-by: Eliza Weisman <[email protected]>
davidbarsky
approved these changes
Sep 15, 2021
hawkw
added a commit
that referenced
this pull request
Sep 16, 2021
# 0.2.23 (September 16, 2021) This release fixes a few bugs in the per-layer filtering API added in v0.2.21. ### Fixed - **env-filter**: Fixed excessive `EnvFilter` memory use ([#1568]) - **filter**: Fixed a panic that may occur in debug mode when using per-layer filters together with global filters ([#1569]) - Fixed incorrect documentation formatting ([#1572]) [#1568]: #1568 [#1569]: #1569 [#1572]: #1572
hawkw
added a commit
that referenced
this pull request
Sep 16, 2021
# 0.2.23 (September 16, 2021) This release fixes a few bugs in the per-layer filtering API added in v0.2.21. ### Fixed - **env-filter**: Fixed excessive `EnvFilter` memory use ([#1568]) - **filter**: Fixed a panic that may occur in debug mode when using per-layer filters together with global filters ([#1569]) - Fixed incorrect documentation formatting ([#1572]) [#1568]: #1568 [#1569]: #1569 [#1572]: #1572
davidbarsky
pushed a commit
that referenced
this pull request
Nov 29, 2021
Currently, when evaluating `register_callsite` for a stack containing per-layer filters, the intermediate `Interest` from combining the per layer filters' `Interest`s is stored in the thread-local `FilterState`. When all per-layer filters have been evaluated, we reach the `Registry`, which clears the `FilterState` and bubbles the `Interest` back up. However, when a _global_ filter in the stack returns `Interest::never`, we short-circuit, and don't reach the `Registry`. This means the `Interest` state is not cleared. This branch adds code in `Layered` to ensure the per-layer filter state is cleared when a global filter short circuits `Interest` evaluation. This fixes #1563. Signed-off-by: Eliza Weisman <[email protected]>
davidbarsky
pushed a commit
that referenced
this pull request
Mar 18, 2022
Currently, when evaluating `register_callsite` for a stack containing per-layer filters, the intermediate `Interest` from combining the per layer filters' `Interest`s is stored in the thread-local `FilterState`. When all per-layer filters have been evaluated, we reach the `Registry`, which clears the `FilterState` and bubbles the `Interest` back up. However, when a _global_ filter in the stack returns `Interest::never`, we short-circuit, and don't reach the `Registry`. This means the `Interest` state is not cleared. This branch adds code in `Layered` to ensure the per-layer filter state is cleared when a global filter short circuits `Interest` evaluation. This fixes #1563. Signed-off-by: Eliza Weisman <[email protected]>
hawkw
added a commit
that referenced
this pull request
Mar 23, 2022
Currently, when evaluating `register_callsite` for a stack containing per-layer filters, the intermediate `Interest` from combining the per layer filters' `Interest`s is stored in the thread-local `FilterState`. When all per-layer filters have been evaluated, we reach the `Registry`, which clears the `FilterState` and bubbles the `Interest` back up. However, when a _global_ filter in the stack returns `Interest::never`, we short-circuit, and don't reach the `Registry`. This means the `Interest` state is not cleared. This branch adds code in `Layered` to ensure the per-layer filter state is cleared when a global filter short circuits `Interest` evaluation. This fixes #1563. Signed-off-by: Eliza Weisman <[email protected]>
hawkw
added a commit
that referenced
this pull request
Mar 23, 2022
Currently, when evaluating `register_callsite` for a stack containing per-subscriber filters, the intermediate `Interest` from combining the per-subscriber filters' `Interest`s is stored in the thread-local `FilterState`. When all per-subscriber filters have been evaluated, we reach the `Registry`, which clears the `FilterState` and bubbles the `Interest` back up. However, when a _global_ filter in the stack returns `Interest::never`, we short-circuit, and don't reach the `Registry`. This means the `Interest` state is not cleared. This branch adds code in `Layered` to ensure the per-subscriber filter state is cleared when a global filter short circuits `Interest` evaluation. This fixes #1563. Signed-off-by: Eliza Weisman <[email protected]>
hawkw
added a commit
that referenced
this pull request
Mar 23, 2022
Currently, when evaluating `register_callsite` for a stack containing per-subscriber filters, the intermediate `Interest` from combining the per-subscriber filters' `Interest`s is stored in the thread-local `FilterState`. When all per-subscriber filters have been evaluated, we reach the `Registry`, which clears the `FilterState` and bubbles the `Interest` back up. However, when a _global_ filter in the stack returns `Interest::never`, we short-circuit, and don't reach the `Registry`. This means the `Interest` state is not cleared. This branch adds code in `Layered` to ensure the per-subscriber filter state is cleared when a global filter short circuits `Interest` evaluation. This fixes #1563. Signed-off-by: Eliza Weisman <[email protected]>
hawkw
added a commit
that referenced
this pull request
Mar 24, 2022
Currently, when evaluating `register_callsite` for a stack containing per-subscriber filters, the intermediate `Interest` from combining the per-subscriber filters' `Interest`s is stored in the thread-local `FilterState`. When all per-subscriber filters have been evaluated, we reach the `Registry`, which clears the `FilterState` and bubbles the `Interest` back up. However, when a _global_ filter in the stack returns `Interest::never`, we short-circuit, and don't reach the `Registry`. This means the `Interest` state is not cleared. This branch adds code in `Layered` to ensure the per-subscriber filter state is cleared when a global filter short circuits `Interest` evaluation. This fixes #1563. Signed-off-by: Eliza Weisman <[email protected]>
hawkw
added a commit
that referenced
this pull request
Mar 24, 2022
Currently, when evaluating `register_callsite` for a stack containing per-subscriber filters, the intermediate `Interest` from combining the per-subscriber filters' `Interest`s is stored in the thread-local `FilterState`. When all per-subscriber filters have been evaluated, we reach the `Registry`, which clears the `FilterState` and bubbles the `Interest` back up. However, when a _global_ filter in the stack returns `Interest::never`, we short-circuit, and don't reach the `Registry`. This means the `Interest` state is not cleared. This branch adds code in `Layered` to ensure the per-subscriber filter state is cleared when a global filter short circuits `Interest` evaluation. This fixes #1563. Signed-off-by: Eliza Weisman <[email protected]>
hawkw
added a commit
that referenced
this pull request
Mar 24, 2022
Currently, when evaluating `register_callsite` for a stack containing per-subscriber filters, the intermediate `Interest` from combining the per-subscriber filters' `Interest`s is stored in the thread-local `FilterState`. When all per-subscriber filters have been evaluated, we reach the `Registry`, which clears the `FilterState` and bubbles the `Interest` back up. However, when a _global_ filter in the stack returns `Interest::never`, we short-circuit, and don't reach the `Registry`. This means the `Interest` state is not cleared. This branch adds code in `Layered` to ensure the per-subscriber filter state is cleared when a global filter short circuits `Interest` evaluation. This fixes #1563. Signed-off-by: Eliza Weisman <[email protected]>
hawkw
added a commit
that referenced
this pull request
Mar 24, 2022
Currently, when evaluating `register_callsite` for a stack containing per-subscriber filters, the intermediate `Interest` from combining the per-subscriber filters' `Interest`s is stored in the thread-local `FilterState`. When all per-subscriber filters have been evaluated, we reach the `Registry`, which clears the `FilterState` and bubbles the `Interest` back up. However, when a _global_ filter in the stack returns `Interest::never`, we short-circuit, and don't reach the `Registry`. This means the `Interest` state is not cleared. This branch adds code in `Layered` to ensure the per-subscriber filter state is cleared when a global filter short circuits `Interest` evaluation. This fixes #1563. Signed-off-by: Eliza Weisman <[email protected]>
hawkw
added a commit
that referenced
this pull request
Mar 24, 2022
Currently, when evaluating `register_callsite` for a stack containing per-subscriber filters, the intermediate `Interest` from combining the per-subscriber filters' `Interest`s is stored in the thread-local `FilterState`. When all per-subscriber filters have been evaluated, we reach the `Registry`, which clears the `FilterState` and bubbles the `Interest` back up. However, when a _global_ filter in the stack returns `Interest::never`, we short-circuit, and don't reach the `Registry`. This means the `Interest` state is not cleared. This branch adds code in `Layered` to ensure the per-subscriber filter state is cleared when a global filter short circuits `Interest` evaluation. This fixes #1563. Signed-off-by: Eliza Weisman <[email protected]>
hawkw
added a commit
that referenced
this pull request
Mar 24, 2022
Currently, when evaluating `register_callsite` for a stack containing per-subscriber filters, the intermediate `Interest` from combining the per-subscriber filters' `Interest`s is stored in the thread-local `FilterState`. When all per-subscriber filters have been evaluated, we reach the `Registry`, which clears the `FilterState` and bubbles the `Interest` back up. However, when a _global_ filter in the stack returns `Interest::never`, we short-circuit, and don't reach the `Registry`. This means the `Interest` state is not cleared. This branch adds code in `Layered` to ensure the per-subscriber filter state is cleared when a global filter short circuits `Interest` evaluation. This fixes #1563. Signed-off-by: Eliza Weisman <[email protected]>
hawkw
added a commit
that referenced
this pull request
Mar 24, 2022
Currently, when evaluating `register_callsite` for a stack containing per-subscriber filters, the intermediate `Interest` from combining the per-subscriber filters' `Interest`s is stored in the thread-local `FilterState`. When all per-subscriber filters have been evaluated, we reach the `Registry`, which clears the `FilterState` and bubbles the `Interest` back up. However, when a _global_ filter in the stack returns `Interest::never`, we short-circuit, and don't reach the `Registry`. This means the `Interest` state is not cleared. This branch adds code in `Layered` to ensure the per-subscriber filter state is cleared when a global filter short circuits `Interest` evaluation. This fixes #1563. Signed-off-by: Eliza Weisman <[email protected]>
hawkw
added a commit
that referenced
this pull request
Mar 24, 2022
Currently, when evaluating `register_callsite` for a stack containing per-subscriber filters, the intermediate `Interest` from combining the per-subscriber filters' `Interest`s is stored in the thread-local `FilterState`. When all per-subscriber filters have been evaluated, we reach the `Registry`, which clears the `FilterState` and bubbles the `Interest` back up. However, when a _global_ filter in the stack returns `Interest::never`, we short-circuit, and don't reach the `Registry`. This means the `Interest` state is not cleared. This branch adds code in `Layered` to ensure the per-subscriber filter state is cleared when a global filter short circuits `Interest` evaluation. This fixes #1563. Signed-off-by: Eliza Weisman <[email protected]>
kaffarell
pushed a commit
to kaffarell/tracing
that referenced
this pull request
May 22, 2024
…1569) Currently, when evaluating `register_callsite` for a stack containing per-layer filters, the intermediate `Interest` from combining the per layer filters' `Interest`s is stored in the thread-local `FilterState`. When all per-layer filters have been evaluated, we reach the `Registry`, which clears the `FilterState` and bubbles the `Interest` back up. However, when a _global_ filter in the stack returns `Interest::never`, we short-circuit, and don't reach the `Registry`. This means the `Interest` state is not cleared. This branch adds code in `Layered` to ensure the per-layer filter state is cleared when a global filter short circuits `Interest` evaluation. This fixes tokio-rs#1563. Signed-off-by: Eliza Weisman <[email protected]>
kaffarell
pushed a commit
to kaffarell/tracing
that referenced
this pull request
May 22, 2024
# 0.2.23 (September 16, 2021) This release fixes a few bugs in the per-layer filtering API added in v0.2.21. ### Fixed - **env-filter**: Fixed excessive `EnvFilter` memory use ([tokio-rs#1568]) - **filter**: Fixed a panic that may occur in debug mode when using per-layer filters together with global filters ([tokio-rs#1569]) - Fixed incorrect documentation formatting ([tokio-rs#1572]) [tokio-rs#1568]: tokio-rs#1568 [tokio-rs#1569]: tokio-rs#1569 [tokio-rs#1572]: tokio-rs#1572
kaffarell
pushed a commit
to kaffarell/tracing
that referenced
this pull request
May 22, 2024
…s#1575) This is essentially the same change as tokio-rs#1569, but for `enabled` states rather than `register_callsite`. When a global filter returns `false` from `enabled`, ensure that the per-layer filter `FilterMap` and debug counters are cleared, so that they are empty on the next `enabled` call. See tokio-rs#1563
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.
Currently, when evaluating
register_callsite
for a stack containingper-layer filters, the intermediate
Interest
from combining the perlayer filters'
Interest
s is stored in the thread-localFilterState
.When all per-layer filters have been evaluated, we reach the
Registry
,which clears the
FilterState
and bubbles theInterest
back up.However, when a global filter in the stack returns
Interest::never
,we short-circuit, and don't reach the
Registry
. This means theInterest
state is not cleared.This branch adds code in
Layered
to ensure the per-layer filter stateis cleared when a global filter short circuits
Interest
evaluation.This fixes #1563.