fix(kubernetes): treat null exit code as success in hydrateWithArchive#1915
Open
Buktal wants to merge 1 commit into
Open
fix(kubernetes): treat null exit code as success in hydrateWithArchive#1915Buktal wants to merge 1 commit into
Buktal wants to merge 1 commit into
Conversation
The Fabric8 K8s exec WebSocket v4 protocol lacks per-channel stdin close. ExecWatch.close() shuts the entire WebSocket before exit status (stream 3) arrives, causing exitCode to complete with null. Previous fix (agentscope-ai#1903) moved exitCode.get() inside the try block, which caused a deadlock: get() blocks waiting for the exit code, but ExecWatch.close() (which triggers stdin EOF and allows cat to exit) only runs at try end. Correct approach: keep get() outside try (no deadlock), treat null as success. Fabric8's ExecWatch.exitCode() docs confirm this is expected: "there's currently no way to indicate end of input over a websocket, so you may not get an exit code when using stdIn."
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
Contributor
|
Nice fix! Moving |
Contributor
Author
|
Priority PR. Previous fix was buggy & sub-par. Needs optimization. @chickenlj |
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.
Problem
hydrateWithArchivegets stuck or reports false "archive upload failed (exit=null)" when uploading tar archives to K8s sandbox pods.Root Cause
Two bugs in one:
Fabric8 / K8s exec WebSocket v4 protocol limitation — there is no way to close stdin without closing the entire WebSocket. When
ExecWatch.close()runs, the WebSocket is shut before exit status (stream 3) arrives, soexitCodecompletes withnull.Previous fix (fix(kubernetes): fix WebSocket race in hydrateWithArchive causing exit=null #1903) is incorrect —
exitCode.get()was moved inside the try-with-resources block, causing a deadlock:get()blocks waiting for exit code, butExecWatch.close()(which triggers stdin EOF → cat exits → exit code arrives) only runs at try end.Fix