Skip to content

Reconnect FCM listener after it dies instead of hanging forever - #122

Open
P6g9YHK6 wants to merge 1 commit into
leonboe1:mainfrom
P6g9YHK6:upstream-fcm-reconnect
Open

Reconnect FCM listener after it dies instead of hanging forever#122
P6g9YHK6 wants to merge 1 commit into
leonboe1:mainfrom
P6g9YHK6:upstream-fcm-reconnect

Conversation

@P6g9YHK6

@P6g9YHK6 P6g9YHK6 commented Sep 2, 2026

Copy link
Copy Markdown

FcmPushClient shuts itself down after 3 sequential connection errors
and never recovers. _listening is only ever set once, so nothing
noticed, and every locate after that just hangs until the process is
restarted by hand. Hit this in production: an SSL shutdown timeout
tripped the error threshold and every device timed out for hours.

_ensure_listening() now checks the push client's actual run_state
instead of the stale flag, locked so two callers can't both restart it
at once. _start_listener_in_background() also cleans up the old
loop/thread before starting a new one.

Touches the same function as #114, but a different concern. May need
a quick rebase depending on merge order.

FcmPushClient shuts itself down after 3 sequential connection errors
and never recovers. _listening was only ever set once, so nothing
noticed - every locate after a crash just hung on a push that would
never arrive, until the process was restarted by hand.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant