Skip to content

Commit

Permalink
reader: in send_rdy(), don't enforce the invariant total_rdy <= max_i…
Browse files Browse the repository at this point in the history
…n_flight

Naively enforcing that invariant prevents us from correctly updating each conn's rdy after reducing max_in_flight.  Additionally, there's no need for this check in _send_rdy(), as all callers have logic that's supposed to determine an appropriate rdy value.
  • Loading branch information
Alp Aker committed Feb 25, 2019
1 parent ebe8733 commit d94d2e5
Showing 1 changed file with 0 additions and 3 deletions.
3 changes: 0 additions & 3 deletions nsq/reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -442,9 +442,6 @@ def _send_rdy(self, conn, value):
value = conn.max_rdy_count

new_rdy = max(self.total_rdy - conn.rdy + value, 0)
if new_rdy > self.max_in_flight:
return

if conn.send_rdy(value):
self.total_rdy = new_rdy

Expand Down

0 comments on commit d94d2e5

Please sign in to comment.