[Haskell-cafe] thread killed

tsuraan tsuraan at gmail.com
Thu Apr 5 18:35:11 CEST 2012

>> I think I might know what your problem is. You're accepting file uploads
>> using handleMultipart, yes? Snap kills uploads that are going too slow,
>> otherwise you would be vulnerable to slowloris
>> (http://ha.ckers.org/slowloris/) DoS attacks. What's probably happening here
>> is that you're doing slow work inside the "Iteratee IO a" handler you pass
>> to that function, which makes Snap think the client is trickling bytes to
>> you. If that's the case, either finish the iteratee more quickly and do the
>> slow work back in the Snap handler (preferable), or disable the minimum
>> upload rate guard (although that's not recommended on a server talking to
>> the public internet.)

I tried adding a "setMinimumUploadRate 0" to my handleMultipart and
doing the upload, and it's still getting killed.  The uploads are
pretty fast; a 150MB file takes around 10s.  I really don't think the
problem is with Snap, but pulling my code out of snap would be pretty
painful.  I have some pretty nasty crap going on with what I'm doing
anyhow, with threads communicating asynchronously, sockets being held
open between requests, that sort of horrid ugliness.  I'm going to try
to get rid of that, and then see if any bugs I had in there were
causing the problem.  Hopefully I'll be done with that by the end of
the weekend, and I'll either have the problem fixed, or have a
reasonable way to reproduce the errors.

Thanks for the idea, anyhow.  And, if setMinimumUploadRate 0 doesn't
actually disable the rate limiter, I'd be happy to try something more

More information about the Haskell-Cafe mailing list