liqd / aula

An online platform for political participation in schools in Germany (not in active development)
https://liqd.net
Other
27 stars 5 forks source link

limit handler runtime. #1039

Open fisx opened 6 years ago

fisx commented 6 years ago

there was one production event where the server started to timeout on any request. the log file didn't contain anything interesting, so i restarted the server. the log file then contained the lines:

2017-11-07 11:48:16.536592 UTC [INFO] user interrupt
2017-11-07 11:48:16.536661 UTC [INFO] shutdown.

it seems like there are possible (if rare) situations in which the servant handler blocks the acid-state mvar indefinitely for one request, which in turn blocks all other requests form being handled.

it would be good to have a hard timeout wrapped around the entire api. the timeout handler needs to make sure that the acid-state mvar lock is released. this would not fix the issue that some request was blocking instead of returning an error, but it would make the effect acceptable (err500 for one user instead of freezing the entire instance).

fisx commented 6 years ago

the cause of the issue described above could well be https://github.com/zerobuzz/servant-cookie-session/issues/2 (fixed, but not sufficiently tested, in https://github.com/zerobuzz/servant-cookie-session/pull/3). we should test this and upgrade aula.