Skip to content

Commit 5f84353

Browse files
committed
Disable WAI timeouts altogether
Depends on yesodweb/wai#1017 Closes #123
1 parent 4a433df commit 5f84353

File tree

3 files changed

+4
-28
lines changed

3 files changed

+4
-28
lines changed

Diff for: grapesy/grapesy.cabal

+1-1
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ library
166166
, recv >= 0.1 && < 0.2
167167
, stm >= 2.5 && < 2.6
168168
, text >= 1.2 && < 2.2
169-
, time-manager >= 0.2.1 && < 0.3
169+
, time-manager >= 0.2.2 && < 0.3
170170
, tls >= 1.7 && < 2.2
171171
, unbounded-delays >= 0.1.1 && < 0.2
172172
, unordered-containers >= 0.2 && < 0.3

Diff for: grapesy/src/Network/GRPC/Common/Compression.hs

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
{-# LANGUAGE CPP #-}
2-
31
-- | Public 'Compression' API
42
--
53
-- Intended for qualified import.

Diff for: grapesy/src/Network/GRPC/Util/HTTP2.hs

+3-25
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
{-# LANGUAGE CPP #-}
2-
3-
#include "MachDeps.h"
4-
51
module Network.GRPC.Util.HTTP2 (
62
-- * General auxiliary
73
fromHeaderTable
@@ -219,26 +215,8 @@ mkTlsSettings http2Settings keyLogger =
219215
withTimeManager :: (Time.Manager -> IO a) -> IO a
220216
withTimeManager = TimeManager.withManager (disableTimeout * 1_000_000)
221217

222-
-- | Work around the fact that we cannot disable timeouts in http2/http2-tls
218+
-- | Disable timeouts in http2/http2-tls
223219
--
224-
-- TODO: <https://github.com/well-typed/grapesy/issues/123>
225-
-- We need a proper solution for this.
220+
-- A value of 0 (or lower) disables timeouts as of @time-manager-0.2.2@.
226221
disableTimeout :: Int
227-
disableTimeout =
228-
#if (WORD_SIZE_IN_BITS == 64)
229-
-- Set a really high timeout to effectively disable timeouts (100 years)
230-
--
231-
-- NOTE: We cannot use 'maxBound' here, because this value is multiplied
232-
-- by @1_000_000@ in 'Network.Run.TCP.Timeout.runTCPServerWithSocket'
233-
-- (in @network-run@).
234-
100 * 365 * 24 * 60 * 60
235-
#else
236-
#warning "Timeout for RPC messages is set to 30 minutes on 32-bit systems."
237-
#warning "See https://github.com/kazu-yamamoto/http2/issues/112"
238-
-- Unfortunately, the same trick does not work on 32-bit systems, where we
239-
-- simply don't have enough range. The maximum timeout we can support here
240-
-- is roughly 35 mins. We set it to 30 minutes exactly, to at least provide
241-
-- a clue if the timeout does hit (1_800_000_000 < 2_147_483_647).
242-
30 * 60
243-
#endif
244-
222+
disableTimeout = 0

0 commit comments

Comments
 (0)