Closed jogramming closed 2 years ago
This seems to be fixed on next
, in the forthcoming http-ratelimiting
crate (per #1191):
Running `target/debug/testing`
2021-11-30T14:35:42.037204Z INFO testing: cancelled a bunch of requests
2021-11-30T14:35:42.363801Z INFO testing: finally fired off real request
If this is satisfying, you can go ahead and close the issue. I am hoping to release this at some point soon.
(to the same bucket that is)
The following code takes 60 seconds to complete even though only 1 request is fired off and 6 are cancelled:
This is because of the following: https://github.com/twilight-rs/twilight/blob/2dd9687bda7e4fb98e3348d2de68ad5f72efecc2/http/src/ratelimiting/bucket.rs#L185-L200
In the event of
queue_tx.send
failing, then_sent
will holdErr(tx)
stopping it from being dropped and the receive below will timeout after 10 second instead of immediately returningOk(None)