fix(stream): propagate backpressure instead of silently dropping dial requests
Fixes #6157
When opening hundreds of streams per second, dial requests were being silently dropped because try_send() would fail when the channel was full, causing Control::open_stream() to hang indefinitely.
This commit implements backpressure propagation as suggested by maintainers:
-
Increased dial_sender channel buffer from 0 (rendezvous) to 32 to handle burst traffic without blocking on every request.
-
Replaced
try_send()withsend().awaitin the dial path to propagate backpressure when >32 dial requests are pending, instead of silently dropping them. -
Refactored
Shared::sender()to return a cloned dial_sender, allowing the async send operation to happen outside the mutex lock to prevent deadlocks.
With these changes:
- Up to 32 concurrent dial requests queue immediately
- Additional requests block until space is available (backpressure)
- Errors are properly propagated instead of silent failures
- No more indefinite hangs on dropped dial requests