Skip to content

Local child-process passthrough exits bypass the telemetry tail #321

Description

@sdairs

Problem

#320 restructured main so every invocation falls through to a single process::exit preceded by telemetry::finalize(), with the hidden telemetry send child as the sole intended early exit. Three pre-existing paths still bypass that tail (found by the #320 adversarial review):

  • crates/clickhousectl/src/local/mod.rs:489 — foreground local server start exits with the server child's exit code
  • crates/clickhousectl/src/local/docker.rs:389 and :522 — docker exec paths exit with the container command's exit code

These invocations produce no telemetry event when they end with a non-zero child exit code, and they skip the update-notice tail.

Design question

All three deliberately pass an arbitrary child exit code through to the shell, which Error::exit_code() (gh-style closed set: 0/1/2/4) cannot represent. Fixing this means either an Error variant carrying a raw exit code (and deciding how that interacts with the documented gh-style codes), or a dedicated "exit code override" channel from handlers back to main's tail.

Non-goal

The success paths of these commands (child exits 0) already flow through the tail and are counted normally; only the non-zero passthrough is affected.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions