Fix false pingresp_timeout under publish load#3
Conversation
|
AMP: PR Review —
|
I didn't address this. I suggest doing this on a subsequent PR. I'm looking for suggestion non-AI suggestions on this point. |
petermm
left a comment
There was a problem hiding this comment.
imho it should just be documented - later options for the behaviour can be provided, and start/monitor can be supported etc.
Think it's good to keep it small and simple for now.
Outbound activity reset ping_timer but not pingresp_timer, so a PUBLISH during a PINGREQ -> PINGRESP window pushed the next PINGREQ past the pingresp deadline and pingresp_timer fired even when the broker was fine. Replace the dual-timer model with an activity-tracking state machine: any complete inbound packet clears pingresp_timer (PINGRESP no longer has privileged status), and the watchdog is not renewed by subsequent PINGREQs so a dropped PINGRESP surfaces as a real error. Also exit `normal` from stop_with_error/2 so linked non-trap_exit owners survive transport errors. Signed-off-by: Davide Bettio <davide@uninstall.it>
Outbound activity reset ping_timer but not pingresp_timer, so a PUBLISH during a PINGREQ -> PINGRESP window pushed the next PINGREQ past the pingresp deadline and pingresp_timer fired even when the broker was fine.
Replace the dual-timer model with an activity-tracking state machine: any complete inbound packet clears pingresp_timer (PINGRESP no longer has privileged status), and the watchdog is not renewed by subsequent PINGREQs so a dropped PINGRESP surfaces as a real error.
Also exit
normalfrom stop_with_error/2 so linked non-trap_exit owners survive transport errors.