Skip to content

Conversation

@sander2
Copy link
Member

@sander2 sander2 commented Mar 20, 2023

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).

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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agree we should distinguish these errors if possible.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants