Skip to content

WebSockets: all client related processes are not properly destroyed in some cases #46

@gbour

Description

@gbour

when a client close its websocket connection without proper MQTT DISCONNECT, or when MQTT connection timesout:

  • mqtt_ranch_protocol process is not destroyed
  • mqtt_session and wave_websocket processes are destroyed after MQTT timeout (*1.5) only

Explanation:

  • when a client connects with WebSocket transport, 4 processes are created to handle client connection
    • wave_websocket_handler (a ranch listener) to receipt ws packets
    • mqtt_session is the MQTT FSM
    • mqtt_ranch_protocol is the generic low-level mqtt packets reader/writer
    • wave_websocket emulates a gen_tcp like socket by linking mqtt_ranch_protocol with wave_websocket_handler

when client disconnects properly (sending MQTT DISCONNECT PACKET), all 4 processes are properly destroyed (in order mqtt_session -> wave_websocket -> wave_websocket_handler & mqtt_ranch_protocol).
But if client just close socket or let's mqtt session timeout, this is not done properly

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions