Skip to content

relay: release FetchCrossExecFilter's downstream on its target executor - #653

Open
afrind wants to merge 1 commit into
mainfrom
test/fetch-crossexec-dtor-exec
Open

relay: release FetchCrossExecFilter's downstream on its target executor#653
afrind wants to merge 1 commit into
mainfrom
test/fetch-crossexec-dtor-exec

Conversation

@afrind

@afrind afrind commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

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 Reviewable

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
afrind force-pushed the test/fetch-crossexec-dtor-exec branch from e5704ed to 50b9908 Compare August 28, 2026 15:23
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.

Segfault during fetch

1 participant