mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-28 07:36:44 +00:00
Merge pull request #35 from DeBankDeFi/rpc-shutdown-with-timeout
rpc graceful shutdown timeout - merge back from upstream repo
This commit is contained in:
commit
c3f82a6595
1 changed files with 3 additions and 2 deletions
|
|
@ -269,8 +269,9 @@ func (h *httpServer) doStop() {
|
|||
ctx, cancel := context.WithTimeout(context.Background(), shutdownTimeout)
|
||||
defer cancel()
|
||||
err := h.server.Shutdown(ctx)
|
||||
if err != nil {
|
||||
h.log.Warn("Something wrong with HTTP server graceful shutdown", "error", err)
|
||||
if err == ctx.Err() {
|
||||
h.log.Warn("HTTP server graceful shutdown timed out")
|
||||
h.server.Close()
|
||||
}
|
||||
h.listener.Close()
|
||||
h.log.Info("HTTP server stopped", "endpoint", h.listener.Addr())
|
||||
|
|
|
|||
Loading…
Reference in a new issue