Skip to content

Commit

Permalink
With withManager
Browse files Browse the repository at this point in the history
This depends on kazu-yamamoto/http2#137.
Closes #190.
  • Loading branch information
edsko committed Jul 25, 2024
1 parent 4a04a91 commit dc7d99e
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 16 deletions.
13 changes: 6 additions & 7 deletions .github/workflows/haskell-ci.yml
Original file line number Diff line number Diff line change
@@ -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
#
Expand All @@ -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:
Expand Down Expand Up @@ -172,15 +172,14 @@ jobs:
echo "package grapesy" >> cabal.project
echo " ghc-options: -Werror=missing-methods" >> cabal.project
cat >> cabal.project <<EOF
constraints: network-control==0.1.2
constraints: network-control==0.1.3
allow-newer: proto-lens:base
allow-newer: proto-lens-runtime:base
package grapesy
tests: True
benchmarks: True
flags: +build-demo +build-stress-test +snappy +strace
ghc-options: -Werror
tests: True
benchmarks: True
flags: +build-demo +build-stress-test +snappy
EOF
$HCPKG list --simple-output --names-only | perl -ne 'for (split /\s+/) { print "constraints: any.$_ installed\n" unless /^(grapesy)$/; }' >> cabal.project.local
cat cabal.project
Expand Down
2 changes: 1 addition & 1 deletion cabal.project
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion cabal.project.ci
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions grapesy.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
6 changes: 1 addition & 5 deletions util/Network/GRPC/Util/HTTP2.hs
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,7 @@ withConfigForInsecure ::
-> (Server.Config -> IO a)
-> IO a
withConfigForInsecure sock k = do
-- TODO: <https://github.com/well-typed/grapesy/issues/190>
-- 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.
Expand Down

0 comments on commit dc7d99e

Please sign in to comment.