iLink SBE parsing incorrectly assumed messages were received in full.
The socket read code was based on MDP SBE parsing which is based on UDP where datagrams are received in full (or nothing at all). Fragmentation is not possible.
However, iLink is based on TCP where messages are allowed to be fragmented (by the TCP stream protocol).
Symptoms:
Gateway freeze
Reason:
Message parsing happens inside a loop that processes the read stream buffer.
When the parser failed (due to message length) it would return 0 (bytes) to indicate that the read buffer did not yet have enough data.
Unfortunately, the loop would only check on read buffer being fully processed by checking when the read buffer became empty.
This resulted in an infinite loop.
Solution:
Break the loop when not enough data is ready to process the next message.
iLink SBE parsing incorrectly assumed messages were received in full.
The socket read code was based on MDP SBE parsing which is based on UDP where datagrams are received in full (or nothing at all). Fragmentation is not possible.
However, iLink is based on TCP where messages are allowed to be fragmented (by the TCP stream protocol).
Symptoms:
Reason:
Message parsing happens inside a loop that processes the read stream buffer. When the parser failed (due to message length) it would return 0 (bytes) to indicate that the read buffer did not yet have enough data. Unfortunately, the loop would only check on read buffer being fully processed by checking when the read buffer became empty. This resulted in an infinite loop.
Solution:
Break the loop when not enough data is ready to process the next message.