Skip to content

fix: close stdin for Solace CLI exec so tests don't hang under piped stdin - #8742

Merged
vdesabou merged 2 commits into
vdesabou:masterfrom
skapoor-cflt:skapoor/fix-solace-cli-readiness
Aug 6, 2026
Merged

fix: close stdin for Solace CLI exec so tests don't hang under piped stdin#8742
vdesabou merged 2 commits into
vdesabou:masterfrom
skapoor-cflt:skapoor/fix-solace-cli-readiness

Conversation

@skapoor-cflt

@skapoor-cflt skapoor-cflt commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Problem

Both connect-solace tests 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 exec uses docker exec -i, which forwards the caller's stdin. Confluent's CP pipeline runs tests as yes | playground run -f …, so cli -A -s gets an endless y stream 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/null on the CLI exec — the fix
  • Restore run_solace_cli_script_with_retry (removed in cb841990) with a per-attempt timeout, in scripts/utils.sh
  • MAX_WAIT back to 600

Validated on CP 8.3.x, both tests pass: workflow a6799dcb

skapoor-cflt and others added 2 commits August 5, 2026 16:15
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]>
@skapoor-cflt skapoor-cflt changed the title fix: restore Solace CLI readiness retry, with a per-attempt timeout fix: close stdin for Solace CLI exec so tests don't hang under piped stdin Aug 5, 2026
@vdesabou
vdesabou merged commit f4e145f into vdesabou:master Aug 6, 2026
1 check 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.

2 participants