prometheus/web
Julien Pivotto e96d786fb8
Stop CMUX and GRPC servers even with stale connections (#7810)
I have received a recent report for a user which confirms that sometime
the GRPC server does not stop propery.

It appears that there are 2 issues:

1. The cmux server can refuse to stop if there are stale connections.
For that we set the ReadTimeout.
2. The GRPC server graceful stop can never finish.

What this PR avoids is:

```
goroutine 227 [semacquire, 2 minutes]:
sync.runtime_Semacquire(0xc00059a75c)
    /usr/local/go/src/runtime/sema.go:56 +0x42
sync.(*WaitGroup).Wait(0xc00059a75c)
    /usr/local/go/src/sync/waitgroup.go:130 +0x64
google.golang.org/grpc.(*Server).GracefulStop(0xc00059a600)
```

This PR stops the GRPC server after 15s. Related to the go routing dumps
in #6747.

Signed-off-by: Julien Pivotto <roidelapluie@inuits.eu>
2020-08-17 09:50:32 +01:00
..
api tsdb: Added ChunkQueryable implementations to db; unified MergeSeriesSets and vertical to single struct. (#7069) 2020-07-31 16:03:02 +01:00
ui Update various UI components (#7807) 2020-08-15 22:31:30 +02:00
federate.go *: Consistent Error/Warning handling for SeriesSet iterator: Allowing Async Select (#7251) 2020-06-09 17:57:31 +01:00
federate_test.go Fixed wrongly handled not ready TSDB on web and API. (#7182) 2020-04-29 17:16:14 +01:00
web.go Stop CMUX and GRPC servers even with stale connections (#7810) 2020-08-17 09:50:32 +01:00
web_test.go Stop CMUX and GRPC servers even with stale connections (#7810) 2020-08-17 09:50:32 +01:00