-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unexpected "Thread killed by timeout manager" in 5.3.6 #153
Comments
It's possible that this is related to #150. |
Ah, I'm sure that this is relating to ef79679. |
FYI: yesodweb/wai#1014 |
I tried reverting ef79679 but I'm still seeing this happening. |
This is very strange.
@edsko Are you using WAI timeout manger in your client side by yourself? |
I pushed c8453f6 which explicitly catches |
We initialize the WAI time manager, because the |
I think the fundamental problem here is that threads are registered with two managers: the WAI manager and the H2 manager, which can sometimes lead to race conditions. I think however that we might be able to just accept this and resolve this our end; if and when I can confirm this, I will close this issue. I can't confirm it just now because I have discovered a memory leak in http-5.3.6 also (#154). Details of the race condition: The overall structure of the server is something like this: System.TimeManager.withManager .. $ \tmgr ->
Network.Run.TCP.runTCPServerWithSocket listenSock $ \clientSock ->
-- runs in a new thread!
..
let config = .. tmgr .. clientSock ..
HTTP2.run serverConfig config server For our purposes we here we can abstract mgr <- Network.HTTP2.H2.Manager.start tmgr -- through 'setup', 'newContext'
..
stopAfter mgr runBackgroundThreads $ .. Server threads get registered two both of these managers: runServer :: HasCallStack => Config -> Server -> Launch
runServer conf server ctx@Context{..} strm req =
forkManaged threadManager label $
withTimeout threadManager $ \th -> .. If the server now shuts down, we leave the scope of the We previously had some logic (#136, #137) to avoid this race condition, but I guess this logic has now been removed. Like I said , however, we might just be able to work around this our side, I'm not completely sure yet. |
Ok, have confirmed that we can deal with this our side. I will close this issue. |
|
I think the race condition is gone as of the refactoring that uses |
I'm seeing threads die with "Thread killed by timeout manager" in 5.3.6, but not in 5.3.5 or 5.3.4. Apologies for not noticing this sooner (when we discussed #151); I had missed it because our main test suite did not catch this error, only our stress tests do. This feels like a regression of #136 / #137, but I do not know for sure. I will dig and let you know.
The text was updated successfully, but these errors were encountered: