Skip to content

fix(client): re-arm stale connection watchdog after each stale period - #25950

Merged
ramonlsouza merged 2 commits into
bigbluebutton:v3.0.x-developfrom
ritzalam:fix-stale-connection-watchdog-rearm
Oct 5, 2026
Merged

ramonlsouza merged 2 commits into
bigbluebutton:v3.0.x-developfrom
ritzalam:fix-stale-connection-watchdog-rearm

Conversation

@ritzalam

@ritzalam ritzalam commented Oct 2, 2026

Copy link
Copy Markdown
Member

What does this PR do?

Makes the stale connection watchdog in ConnectionManager (added in #21492) work every time, instead of once per page load.

The watchdog arms a timer that terminates the GraphQL websocket when no message has arrived for 15 s, so that the client reconnects. It only arms the timer when terminateTimeoutRef.current is empty. The ref was never cleared, either when messages resumed or when the timer fired. So after the first stale period in a page load, recovered or not, later stale periods armed no timer, and the client stayed silent until the user reloaded.

This PR clears the ref in both places.

Closes Issue(s)

None filed. #21062 may be the same symptom.

Motivation

We saw a user stuck for 6.5 minutes on 4.0.0-rc.3. Chat kept spinning, the user list stopped updating and mute did not respond, but the server was receiving and applying everything the client sent. The only thing missing was server→browser data. A shorter stale period a minute earlier had recovered on its own, which used up the watchdog.

Across client logs from 7 production servers over 18 days, for stale periods that reached the 30 s terminate point:

Stale period in the page load Count Forced reconnect at 30 s Stayed silent, recovered later
First 4,998 89% 11%
Second or later 1,155 10% 90% (median 65 s, p90 380 s past detection)

Page loads were inferred from the logs, which accounts for the residue on each side.

How to test

On a test server, with one client in a meeting and its console open:

  1. sudo kill -STOP $(pidof bbb-graphql-middleware), wait about 25 s, then sudo kill -CONT …. The client logs "Server is not responding" (3003) and then recovers. No reconnect is expected, because the pause is shorter than detection plus 30 s.
  2. Pause it again for about 60 s.

Before this change, step 2 gives no Connection terminated (4499), and the client only recovers when the process resumes. After it, step 2 logs 4499 30 s after detection and the client reconnects once the middleware is back. Repeat step 2: it reconnects each time.

More

I haven't run these steps against a server with the patched build. The diagnosis comes from reading the code and from the production client logs above. The change applies cleanly to v4.0.x-develop. The same code is on develop.

  • Added/updated documentation

🤖 Generated with Claude Code

antobinary and others added 2 commits October 2, 2026 13:21
The watchdog added in bigbluebutton#21492 arms a timer to terminate and reconnect the
GraphQL websocket when no message arrives for 15 s. It only arms the timer
when the ref is empty, but the ref was never cleared: not when messages
resume, nor when the timer fires. So the forced reconnect worked once per
page load. Every later stale period left the client silent until the user
reloaded.

Clear the ref in both places so every stale period gets its own timer.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@coderabbitai

coderabbitai Bot commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Advanced

Run ID: dad6f14f-3968-4644-bac0-bdd57a1d83c0

📥 Commits

Reviewing files that changed from the base of the PR and between cc48c7c and 979a522.

📒 Files selected for processing (1)
  • bigbluebutton-html5/imports/ui/components/connection-manager/component.tsx

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 7 remain after this review.


Walkthrough

The stale-connection timeout callback now resets terminateTimeoutRef after it fires. When the server becomes responsive, the code clears the timeout and resets the reference.

Priority: ➖ Normal

Estimated code review effort: 2 (Simple) | ~5 minutes

Change: Bug fix

Merge Risk: ⚪ Minimal · up to 979a5

The watchdog can now terminate later stale periods as intended. No concrete merge-blocking behavior was identified.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the main change: re-arming the stale connection watchdog after each stale period.
Description check ✅ Passed The description directly explains the watchdog bug, the fix, production impact, and proposed testing steps.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 1…
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Autopilot is currently an internal CodeRabbit preview.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@antobinary antobinary added this to the Release 3.0 milestone Oct 2, 2026
@antobinary antobinary mentioned this pull request Oct 2, 2026
12 of 24 tasks
@github-actions

github-actions Bot commented Oct 2, 2026

Copy link
Copy Markdown

✅ Automated tests have passed!

@antobinary
antobinary requested a review from ramonlsouza October 3, 2026 01:05
@antobinary
antobinary changed the base branch from v3.0.x-release to v3.0.x-develop October 3, 2026 01:05
@ramonlsouza
ramonlsouza merged commit b93ac5f into bigbluebutton:v3.0.x-develop Oct 5, 2026
34 of 35 checks passed
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.

3 participants