fix: runner: reconnect after parachain connection error#462
Open
sander2 wants to merge 1 commit intointerlay:masterfrom
Open
fix: runner: reconnect after parachain connection error#462sander2 wants to merge 1 commit intointerlay:masterfrom
sander2 wants to merge 1 commit intointerlay:masterfrom
Conversation
daniel-savu
reviewed
Mar 24, 2023
| match runner.read_chain_storage::<ClientRelease>(&api).into_future().await { | ||
| Ok(x) => Ok(x), | ||
| Err(err) => { | ||
| runner.drop_subxt_api(); // we might have lost connection. Rebuild connection next time |
Contributor
There was a problem hiding this comment.
It should be possible to check if the error is related to a lost connection, otherwise this might lead to a lot of bandwidth usage if the chain storage read failed for another reason
Member
There was a problem hiding this comment.
Agree we should distinguish these errors if possible.
Member
Author
There was a problem hiding this comment.
Agree we should distinguish these errors if possible.
Isn't it best to just rebuild the connection anyway, just in case the error matching is too specific? (e.g, error on jsonrpsee rather than on the socket level)
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.
Don't bail on parachain connection error. Instead, try to reconnect next block. Note that the startup behavior is unchanged, in that failure to connect upon startup is still considered a fatal error (which is useful in case the user supplies in invalid url: they get fast feedback that it's not going to work).