OpenCyphal / pycyphal

Python implementation of the Cyphal protocol stack.
https://pycyphal.readthedocs.io/
MIT License
120 stars 105 forks source link

Incorrect transmission error handling in redundant transport #222

Closed pavel-kirienko closed 2 years ago

pavel-kirienko commented 2 years ago

https://github.com/OpenCyphal/pycyphal/blob/8d190ce075d6de56cd00f2be14f0039dc8eb356d/pycyphal/transport/redundant/_session/_output.py#L258-L268

If there are two inferiors and one of them gets blocked transiently to complete the transmission while the other one raises an exception, the former's future is detached to complete in the background and then the only remaining result is the error, which is then propagated to the caller.

This is incorrect because errors should not unblock the transmission.

The correct behavior is to wait until either the first inferior is done transmitting or all of them have failed.

The behavior described in the method documentation is actually correct but the implementation is not compliant.

An example with a larger context is available here: https://ci.appveyor.com/project/Zubax/yakut/build/job/6k9185femyoi8qq7#L2708