Repository navigation
Fix callback ID reuse race before sending responses - #2
Open
muratcakir wants to merge 1 commit into
Open
muratcakir wants to merge 1 commit into
muratcakir wants to merge 1 commit into
Conversation
Author
|
Hello, anybody there? 🙋♂️ |
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.
Problem
The compiler can legitimately reuse a callback ID after receiving its response.
ProtocolTransport may flush that response before the asynchronous send continuation
resumes. CompilationOperation currently retires the pending callback ID in that
continuation's finally block. An incoming request that reuses the ID during this
window is therefore rejected as a duplicate.
We observed this in Smartstore's Linux ARM64 CI with:
SassProtocolException: Duplicate pending ImportRequest callback ID 0.
This is a scheduling race in the managed protocol implementation, not inherently
an ARM64-only failure.
Fix
Retire the callback ID immediately before submitting its response to the sender.
Remove the continuation-based cleanup, which could otherwise remove a newly
registered callback using the same ID. Keep duplicate detection active while
the importer or custom function is still handling a request.
No public API, native compiler or protocol encoding changes are needed.
Regression coverage
callback types: canonicalize, import, file import and function call.
Validation
The original implementation failed the four immediate-reuse cases; the fixed
implementation passes all 54 protocol tests locally on Windows x64.
No native ARM64 integration run has been performed with this fix.