Skip to content
  • Julien Pivotto's avatar
    Stop CMUX and GRPC servers even with stale connections (#7810) · e96d786f
    Julien Pivotto authored
    
    
    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: default avatarJulien Pivotto <roidelapluie@inuits.eu>
    e96d786f