Charcoal-SE / metasmoke

Web dashboard for SmokeDetector.
https://metasmoke.erwaysoftware.com
Creative Commons Zero v1.0 Universal
43 stars 34 forks source link

Set maximum processing time limits for Metasmoke queries #706

Open teward opened 4 years ago

teward commented 4 years ago

Currently if a query is submitted to Metasmoke that requires a long time to return, Metasmoke will continue to handle the request even if the requestor has timed out (to my knowledge). This can mean searches will return 504 Gateway Timeout errors even though the request is still being processed.

It would be prudent to set a maximum processing time limit for a request (which would correspond to HAProxy's setup currently which is a maximum of 60 minutes wait-time for a response from Metasmoke for a request) and then if that value is exceeded issue a 408 Request Timeout or similar error code from within Metasmoke and then ending the processing of the request when that time is elapsed.

This is currently most seen in Search, but probably could be implemented elsewhere. (Arose from #705 as a separate feature discussion idea)

ArtOfCode- commented 4 years ago

I'm... not even sure if this is possible. @Undo1, happen to know if you can terminate a Rails request manually?

Undo1 commented 4 years ago

If it is possible, it’ll be a Passenger config option. I bet it’s in there somewhere.

thesecretmaster commented 4 years ago

Could also use this gem: https://github.com/sharpstone/rack-timeout. If we wanted to, I'd be happy to test it and set it up.

thesecretmaster commented 4 years ago

This would also be resolved by switching activejob backends cc #795