We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent bf75926 commit 6810a8bCopy full SHA for 6810a8b
lading/src/blackhole/common.rs
@@ -71,6 +71,13 @@ where
71
let service_factory = make_service.clone();
72
73
join_set.spawn(async move {
74
+ // NOTE we are paying the cost for allocating a socket et al
75
+ // here and then immediately dropping the connection. If we
76
+ // wanted to be more resource spare we should not accept the
77
+ // connection before the semaphore is known to have capacity.
78
+ //
79
+ // Doesn't matter really for lading -- so far as we can tell
80
+ // -- but it's not strictly speaking good behavior.
81
let permit = match sem.try_acquire() {
82
Ok(p) => p,
83
Err(TryAcquireError::Closed) => {
0 commit comments