dbalatero/typhoeus — Issue #132: hydra/multi fire_and_forget is hopelessly broken
Author: schleyfox
Created: 2011-11-24 03:36:24+00:00
State: open

It would be great if it worked. It would be great if it *could* work, but it doesn't with any sort of consistency.

I wrote a short test with a super simple HTTP server running on localhost (so simple that if it got really any data, it would be happy) and 100 test runs of a request to it. First, to establish baseline I used hydra.run. Then, I ran another 100 requests with hydra.fire_and_forget. With run, 100/100 were received by the server every time. With fire_and_forget, that number was somewhere between 1/100 and 25/100 depending on the run, with typical results around 10/100.

I then looked into trying to fix it, but based on the libcurl api and the collective wisdom of many mailing list posts, it seems like the only way to discover when all data is written to the socket and you are waiting on a reply is to attach a callback to DEBUGFUNCTION and compare bytes written to what should be written. This does not inspire confidence.

I think fire_and_forget would be a really useful feature to have, but with the current state of things it would be better to just remove the function entirely, rather than risk people actually trying to use it.