fix(factory): evict sender when an action panics during minting#4921
Open
envestcc wants to merge 1 commit into
Open
fix(factory): evict sender when an action panics during minting#4921envestcc wants to merge 1 commit into
envestcc wants to merge 1 commit into
Conversation
If a single pending action panics while runAction executes it during minting, the panic previously unwound past the sender-eviction logic in validateAndRun and was only caught by the mint goroutine's top-level recover, discarding the whole draft without removing the action from the pool. The same action would then be retried on every subsequent mint attempt. Recover the panic right around the single-action runAction call so it is converted into an ordinary error and routed through the existing default-error handling, which evicts the sender from the pool before this draft is abandoned. This turns a potential run of repeated draft failures into a one-time lost draft. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
|
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.


#4840 recovers panics on the mint path so a doomed draft cannot crash the process, and #4920 extends the same recover to
ValidateBlock. Neither removes the offending action from the pool, though: today a panic whilerunActionexecutes a single pending action unwinds past the sender-eviction logic invalidateAndRunand is only caught by the mint goroutine's top-level recover, discarding the whole draft. The same action is then picked up again on the next mint attempt.This adds a recover scoped to the single-action
runActioncall during minting, converting the panic into an ordinary error so it flows through the existing default-error handling invalidateAndRun— which already evicts the sender from the pool before the draft is abandoned for any other unexpected error.iotex_mint_action_panics_totalmetric and a regression test.