The server heartbeat goroutine (Server.update) uses a "defer recover" block that catches any panics that happen during heartbeats. That "defer recover" block uses a blocking channel receive to prevent the Server.update call from exiting until Server.Disconnect is called (see code here). If a panic does happen, that blocking channel receive can result in a deadlock when the application is shutting down. Remove the channel receive to prevent a deadlock while shutting down.
Definition of done:
- Remove the blocking channel receive in the "defer recover" block in Server.update.