tosc-rs / mgnp

MnemOS Global Networking Protocol
Creative Commons Attribution Share Alike 4.0 International
14 stars 1 forks source link

mgnp: better error handling #23

Open hawkw opened 8 months ago

hawkw commented 8 months ago

right now (as of 87dc51da19352e20964ef962d27ecdb52cc7b95a) we handle frame decode/encode errors by "just skipping the frame", and wire errors by "just stop running the interface". here's what we should do instead, IMO:

imo if the Wire sees an error that it's capable of retrying or believes to be ignorable, it should just ... do that? and the only errors that should bubble up from the Wire are fatal-ish and should blow up the whole interface.

currently, wire errors just make us stop the interface state machine. they should actually send errors on all existing local connections.

hawkw commented 8 months ago

some notes about the design given here:

hawkw commented 8 months ago

i think the best way to propagate connection RESETs is to stick a first-class notion of "channel closed with error" into tricky-pipe.

also, it would be nice if an attempt to send a message through a DeserSender that results in a deserialize error also sent the deserialize error to the receiver, as well as returning it to the sender...