Websocket onError handler prevents earlier data to be processed

Description

When a websocket is receiving data from a client, it can trigger its OnWebSocketError event handler. A common cause for this is the socket having been closed.

The execution of this OnWebSocketError handler seems to take precedence over processing of data received in its OnWebSocketMessage handler. This causes data received to go unprocessed.

This issue becomes more apparent in a scenario where a lot of data is sent by a websocket-based client automatically (eg: a stress test), followed by an improper session closure/immediate disconnect of the socket.

The solution for https://igniterealtime.atlassian.net/browse/OF-2473 introduces asynchronicity that allows the execution of OnWebSocketError to happen in the ‘stanza worker’ thread pool, rather than the ‘network processing’ thread pool.

For BOSH, the ‘stanza worker’ thread pool is used to process stanzas as parsed from data received from IO (as processed by thread in the ‘network processing’ thread pool). For websockets, this does not seem to be the case (but perhaps, should).

Environment

None

Activity

Show:
Fixed

Details

Assignee

Reporter

Fix versions

Priority

Created August 25, 2022 at 3:34 PM
Updated September 6, 2022 at 5:06 PM
Resolved September 6, 2022 at 5:06 PM

Flag notifications