h2oai / wave

Realtime Web Apps and Dashboards for Python and R
https://wave.h2o.ai
Apache License 2.0
3.9k stars 323 forks source link

Do not send websocket ping/pongs during active traffic #2138

Closed mturoci closed 9 months ago

mturoci commented 9 months ago

Currently, waved sends ping/pong messages to keep the websocket connection alive. This however seems redundant when done during active traffic.

codyharris-h2o-ai commented 9 months ago

While yes it is redundant I do believe that it is a good check on the health of the connection - the ping/pong validates that both sides of the connection are working/behaving as expected (that the remote is actually receiving and understanding data, and that it isn't getting caught in a buffer somewhere).

mturoci commented 9 months ago

Just to make it more clear. I am not saying we should drop the ping/pong, but rather send it only when the traffic is idle and there is no communication at all. Currently, we send ping/pongs regardless of the activity.

codyharris-h2o-ai commented 9 months ago

Yep, I still believe the pingpongs have value even if there is traffic on the connection

mturoci commented 9 months ago

Got it, closing the issue then. Thanks for the inputs!