runtime_service: don't panic if to_background_tx fails to upgrade after chain removal#2248
Open
SAY-5 wants to merge 1 commit intoparitytech:mainfrom
Open
runtime_service: don't panic if to_background_tx fails to upgrade after chain removal#2248SAY-5 wants to merge 1 commit intoparitytech:mainfrom
SAY-5 wants to merge 1 commit intoparitytech:mainfrom
Conversation
…er chain removal Signed-off-by: SAY-5 <say.apm35@gmail.com>
voliva
reviewed
May 4, 2026
Contributor
There was a problem hiding this comment.
I'm not familiarised enough with the codebase, but I'm wondering... the .unwrap() has been there for quite a long time, and it hasn’t caused issues until 3.1.1.
To me, it looks like it was written based on an assumption that may no longer hold true, and that could matter. Simply turning it into a noop when background_tx.upgrade() returns None might have other implications as well.
My question is, what’s actually causing this channel to close instead of cleanly shutting down whatever process it was handling?
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.
Fixes paritytech/smoldot#3238 (the same code path lives here at
light-base/src/runtime_service.rs:1689).When a chain object is removed concurrently with an in-flight
SubscribeAllresponse,background.to_background_tx.upgrade()returnsNoneand theunwrap()panics the runtime task — this is the panic users started hitting after upgrading to 3.1.1 in browser dapps. The receiver is going away anyway in that case; skip the response withcontinue.