go-ethereum/p2p/simulations/adapters
Sina Mahmoodi f20eba426a
graphql, node, rpc: improve HTTP write timeout handling (#25457)
Here we add special handling for sending an error response when the write timeout of the
HTTP server is just about to expire. This is surprisingly difficult to get right, since is
must be ensured that all output is fully flushed in time, which needs support from
multiple levels of the RPC handler stack:

The timeout response can't use chunked transfer-encoding because there is no way to write
the final terminating chunk. net/http writes it when the topmost handler returns, but the
timeout will already be over by the time that happens. We decided to disable chunked
encoding by setting content-length explicitly.

Gzip compression must also be disabled for timeout responses because we don't know the
true content-length before compressing all output, i.e. compression would reintroduce
chunked transfer-encoding.
2022-12-07 14:02:14 +01:00
..
exec.go all: remove version field from rpc.API 2022-06-27 12:39:46 +02:00
inproc.go graphql, node, rpc: improve HTTP write timeout handling (#25457) 2022-12-07 14:02:14 +01:00
inproc_test.go p2p/simulations: fix staticcheck warnings (#20322) 2019-11-19 17:16:42 +01:00
types.go build: upgrade to go 1.19 (#25726) 2022-09-10 13:25:40 +02:00