Skip to content

plugin stdout: the last line of an out-of-process plugin's output can be dropped when the host exits — 6 anomalies in 66 parallel runs, exit 0, artifacts present #1013

Open

Description

@aitrawog

What is wrong

An out-of-process plugin's last stdout line can be lost when the host charly process exits while the plugin's output is still being forwarded. It is invisible in a serial run and reproducible under parallel load, and it makes any bed step that asserts on a plugin's printed status line intermittently red.

Measured

Bed step [pipeline-runs-lifted-file-verbs] of check-pipeline-local, run 10-way in parallel, three waves. The step's own script is unchanged; only the concurrency is added. Driver /tmp/charly-driver/bin/charly (2026.294.1108, merged tree 68675149), the tree's plugin-pipeline + the merged plugin-lobster baked into CHARLY_PLUGIN_DIR:

tree iterations anomalies
origin/main 45d4023 30 1
feat/env-data-string-resolver fd420e5 30 1
origin/main, 12-way, bed script verbatim 12 3
origin/main, 12-way, second wave 24 2

The bed's charly.yml is byte-identical on the two trees (git diff --stat origin/main HEAD -- charly.yml is empty), so the rate is tree-independent.

The signature, measured on a preserved fixture

The step runs charly pipeline run lifted-verbs-plan > run.out 2>&1 and then greps run.out for ran via workflow:lobster — status=ok. In an anomalous iteration:

  • the pipeline's artifacts are present (rendered.txt, emitted.yml, .opencharly/pipelines/<entity>/),
  • the front-end exited 0 (r1=0, captured with $? rather than a ||),
  • and run.out (598 bytes) holds ONLY the host's three startup lines:
WARNING: charly is a dev/worktree build (not installed at /usr/bin or /usr/local/bin); NOT loading the installed package's plugins from /usr/lib/charly/plugins (they may be built against a different charly version). Set CHARLY_PLUGIN_DIR to load plugins from a custom location.
plugin plugin-pipeline: served from baked binary /tmp/baked-base/plugin-pipeline (build sha256:e38989a8f93fbbd3de392568586ed65fdd0a2c39fdba98ad0c309e28682ce135)
plugin plugin-lobster: served from baked binary /tmp/baked-base/plugin-lobster (build sha256:dc7e72c4a6e18da09384a0084f6386f00ee567c5a12ff3903ce739a6edf3df71)

The missing line is the LAST one the run prints (candy/plugin-pipeline/cli.go:126, inside the plugin process), and nothing else in the run is missing. So the run SUCCEEDED and the tail of its forwarded stdout did not reach the caller.

Root cause (candidate, not established)

The tail-drop shape points at the plugin-stdout forwarding path being torn down when the host finishes, rather than being drained to EOF: the host waits for the plugin's RPC reply (hence exit 0 and the artifacts), then exits, and a line the plugin printed just before its own exit is still in the pipe.

Missed control: no test asserts that a plugin's LAST printed line survives to the caller's stdout, and every bed step that greps a plugin's status line is therefore racy by construction. check-pipeline-local is the first place this surfaced, as its 2-in-5 non-determinism.

Blast radius: any charly command whose output is produced by an out-of-process plugin and asserted by a bed step — which is most of the plugin-surface beds.

Root fix

Drain the forwarded stdout before the host exits (a wait on the forwarding goroutine, not a sleep), and add a control that runs an out-of-process plugin's print-then-exit under repetition and asserts the last line arrives. Filed from opencharly/plugin-pipeline#52 (see plugin-pipeline#51, where the same instability is recorded from the bed's side).

Agent: charly

Assisted-by: DeepSeek Harness ollama-cloud deepseek-v4.1-flash (analysed on a live system)

Activity

  1. added
    category:runtime
    type:fix
    on Nov 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    category:runtimetype:fix

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions