fix(payload): skip payload resolution when the request is already gone#26365
Open
RandoomWalks wants to merge 1 commit into
Open
fix(payload): skip payload resolution when the request is already gone#26365RandoomWalks wants to merge 1 commit into
RandoomWalks wants to merge 1 commit into
Conversation
engine_getPayload resolution consumes the payload job (KeepPayloadJobAlive::No) before the response reaches the caller. If the request future is dropped after the resolve command was queued, the service still resolves it: the job is removed, tx.send(payload_fut) fails, the unsent future is dropped, and the resolved-payload cache is never written. A retry for the same advertised payload id then returns UnknownPayload. Skip resolution when the response receiver is already closed, keeping the job and any in-progress build available for a retry. Same ordering principle as paradigmxyz#24967: only consume state once the response can be delivered. The check races a drop landing between is_closed and send (the residual window of the eager send from paradigmxyz#25242), and dropping the returned future after the service replied still cancels the job as documented. Addresses the unsent-receiver window of paradigmxyz#26302; test adapted from the report's reproduction with the bad-state assertions inverted.
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.
engine_getPayloadresolution consumes the payload job (KeepPayloadJobAlive::No) before the response reaches the caller. If the request future is dropped after the resolve command was queued (CL-side getPayload timeout, authrpc connection reset, server shutdown), the service still resolves it: the job is removed,tx.send(payload_fut)fails, the unsent future is dropped, and the resolved-payload cache is never written. A retry for the same advertised payload id then maps toUnknownPayload.This skips resolution when the response receiver is already closed, keeping the job and any in-progress build available for a retry — the same ordering principle as #24967: state is only consumed once the response can actually be delivered. Behavior change: a resolve whose caller disappeared before processing no longer cancels the in-progress build; the job runs to its regular deadline.
Non-goals: the check races a drop landing between
is_closedandsend(the residual window of the eager send introduced in #25242), and dropping the returned future after the service has replied still cancels the job as documented.Addresses the unsent-receiver window of #26302. Regression test adapted from the reproduction in that report with the bad-state assertions inverted.