relay: release FetchCrossExecFilter's downstream on its target executor - #653
Open
afrind wants to merge 1 commit into
Open
relay: release FetchCrossExecFilter's downstream on its target executor#653afrind wants to merge 1 commit into
afrind wants to merge 1 commit into
Conversation
selfGuard_ decides when the filter dies but not where: the upstream session holds a second ref and drops it on its io thread with no ordering against deactivate(). Whichever drop lands last destroys the filter, so downstream_ -- a cache writeback whose dtor erases from fetchesInProgress, unpins the group and touches the LRU -- could be released off the cache's executor. Only downstream_ has that affinity, so the destructor posts just its release to targetExec_ rather than deferring the whole object, as CrossExecFetchHandle already does with inner_. That requires targetExec_ to outlive the filter, which FetchReturnsSuccess violated by declaring its EventBase after the consumer; the declarations are reordered. Fixes: #650 Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
afrind
force-pushed
the
test/fetch-crossexec-dtor-exec
branch
from
August 28, 2026 15:23
e5704ed to
50b9908
Compare
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
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.
selfGuard_ decides when the filter dies but not where: the upstream session holds a second ref and drops it on its io thread with no ordering against deactivate(). Whichever drop lands last destroys the filter, so downstream_ -- a cache writeback whose dtor erases from fetchesInProgress, unpins the group and touches the LRU -- could be released off the cache's executor.
Only downstream_ has that affinity, so the destructor posts just its release to targetExec_ rather than deferring the whole object, as CrossExecFetchHandle already does with inner_. That requires targetExec_ to outlive the filter, which FetchReturnsSuccess violated by declaring its EventBase after the consumer; the declarations are reordered.
Fixes: #650
Claude-Session: https://claude.ai/code/session_01SdGFiDXgY1jWNQrDe9rabi
This change is