Skip to content
This repository has been archived by the owner on Oct 17, 2022. It is now read-only.

better handling of unrecoverable network errors #665

Closed
bmwill opened this issue Aug 2, 2022 · 0 comments
Closed

better handling of unrecoverable network errors #665

bmwill opened this issue Aug 2, 2022 · 0 comments

Comments

@bmwill
Copy link
Contributor

bmwill commented Aug 2, 2022

Context from a slack thread:

From @bmwill

In working through this I've identified a potential issue with how we are handling some errors cases when sending messages to other peers, in particular if we try to send a message to the other side, and the message sending was successful but there was an RPC error (eg you sent the message to the wrong route) then we ignore this even though we know then that the message send will never be "successful".

From @huitseeker

Indeed.
The current signature of send_message is

send_message(
        &mut self,
        address: Multiaddr,
        message: BincodeEncodedPayload,
    ) -> CancelOnDropHandler<Result<tonic::Response<types::Empty>, anyhow::Error>>

Where Result<tonic::Responsetypes::Empty, anyhow::Error> is aliased as MessageResult.
If you know how to refactor the Error case of this MessageResult type into a Sentinel error that outputs essentially one variant chosen between RecoverableError, IrrecoverableError, the downstream changes to retry behavior are easy and I'm happy to do them.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant