Skip to content

Commit 1400f27

Browse files
committed
prevent calling "connClose" twice.
TimeManager is leaking because of "BlockedOnMVar". Both TimeManger and Reaper do not use MVar at all. TLS "bye" is the only registered function which uses MVar. When TimeManager kills Warp, "bye" is called twice. One is via "bracket", the other is by TimeManager. This ensures that "bye" is called only once.
1 parent a385430 commit 1400f27

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

  • warp/Network/Wai/Handler/Warp

warp/Network/Wai/Handler/Warp/Run.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -369,7 +369,7 @@ fork set mkConn addr app counter ii = settingsFork set $ \unmask -> do
369369
-- above ensures the connection is closed.
370370
when goingon $ serveConnection conn ii th addr transport set app
371371
where
372-
register = T.registerKillThread (timeoutManager ii) (connClose conn)
372+
register = T.registerKillThread (timeoutManager ii) (return ())
373373
cancel = T.cancel
374374

375375
onOpen adr = increase counter >> settingsOnOpen set adr

0 commit comments

Comments
 (0)