Skip to content

Commit d899db2

Browse files
committed
add comment explaining load-sched strategy
Signed-off-by: Brian L. Troutwine <[email protected]>
1 parent bf75926 commit d899db2

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

lading/src/blackhole/common.rs

+7
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,13 @@ where
7171
let service_factory = make_service.clone();
7272

7373
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.
7481
let permit = match sem.try_acquire() {
7582
Ok(p) => p,
7683
Err(TryAcquireError::Closed) => {

0 commit comments

Comments
 (0)