Skip to content

CI: lldb stack budget by build flavor, and resume the server after a timed-out attach - #2385

Open
filimonov wants to merge 2 commits into
antalya-26.6from
fix/antalya-26.6/lldb-budget-and-sigcont
Open

filimonov wants to merge 2 commits into
antalya-26.6from
fix/antalya-26.6/lldb-budget-and-sigcont

Conversation

@filimonov

Copy link
Copy Markdown
Member

Two changes to tests/clickhouse-test's lldb stack collection, each its own commit:

  1. lldb budget by build flavor (port of upstream 1fd4b6eea445, 7918dfd548d4, 5e152c370237, reduced to the timeout selection): 30 s per pid for release, 120 s for debug/sanitizer/coverage, read from args.build_flags or from the binary via clickhouse local when the server never started; print_c_stacktraces gets an aggregate deadline and names the pids it skips; the per-test timeout handler keeps the tight 30 s / 60 s pair. Not ported: the stacktrace log files and truncation marker, and the removal of the on-demand lldb install (the fork's images still need it).
  2. Resume the server after a timed-out lldb attach. lldb attaches with ptrace, which stops the server; when lldb is killed on the budget mid-attach the kernel leaves the server in group-stop and nothing continues it. Seen on an MSan CAS-S3 shard: the server froze in state T, ignored SIGTERM/SIGTRAP, and every later job step timed out. lldb now runs in its own process group, a timeout kills the group and sends SIGCONT to the target. Intended to be proposed upstream as well.

Tests in ci/tests/test_print_stacktraces.py: six ported budget tests plus one that stops a target by hand, substitutes a never-returning command for lldb, and checks the target runs again after the timeout. All nine tests in the file pass locally against a standalone server.

Related: #2298

Changelog category (leave one):

  • CI Fix or improvement

Changelog entry (a user-readable short description of the changes that goes to CHANGELOG.md):

CI: the test runner gives lldb 120 s instead of 30 s to collect stacks from debug and sanitizer servers, and resumes a server that a timed-out lldb attach left stopped.

Documentation entry for user-facing changes

  • Documentation is written (mandatory for new features)

CI/CD Options

Exclude tests:

  • Fast test
  • Integration Tests
  • Stateless tests
  • Stateful tests
  • Unit tests
  • Performance tests
  • Aarch64 tests
  • All with ASAN
  • All with TSAN
  • All with MSAN
  • All with UBSAN
  • All with Coverage
  • All Regression
  • Disable CI Cache

Regression jobs to run:

  • Fast suites (mostly <1h)
  • Aggregate Functions (2h)
  • Alter (1.5h)
  • Benchmark (30m)
  • CAS (content-addressed storage; Antalya only)
  • ClickHouse Keeper (1h)
  • Iceberg (2h)
  • LDAP (1h)
  • OAuth (5m)
  • Parquet (1.5h)
  • RBAC (1.5h)
  • SSL Server (1h)
  • S3 (2h)
  • S3 Export (2h)
  • Swarms (30m)
  • Tiered Storage (2h)

🤖 Generated with Claude Code

https://claude.ai/code/session_01GhVd7eMAWdFubNk4g1B2Tx

filimonov and others added 2 commits September 16, 2026 13:01
Port of the budget selection from upstream (1fd4b6e, 7918dfd,
5e152c3), reduced to the part that chooses the per-PID timeout:

- `LLDB_TIMEOUT` (30 s) for release, `LLDB_SLOW_BUILD_TIMEOUT` (120 s) for
  debug, sanitizer and coverage servers, read from `args.build_flags`, or from
  the binary via `clickhouse local` (`is_slow_build_binary`) when the server
  never started and the flags were not collected.
- `print_c_stacktraces` takes `per_pid_timeout` and `total_timeout`, clamps
  each attach to what is left of the aggregate ceiling and names the pids it
  skipped. The per-test timeout handler, which runs inside a fired one-shot
  alarm, keeps the tight pair (30 s per pid, 60 s total); the abort paths take
  the flavor budget.

Not ported: the stacktrace log files, the truncation marker and
`keep_output_on_error` (a separate upstream change), and the removal of the
on-demand lldb install, which the fork's images still need.

Tests mirror upstream's, run without a server.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GhVd7eMAWdFubNk4g1B2Tx
Signed-off-by: Mikhail Filimonov <mfilimonov@altinity.com>
`get_stacktraces_from_lldb` killed lldb on the budget and assumed the server
was untouched. It is not: lldb attaches with ptrace, which stops the inferior,
and loads symbols afterwards; on a large sanitizer binary that alone outlasts
the budget. When the tracer is killed while the inferior sits in that stop,
the kernel detaches it but leaves it in group-stop, and nothing continues it.

Seen on an MSan CAS-S3 stateless shard: six lldb attaches all hit the budget;
the one aimed at the server left it in state T (the watchdog logged `Child
process was stopped by signal 19`), and from then on the server ignored
SIGTERM and SIGTRAP, `system flush logs` and `clickhouse stop` timed out, and
the system-table dump failed on the server's own status-file lock.

Run lldb in its own process group, kill the whole group on timeout, then send
SIGCONT to the target, which is a no-op for a process that was never stopped.
The test stops a target by hand, substitutes a never-returning command for
lldb, and checks the target is running again after the timeout.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GhVd7eMAWdFubNk4g1B2Tx
Signed-off-by: Mikhail Filimonov <mfilimonov@altinity.com>
@github-actions

Copy link
Copy Markdown

Workflow [PR], commit [d29211a]

@k-morozov
k-morozov self-requested a review September 16, 2026 12:49
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.

1 participant