SignalK / signalk-server

An implementation of a Signal K central server for boats.
http://signalk.org
Apache License 2.0
298 stars 150 forks source link

Initial delta burst causes send buffer overflow and webapp reconnect loop #1718

Closed tkurki closed 2 months ago

tkurki commented 2 months ago

If there are enough cached deltas a webapp connecting via ws will get its connection killed by the send buffer check mechanism. The webapp will then reconnect, only to be killed again. We are blasting the initial cached delta set out at full speed and the outgoing buffer size will hit the send buffer size threshold even with reasonable network connection or probably even on localhost.

There have been reports where the send buffer overflow check is killing connections.

I think the best fix here would be to change the send buffer check so that it allows bursts: the send buffer size needs to be above the threshold for a period of time before the connection is killed.