Skip to content

ci: bump actions to v5; fix post-close WebSocket send race - #301

Merged
lzsweb merged 3 commits into
mainfrom
ci/bump-actions-to-v5
Nov 30, 2026
Merged

lzsweb merged 3 commits into
mainfrom
ci/bump-actions-to-v5

Conversation

@lzsweb

@lzsweb lzsweb commented Nov 26, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Two CI-hygiene fixes surfaced by the v2.23.8 Release run (45798619666).

1. Bump GitHub Actions to v5 (Node 24)

  • Upgrade actions/checkout v4 → v5 and actions/setup-java v4 → v5 across release.yml, build-and-test.yml, and linter.yml.
  • v5 targets Node 24, clearing the "Node.js 20 is deprecated" and "setup-java v4 is deprecated" annotations.
  • Action inputs unchanged (java-version, distribution, server-*, gpg-*, fetch-depth, cache). linter.yml checkout stays SHA-pinned, bumped to the v5 commit fbc6f3992d24b796d5a048ff273f7fcc4a7b6c09.
  • Scope limited to the two flagged actions; upload-artifact@v4 and other workflow logic untouched.

2. Fix post-close WebSocket send race (fix(protocol))

  • The release run also emitted a new Can not find api-key. error annotation (17 occurrences vs 0 in v2.23.7). Root cause is a race, not a regression (only Version.java changed between the tags): after a duplex stream is cancelled/disposed, an orphaned RxJava thread still ran the streamingData onComplete finish-task send and reconnect; with no global API key in the release env this threw NoApiKeyException, which escaped the unguarded onComplete Action as an RxJava UndeliverableException.
  • OkHttpWebSocketClient: guard the onComplete finish-task send with isClosed + try/catch; early-return quietly from the reconnect catch when closed; downgrade the onNext catch log to debug when closed. Live-flow failures still surface via emitResponseError.
  • Add a deterministic same-package regression test (TestOkHttpWebSocketClientCloseRace) reproducing the dispose-then-complete race; verified it fails before the fix and passes after.
  • No CI API key added (that would mask the race); no change to static shared state.

Test plan

  • build-and-test / linter runs no longer emit the Node 20 / setup-java v4 deprecation annotations
  • checkout and setup-java steps still succeed (repo checked out, JDK toolchain provisioned)
  • grep -rnE "actions/(checkout|setup-java)@v4" .github/workflows/ returns nothing
  • Release run no longer emits the Can not find api-key. / UndeliverableException annotation
  • TestOkHttpWebSocketClientCloseRace (2 cases) + duplex/websocket suite (TestFullDuplexApi, TestFullDuplexErrorHandling, TestHalfDuplexWebSocketApi, TestMultimodalDialog, TestSseErrorHandling, TestApiKey) — 33 tests, 0 failures
  • google-java-format (CI 1.7) clean; L3 deep security review — 0 findings

zhansheng.lzs added 2 commits November 26, 2026 18:52
actions/checkout@v4 and actions/setup-java@v4 target the deprecated Node 20
runtime and are forced onto Node 24; setup-java v4 is also itself deprecated.
Upgrade both to v5 (Node 24) across release, build-and-test, and linter
workflows to clear the deprecation annotations. Inputs are unchanged.
After a duplex stream is cancelled/disposed, an orphaned RxJava thread still
ran the streamingData onComplete finish-task send and reconnect; with no global
API key this threw NoApiKeyException, which escaped the unguarded onComplete
Action as an RxJava UndeliverableException (the release-run "Can not find
api-key." annotation). Guard the onComplete send and the reconnect catch with
isClosed so post-close sends/reconnects are quiet and non-throwing, while live
-flow failures still surface via emitResponseError. Add a deterministic
same-package regression test reproducing the dispose-then-complete race.
@lzsweb lzsweb changed the title ci: bump checkout and setup-java actions to v5 (Node 24) ci: bump actions to v5; fix post-close WebSocket send race Nov 26, 2026
@lzsweb
lzsweb merged commit 6bd3eca into main Nov 30, 2026
3 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.

1 participant