aboutsummaryrefslogtreecommitdiff
path: root/nixpkgs/pkgs/development/haskell-modules/patches/hasura-884-compat.patch
blob: bc000ba9cca21fbcfa6cccf2fc420fd28d168147 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
diff --git server/src-lib/Hasura/GraphQL/Transport/WebSocket/Server.hs server/src-lib/Hasura/GraphQL/Transport/WebSocket/Server.hs
index 6cb70cf0..0c3789cd 100644
--- server/src-lib/Hasura/GraphQL/Transport/WebSocket/Server.hs
+++ server/src-lib/Hasura/GraphQL/Transport/WebSocket/Server.hs
@@ -45,7 +45,7 @@ import           GHC.AssertNF
 import qualified ListT
 import qualified Network.WebSockets                   as WS
 import qualified StmContainers.Map                    as STMMap
-import qualified System.IO.Error                      as E
+--import qualified System.IO.Error                      as E
 
 import qualified Hasura.Logging                       as L
 
@@ -287,12 +287,6 @@ createServerApp (WSServer logger@(L.Logger writeLog) serverStatus) wsHandlers !p
           let rcv = forever $ do
                 -- Process all messages serially (important!), in a separate thread:
                 msg <- liftIO $ 
-                  -- Re-throw "receiveloop: resource vanished (Connection reset by peer)" :
-                  --   https://github.com/yesodweb/wai/blob/master/warp/Network/Wai/Handler/Warp/Recv.hs#L112 
-                  -- as WS exception signaling cleanup below. It's not clear why exactly this gets 
-                  -- raised occasionally; I suspect an equivalent handler is missing from WS itself.
-                  -- Regardless this should be safe:
-                  handleJust (guard . E.isResourceVanishedError) (\()-> throw WS.ConnectionClosed) $
                     WS.receiveData conn
                 writeLog $ WSLog wsId (EMessageReceived $ TBS.fromLBS msg) Nothing
                 _hOnMessage wsHandlers wsConn msg