Closed sequitor-jon closed 1 month ago
We should handle Shutdown() being called twice better, but what's happening here is your app has a signals handler and the server installed its own so the term / interrupt is handled twice, each calling Shutdown()
You can avoid this by setting NoSigs: true
in your server opts
Ah, thanks! I suspected something like that.
Closing as resolved, please let us know if there's any further issue.
Observed behavior
Running this Go program and pressing Ctrl+C demonstrates the issue:
The output from running and pressing Ctrl+C:
Expected behavior
Shutdown called from another go routine should not panic.
Server and client version
Go.mod file:
Host environment
Behavior observed on both macOS 15.0 and Ubuntu 22.04
Steps to reproduce
See main.go and go.mod file.