Skip to content

Increase Effect RPC ping timeout for large snapshots#2885

Open
Pearcekieser wants to merge 1 commit into
pingdotgg:mainfrom
pearce-codes:2026-05-31-effect-heartbeat-timeout
Open

Increase Effect RPC ping timeout for large snapshots#2885
Pearcekieser wants to merge 1 commit into
pingdotgg:mainfrom
pearce-codes:2026-05-31-effect-heartbeat-timeout

Conversation

@Pearcekieser
Copy link
Copy Markdown

@Pearcekieser Pearcekieser commented May 31, 2026

What Changed

Increases the patched Effect RPC pinger delay from 5 seconds to 60 seconds.

This changes the existing patches/effect@4.0.0-beta.73.patch so the generated RPC client waits longer before declaring the connection unhealthy due to a missed Pong.

Why

Large thread snapshots can occupy the WebSocket long enough that the Effect RPC Pong is queued behind snapshot chunks. On slow remote connections, the current 5 second heartbeat window can expire before the Pong reaches the client, causing a reconnect. The reconnect then requests the same large snapshot again, which can repeat the failure loop.

A 60 second window gives large snapshot sends more time to drain before the client treats the connection as dead.

This is a small mitigation for #2761. It does not solve the deeper issue that large snapshots and control/heartbeat messages share the same WebSocket queue; longer term, snapshots likely need pagination, truncation, backpressure, or control-message prioritization.

Checklist

  • This PR is small and focused
  • I explained what changed and why
  • UI changes are not applicable

Note

Increase Effect RPC ping timeout from 5s to 60s for large snapshots

Updates the ping delay in patches/effect@4.0.0-beta.73.patch from 5 seconds to 60 seconds to accommodate large snapshot transfers. Also adds an optional hooks.onPing callback that runs before writePing when provided.

Behavioral Change: RPC connections will now wait 60 seconds between pings instead of 5, which may affect detection of stale connections.

Macroscope summarized 81c603e.


Note

Low Risk
Single constant change in a vendor patch; main tradeoff is slower detection of truly dead RPC connections, with no auth or data-model changes.

Overview
Extends the Effect RPC client heartbeat in patches/effect@4.0.0-beta.73.patch by changing the pinger loop delay from 5 seconds to 60 seconds, so a missed Pong is not treated as a timeout while a large thread snapshot is still filling the WebSocket.

This is a targeted mitigation for reconnect loops when snapshot traffic delays control messages; stale or dead connections will be noticed more slowly than with the previous 5s window.

Reviewed by Cursor Bugbot for commit 81c603e. Bugbot is set up for automated code reviews on this repo. Configure here.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 31, 2026

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 9b9b74e1-bc23-49f9-b08f-571a2b441edc

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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 and usage tips.

@github-actions github-actions Bot added vouch:unvouched PR author is not yet trusted in the VOUCHED list. size:XS 0-9 changed lines (additions + deletions). labels May 31, 2026
@Pearcekieser Pearcekieser marked this pull request as ready for review May 31, 2026 05:53
@macroscopeapp
Copy link
Copy Markdown
Contributor

macroscopeapp Bot commented May 31, 2026

Approvability

Verdict: Approved

Simple timeout configuration change in a dependency patch - increases RPC ping delay from 5 to 60 seconds to accommodate large snapshots. Low-risk adjustment with no new behavior introduced.

You can customize Macroscope's approvability policy. Learn more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XS 0-9 changed lines (additions + deletions). vouch:unvouched PR author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants