Skip to content

Commit

Permalink
chore(pkg/server): shutdown without waiting for connections to close
Browse files Browse the repository at this point in the history
- UDP server tend not to terminate connections on time
  • Loading branch information
qdm12 committed Nov 3, 2024
1 parent 277e4bf commit fdd4373
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions pkg/server/subserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,11 +118,7 @@ func (s *subServer) Stop() (err error) {
s.state = goservices.StateStopping
s.stateMutex.Unlock()

const shutdownTimeout = 200 * time.Millisecond
shutdownCtx, shutdownCancel := context.WithTimeout(
context.Background(), shutdownTimeout)
defer shutdownCancel()
err = s.server.ShutdownContext(shutdownCtx)
err = s.server.Shutdown()
s.state = goservices.StateStopped

return err
Expand Down

0 comments on commit fdd4373

Please sign in to comment.