-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Potential blocking issue when use tracing_unbounded
channel to send Sender<T>
#13849
Comments
I mean a proper solution would be to fix upstream, otherwise we could just switch the internal implementation to something different that doesn't has this issue. |
Agree, another option is to switch back to |
Would you be open to provide a pr switching the internal implementation @NingLin-P? |
Ahh, we can not switch to |
Right... Or how about we manually implement that in |
If we first close the receiver and then drain all the messages, it should work. Sounds like something to try out. I'm happy if you could do this @NingLin-P :) |
Sure! Let me try. |
Is there an existing issue?
Experiencing problems? Have you tried our Stack Exchange first?
Description of bug
In #13504, the underlying channel of
tracing_unbounded
channel switched fromfutures-channel
toasync-channel
.In
async-channel
, the unconsumed messages of the channel will not drop even though all the receivers have been dropped and these messages can never be accessed smol-rs/async-channel#23, this behavior may be an issue when usingtracing_unbounded
channel to sendSender<T>
to another worker and wait for receiving from thisSender<T>
(like the usage mentioned at smol-rs/async-channel#23).In autonomys/subspace#1352 (comment), we have encountered an issue with the abovementioned usage which causes our test block forever. I'm not quite familiar with the
tracing_unbounded
usage in substrate, but I do observe some use cases that usetracing_unbounded
channel to sendSender<T>
and they may be potential issues:substrate/client/utils/src/status_sinks.rs
Line 61 in 851a826
substrate/client/peerset/src/lib.rs
Line 278 in 851a826
substrate/client/network/sync/src/service/network.rs
Line 124 in 851a826
substrate/client/network/sync/src/engine.rs
Line 331 in 851a826
Steps to reproduce
See smol-rs/async-channel#23
The text was updated successfully, but these errors were encountered: