As shown in #17992 a bidirectional components can easily provoke a race when the component is about to finish. When that happens completing the downstream side (regularly or with an error) is potentially racing against cancelling the upstream side.
Eventually, both must be done, but a better solution might be to complete the downstream side first, then wait for a grace period for the error to bubble through the counterpart in some form and only then cancel the upstream. The reasoning is that, especially in cases of an error, cancelling isn't able to transport any explanation about why the cancellation happened.
As shown in #17992 a bidirectional components can easily provoke a race when the component is about to finish. When that happens completing the downstream side (regularly or with an error) is potentially racing against cancelling the upstream side.
Eventually, both must be done, but a better solution might be to complete the downstream side first, then wait for a grace period for the error to bubble through the counterpart in some form and only then cancel the upstream. The reasoning is that, especially in cases of an error, cancelling isn't able to transport any explanation about why the cancellation happened.