fix: close stdin for Solace CLI exec so tests don't hang under piped stdin - #8742
Merged
vdesabou merged 2 commits intoAug 6, 2026
Merged
Conversation
The Solace CLI is not ready to accept `cli -A -s` script invocations for a period after the broker logs "Running pre-startup checks". cb84199 removed the retry wrapper that handled this and replaced it with bare one-shot calls, and also lowered MAX_WAIT from 600 to 240. On CP 8.3 both connect-solace tests now hang indefinitely at that call: connect-solace-source/solace-source.sh:55 cli -A -s create_queue_cmd connect-solace-sink/solace-sink.sh:81 cli -A -s show_queue_cmd Observed in Confluent's CP validation pipeline: the broker started well inside 240s and SMF messaging worked (the sink connector reached RUNNING), but the CLI call produced no output for 30+ minutes until the CI job timed out. Only the CLI path is affected. This restores run_solace_cli_script_with_retry, with one addition over the version cb84199 deleted: each attempt is wrapped in `timeout`. The old helper only branched on a non-zero exit, which cannot recover from a call that never returns. Exit code 124 is logged distinctly so a blocking CLI is distinguishable from an erroring one. The helper lives in scripts/utils.sh next to install_connector_with_retry rather than being duplicated per script, and both Solace scripts already source it. MAX_WAIT is restored to 600. Note: on hosts without coreutils `timeout`, KDP's timeout() wrapper in scripts/cli/src/lib/utils_function.sh ignores the duration and runs the command unguarded, so the timeout is best-effort there -- consistent with the other ~300 uses of timeout in connect/. The same commit affected connect-jms-solace-source, connect-jms-solace-sink, ccloud/fm-solace-source and ccloud/fm-solace-sink, which are still one-shot. Left out of this change to keep the diff reviewable. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Validation on CP 8.3 showed the CLI never responds, rather than being slow to become ready: 31 consecutive attempts each hit the 60s per-attempt timeout (exit 124) with no successes, then the 300s budget was exhausted. 10:58:39 Solace CLI did not respond within 60s ... (0/300s) ... 11:33:39 Solace CLI did not respond within 60s ... (300/300s) 11:33:49 Solace CLI is not ready for queue stats check after 300 seconds A readiness delay would have resolved within seconds. Blocking on every attempt for 35 minutes points at stdin. `playground container exec` runs `docker exec -i`, which forwards the caller's stdin into the container. Confluent's CP validation pipeline invokes tests as `yes | playground run -f <test>`, so the Solace CLI inherits an unbounded stream of "y" and never sees EOF while reading stdin. Solace is the only test family in this repo that execs an interactive CLI inside a container -- `cli -A -s` appears only under connect-solace-* and connect-jms-solace-* -- which is why no other test is affected, and why this repo's own CI (which does not wrap runs in `yes |`) is green. Redirecting stdin from /dev/null for that one exec gives the CLI an immediate EOF. The retry and per-attempt timeout are kept: they bound the failure if the CLI is ever genuinely unavailable, and they are what made this diagnosable instead of an unbounded stall. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
vdesabou
approved these changes
Aug 6, 2026
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
Both
connect-solacetests hang forever on CP 8.3 at the CLI call —solace-source.sh:55(create_queue_cmd),solace-sink.sh:81(show_queue_cmd).Cause
playground container execusesdocker exec -i, which forwards the caller's stdin. Confluent's CP pipeline runs tests asyes | playground run -f …, socli -A -sgets an endlessystream and never sees EOF.Solace is the only family here that execs an interactive CLI, and this repo's CI doesn't use
yes |— hence green upstream, hung for us.Not readiness: with a 60s per-attempt timeout, 31 consecutive attempts all exited 124 over 35 minutes.
Change
< /dev/nullon the CLI exec — the fixrun_solace_cli_script_with_retry(removed incb841990) with a per-attempttimeout, inscripts/utils.shMAX_WAITback to 600Validated on CP 8.3.x, both tests pass: workflow a6799dcb