Skip to content

lwcapi: heartbeat immediately on ws connect#1871

Merged
brharrington merged 1 commit intoNetflix:mainfrom
brharrington:delay
Feb 23, 2026
Merged

lwcapi: heartbeat immediately on ws connect#1871
brharrington merged 1 commit intoNetflix:mainfrom
brharrington:delay

Conversation

@brharrington
Copy link
Copy Markdown
Contributor

When subscription delivery is delayed (e.g., due to staggered broadcast), the websocket connection could hit the idle timeout before any data flows. This was because the data source (including heartbeats) was not pushed downstream until the client sent its first subscription message.

  • Push the data source on the first downstream pull instead of waiting for a client message, so heartbeats flow as soon as the websocket connects.

  • Emit a default heartbeat with a 5s step when no subscriptions are established yet. Once subscriptions arrive, the real step-based heartbeats take over on the next tick.

  • Add debug logging for staggered broadcast delay.

When subscription delivery is delayed (e.g., due to staggered
broadcast), the websocket connection could hit the idle timeout
before any data flows. This was because the data source
(including heartbeats) was not pushed downstream until the
client sent its first subscription message.

- Push the data source on the first downstream pull instead of
  waiting for a client message, so heartbeats flow as soon as
  the websocket connects.

- Emit a default heartbeat with a 5s step when no subscriptions
  are established yet. Once subscriptions arrive, the real
  step-based heartbeats take over on the next tick.

- Add debug logging for staggered broadcast delay.
@brharrington brharrington added this to the 1.9.0 milestone Feb 23, 2026
@brharrington brharrington merged commit 4c06ed6 into Netflix:main Feb 23, 2026
5 checks passed
@brharrington brharrington deleted the delay branch February 23, 2026 17:15
brharrington added a commit to brharrington/atlas that referenced this pull request Feb 24, 2026
When subscription delivery is delayed (e.g., due to staggered
broadcast), the websocket connection could hit the idle timeout
before any data flows. This was because the data source
(including heartbeats) was not pushed downstream until the
client sent its first subscription message.

- Push the data source on the first downstream pull instead of
  waiting for a client message, so heartbeats flow as soon as
  the websocket connects.

- Emit a default heartbeat with a 5s step when no subscriptions
  are established yet. Once subscriptions arrive, the real
  step-based heartbeats take over on the next tick.

- Add debug logging for staggered broadcast delay.
brharrington added a commit that referenced this pull request Feb 24, 2026
* pekko: add warn log if byte limit is hit (#1870)

Ensures it will get logged and be easier to debug. If relying
on the caller it might get burried in the pekko plumbing.

* lwcapi: heartbeat immediately on ws connect (#1871)

When subscription delivery is delayed (e.g., due to staggered
broadcast), the websocket connection could hit the idle timeout
before any data flows. This was because the data source
(including heartbeats) was not pushed downstream until the
client sent its first subscription message.

- Push the data source on the first downstream pull instead of
  waiting for a client message, so heartbeats flow as soon as
  the websocket connects.

- Emit a default heartbeat with a 5s step when no subscriptions
  are established yet. Once subscriptions arrive, the real
  step-based heartbeats take over on the next tick.

- Add debug logging for staggered broadcast delay.

* pekko: remove redundant unit in log message (#1872)

* pekko: avoid backpressure for staggered broadcast (#1873)

Allow the set of cluster members to be updated even if the
downstream is still working based on the injected delays.
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