Repository navigation
Conversation
Streaming attempts only called keepalive.start(), leaving armed=false so beat() never wrote until the first upstream SSE line. Use arm() so ping/comment keepalives flow during long TTFT and avoid proxy 524s. Co-authored-by: ted <kuhlmangarry24@gmail.com>
Owner
Author
|
已被 #448(v1.3.171 tip-cut)超集吸收(含 start→arm,并额外 ping 写出即 onCommit)。请勿再合;本 PR 可关。 |
Owner
Author
|
已由 #448 / v1.3.171 取代,本 PR 不再合并。 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
背景
Closes #429 / REQ-0429
流式请求在首字(TTFT)到达前,下游 SSE 保活只调用了
keepalive.start(),armed仍为false,beat()被守卫拦截,客户端长时间收不到任何字节;经 Cloudflare 等反向代理时约 120s 会返回 524。改动
handle-protocol.mjs流式callAttempt路径:将keepalive.start()改为keepalive.arm()(内部仍会start()定时器,并立即armed=true),使 ping/comment 在首字前也能按stream_keepalive_ms发出。start()alone 在首事件前不写入;arm()在 TTFT 前会 ping;源码断言流式 attempt 使用arm()。CHANGELOG.md→## Unreleased(未改VERSION)。范围
测试
node --test test/unit/stream-keepalive.test.mjsnpm run format:check(Biome 部分通过)