ethereum/trinity

Leaked custom exceptions (e.g. SerializationError) may cause asyncio-run-in-process to crash

gsalgado opened this issue · 4 comments

As reported in #2000, a leaked SerializationError exception crashed the discovery component but failed to cause trinity to stop. That's because that exception cannot be pickled and causes asyncio-run-in-process to crash: ethereum/asyncio-run-in-process#28

Again, this was not really a component crashing but actually a crash in asyncio-run-in-process (caused by a python bug): ethereum/asyncio-run-in-process#28

I'll keep this open until we find a way to work around it in asyncio-run-in-process

@gsalgado can we just fix this the other way around and update SerializationError to be pickleable by implementing a __reduce__ method?

We could update that (and all other exceptions in rlp.exceptions), but there may be other custom exceptions outside of our control that would still cause asyncio-rip to crash. That may be our only option, though

With ethereum/asyncio-run-in-process#29 we get a more meaningful error and the component process terminates, causing trinity to stop