go-pulse/graphql
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
..
graphiql.go common, graphql: fix hash/address decoding + UI content type 2019-09-10 12:20:36 +03:00
graphql_test.go graphql, node, rpc: improve HTTP write timeout handling (#25457) 2022-12-07 14:02:14 +01:00
graphql.go graphql: fixes missing tx logs (#25745) 2022-09-13 22:49:52 +03:00
schema.go graphql: add raw fields to block and tx (#24816) 2022-05-17 11:31:17 +03:00
service.go graphql, node, rpc: improve HTTP write timeout handling (#25457) 2022-12-07 14:02:14 +01:00