Skip to content

Commit 5dedaac

Browse files
committed
microlb: change send queue warning from full to empty
1 parent d3d20c7 commit 5dedaac

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

lib/microLB/micro_lb/balancer.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -411,26 +411,27 @@ namespace microLB
411411
[&nodes = n, idx] () {
412412
nodes.close_session(idx);
413413
});
414-
414+
415415
// get the actual TCP connections
416416
auto conn_in = dynamic_cast<net::tcp::Stream*>(incoming->bottom_transport())->tcp();
417417
assert(conn_in != nullptr);
418418
auto conn_out = dynamic_cast<net::tcp::Stream*>(outgoing->bottom_transport())->tcp();
419419
assert(conn_out != nullptr);
420-
420+
421421
static const uint32_t sendq_max = 0x400000;
422422
// set recv window handlers
423423
conn_in->set_recv_wnd_getter(
424424
[conn_out] () -> uint32_t {
425425
auto sendq_size = conn_out->sendq_size();
426-
if (sendq_size == 0)
426+
427+
if (sendq_size > sendq_max)
427428
printf("WARNING: Incoming reports sendq size: %u\n", sendq_size);
428429
return sendq_max - sendq_size;
429430
});
430431
conn_out->set_recv_wnd_getter(
431432
[conn_in] () -> uint32_t {
432433
auto sendq_size = conn_in->sendq_size();
433-
if (sendq_size == 0)
434+
if (sendq_size > sendq_max)
434435
printf("WARNING: Outgoing reports sendq size: %u\n", sendq_size);
435436
return sendq_max - sendq_size;
436437
});

0 commit comments

Comments
 (0)