Ticket #5448 defect closed fixed
twisted.protocols.htb.Bucket.drip() returns invalid results
|Reported by:||gsk||Owned by:||jesstess|
|Cc:||jesstess, thijs, gsk||Branch:||
(diff, github, buildbot, log)
From the api docs ( http://twistedmatrix.com/documents/current/api/twisted.protocols.htb.Bucket.html)
The method drip() of the Bucket class "Returns True if I am now empty."
The current drip() returns True only if the rate is zero (causing the bucket to drain instantaneously). This behavior does not take into account the possibility that a bucket will drain itself over time.
Attached is a patch containing a unit test for this issue and changes to the Bucket class that remedies this issue.