From dc7d99e29f7aab296ce3911be64c5c831ba44cf8 Mon Sep 17 00:00:00 2001 From: Edsko de Vries Date: Fri, 19 Jul 2024 09:57:11 +0200 Subject: [PATCH] With `withManager` This depends on https://github.com/kazu-yamamoto/http2/pull/137. Closes #190. --- .github/workflows/haskell-ci.yml | 13 ++++++------- cabal.project | 2 +- cabal.project.ci | 2 +- grapesy.cabal | 4 ++-- util/Network/GRPC/Util/HTTP2.hs | 6 +----- 5 files changed, 11 insertions(+), 16 deletions(-) diff --git a/.github/workflows/haskell-ci.yml b/.github/workflows/haskell-ci.yml index d4a947ca..f13ff220 100644 --- a/.github/workflows/haskell-ci.yml +++ b/.github/workflows/haskell-ci.yml @@ -1,6 +1,6 @@ # This GitHub workflow config has been generated by a script via # -# haskell-ci 'github' 'cabal.project.ci' +# haskell-ci 'github' 'cabal.project' # # To regenerate the script (for example after adjusting tested-with) run # @@ -10,7 +10,7 @@ # # version: 0.19.20240708 # -# REGENDATA ("0.19.20240708",["github","cabal.project.ci"]) +# REGENDATA ("0.19.20240708",["github","cabal.project"]) # name: Haskell-CI on: @@ -172,15 +172,14 @@ jobs: echo "package grapesy" >> cabal.project echo " ghc-options: -Werror=missing-methods" >> cabal.project cat >> cabal.project <> cabal.project.local cat cabal.project diff --git a/cabal.project b/cabal.project index 697def76..de4c00c7 100644 --- a/cabal.project +++ b/cabal.project @@ -5,7 +5,7 @@ package grapesy benchmarks: True flags: +build-demo +build-stress-test +snappy -constraints: network-control==0.1.2 +constraints: network-control==0.1.3 -- -- ghc 9.10 diff --git a/cabal.project.ci b/cabal.project.ci index c9760852..db3117e2 100644 --- a/cabal.project.ci +++ b/cabal.project.ci @@ -6,7 +6,7 @@ package grapesy flags: +build-demo +build-stress-test +snappy +strace ghc-options: -Werror -constraints: network-control==0.1.2 +constraints: network-control==0.1.3 -- -- ghc 9.10 diff --git a/grapesy.cabal b/grapesy.cabal index 336bd292..8600a8d3 100644 --- a/grapesy.cabal +++ b/grapesy.cabal @@ -200,7 +200,7 @@ library , exceptions >= 0.10 && < 0.11 , hashable >= 1.3 && < 1.5 , http-types >= 0.12 && < 0.13 - , http2 >= 5.3 && < 5.4 + , http2 >= 5.3.1 && < 5.4 , http2-tls >= 0.4.1 && < 0.5 , lens >= 5.0 && < 5.4 , mtl >= 2.2 && < 2.4 @@ -333,7 +333,7 @@ test-suite test-grapesy , containers >= 0.6 && < 0.8 , exceptions >= 0.10 && < 0.11 , http-types >= 0.12 && < 0.13 - , http2 >= 5.3 && < 5.4 + , http2 >= 5.3.1 && < 5.4 , lens >= 5.0 && < 5.4 , mtl >= 2.2 && < 2.4 , network >= 3.1 && < 3.3 diff --git a/util/Network/GRPC/Util/HTTP2.hs b/util/Network/GRPC/Util/HTTP2.hs index ade4d382..1b565343 100644 --- a/util/Network/GRPC/Util/HTTP2.hs +++ b/util/Network/GRPC/Util/HTTP2.hs @@ -55,11 +55,7 @@ withConfigForInsecure :: -> (Server.Config -> IO a) -> IO a withConfigForInsecure sock k = do - -- TODO: - -- We should be using withManager instead. - bracket - (TimeManager.initialize (disableTimeout * 1_000_000)) - (\_ -> return ()) $ \mgr -> do + TimeManager.withManager (disableTimeout * 1_000_000) $ \mgr -> do -- @recv@ does not provide a way to deallocate a buffer pool, and -- @http2-tls@ (in @freeServerConfig@) does not attempt to deallocate it. -- We follow suit here.