Skip to content

Commit

Permalink
log: consider HTTP2.ConnectionIsClosed not to be an error condition
Browse files Browse the repository at this point in the history
As hinted in kazu-yamamoto/http2#102, this
is not an actual error, but a normal HTTP2 connection terminating.
I can trigger this reliably with every `curl` request to my node.

Change-Id: Id5984b20a5305ec0af8c5b6c10ab326338520a5f
  • Loading branch information
edmundnoble committed May 31, 2024
1 parent ef7579f commit a8c075e
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions chainweb.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -394,6 +394,7 @@ library
, hashable >= 1.4
, heaps >= 0.3
, hourglass >=0.2
, http2 >= 5.2.1
, http-client >= 0.5
, http-client-tls >=0.3
, http-media >= 0.7
Expand Down
1 change: 1 addition & 0 deletions changes/2024-05-30T150038-0400.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Stop logging ConnectionIsClosed
5 changes: 5 additions & 0 deletions src/Chainweb/Chainweb.hs
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ import qualified Data.Vector as V
import GHC.Generics

import qualified Network.HTTP.Client as HTTP
import qualified Network.HTTP2.Client as HTTP2
import Network.Socket (Socket)
import Network.Wai
import Network.Wai.Handler.Warp hiding (Port)
Expand Down Expand Up @@ -785,6 +786,10 @@ runChainweb cw nowServing = do
return ()
| Just ClientClosedConnectionPrematurely <- fromException e =
inc clientClosedConnectionsCounter
-- this isn't really an error, this is a graceful close.
-- see https://github.com/kazu-yamamoto/http2/issues/102
| Just HTTP2.ConnectionIsClosed <- fromException e =
return ()
| otherwise =
when (defaultShouldDisplayException e) $
logg Warn $ loggServerError msg r e
Expand Down

0 comments on commit a8c075e

Please sign in to comment.