Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@stelfrag
Copy link
Collaborator

@stelfrag stelfrag commented Nov 4, 2025

Summary

Enhances websocket thread shutdown to prevent indefinite hangs and improve error handling during server shutdown. Adds timeout protection, non-blocking I/O configuration, and comprehensive error handling to ensure graceful and predictable shutdown behavior.

Problem

During server shutdown, the websocket thread cleanup could hang indefinitely when attempting to send close frames to unresponsive clients. This was caused by:

  1. No timeout protection - blocked indefinitely on slow/dead connections
  2. Blocking I/O - send() operations could block the shutdown process
  3. No error handling - syscall failures were silently ignored
  4. Poor visibility - no logging of shutdown progress or issues

This could delay or prevent clean server shutdown, especially under high load or network issues.

@stelfrag stelfrag marked this pull request as ready for review November 5, 2025 10:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant