Commit 11a6eb7c authored by Dominik Charousset's avatar Dominik Charousset

Fix formula for credit computation

parent 396c79f3
...@@ -106,7 +106,7 @@ void inbound_path::emit_ack_batch(local_actor* self, long queued_items, ...@@ -106,7 +106,7 @@ void inbound_path::emit_ack_batch(local_actor* self, long queued_items,
auto x = stats.calculate(cycle, complexity); auto x = stats.calculate(cycle, complexity);
// Hand out enough credit to fill our queue for 2 cycles. // Hand out enough credit to fill our queue for 2 cycles.
auto credit = std::max((x.max_throughput * 2) auto credit = std::max((x.max_throughput * 2)
- (assigned_credit - queued_items), - (assigned_credit + queued_items),
0l); 0l);
auto batch_size = static_cast<int32_t>(x.items_per_batch); auto batch_size = static_cast<int32_t>(x.items_per_batch);
if (credit != 0) if (credit != 0)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment