Skip to content

feat(websocket): notify active WebSocket connections with 1001 Going Away during graceful shutdown #158

Description

@ZhuchkaTriplesix

Summary

When an OxyRoute worker shuts down (__rsgi_del__ / on_shutdown), active WebSocket connections are currently abruptly severed without a clean closing handshake. Connected clients receive unexpected TCP drops rather than a standard 1001 Going Away closure code.

Proposed Changes

  1. Track active WebSocket connection instances in a registry within AppState (or WebSocket manager).
  2. During on_shutdown, iterate through active connections and send a 1001 close frame before tearing down the worker.
  3. Add a graceful shutdown test for WebSocket clients.

Acceptance Criteria

  • Connected WebSocket clients receive a clean 1001 close frame when the application shuts down.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions