While debugging the problem described in https://github.com/lrstanley/girc/issues/50#issuecomment-1153145075 further I noticed that they seem to be some edge cases where the pingLoop exits with a timeout before the first PING message is sent. This causes PING timeouts very shortly after reconnecting, for example:
2022-06-07_21:51:47.09441 hii.go:769: timed out waiting for a requested PING response
2022-06-07_22:54:57.25356 hii.go:769: timed out waiting for a requested PING response
2022-06-07_22:56:27.37343 hii.go:769: timed out waiting for a requested PING response
2022-06-07_22:57:57.46345 hii.go:769: timed out waiting for a requested PING response
Looking at the pingLoop implementation, the timeout check is performed before the PING message is sent. This commit adds such a check as an additional safeguard thereby not only relying on timing.
While debugging the problem described in https://github.com/lrstanley/girc/issues/50#issuecomment-1153145075 further I noticed that they seem to be some edge cases where the
pingLoop
exits with a timeout before the first PING message is sent. This causes PING timeouts very shortly after reconnecting, for example:Looking at the
pingLoop
implementation, the timeout check is performed before the PING message is sent. This commit adds such a check as an additional safeguard thereby not only relying on timing.