Skip to content

fix(payload): skip payload resolution when the request is already gone#26365

Open
RandoomWalks wants to merge 1 commit into
paradigmxyz:mainfrom
RandoomWalks:fix-payload-resolve-closed-receiver
Open

fix(payload): skip payload resolution when the request is already gone#26365
RandoomWalks wants to merge 1 commit into
paradigmxyz:mainfrom
RandoomWalks:fix-payload-resolve-closed-receiver

Conversation

@RandoomWalks

Copy link
Copy Markdown
Contributor

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 (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 to UnknownPayload.

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_closed and send (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.

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Backlog

Development

Successfully merging this pull request may close these issues.

1 participant