Repository navigation
CI: fix performance-test server killing its own driver via shared process group - #103307
Merged
Merged
Conversation
Contributor
|
Workflow [PR], commit [7e8506c] Summary: ✅ AI ReviewSummaryThis PR fixes CI process-lifecycle handling by isolating ClickHouse Rules
Final VerdictStatus: ✅ Approve |
1 task
azat
pushed a commit
to azat/ClickHouse
that referenced
this pull request
Apr 23, 2026
PR ClickHouse#101267 removed the 15-iteration retry loop with the claim that the new caching-based sampling ensures a single pass produces all expected trace-log rows. After the PR was merged to master, the test began failing on both master (`Integration tests (amd_binary_excluded_from_llvm)`) and several unrelated in-flight PRs (ClickHouse#98727, ClickHouse#101434, ClickHouse#103307), each at different assertion lines in the single-pass test: - `get_trace_events('Unknown', 'Global', 'JemallocSample') > 0` - `get_trace_events('Unknown', 'Max', 'MemorySample', query_id) > 0` - `get_trace_events('Global', 'Max', 'Memory'/'MemoryPeak') > 0` The reason these events are not guaranteed in a single pass — even with fully-propagated `sample_probability` — is that two of the trace types are genuinely probabilistic relative to this test's workload: - `JemallocSample` is emitted by `jemalloc`'s own profile sampler (`lg_prof_sample=20` ≈ one sample per 1 MiB). Ten `logTrace('foo')` calls plus a `SELECT * FROM numbers(100000) ORDER BY number` are not guaranteed to allocate enough `jemalloc`-tracked memory to trigger a sample inside a `MemoryTrackerBlockerInThread(Global)` scope. - `Memory`/`MemoryPeak` with `memory_context = 'Global'` are only emitted when `total_memory_tracker` crosses its `total_memory_profiler_step` watermark (4 MiB default). Whether this happens inside a given test query depends on cumulative server-wide allocations including background activity, not just the query's own allocations. The retry loop bounds the test runtime at ~15 s while letting these events accumulate reliably. Restore it, and add a comment explaining why it is required so it is not dropped again. Report: https://s3.amazonaws.com/clickhouse-test-reports/json.html?REF=master&sha=fa205863ba68f05b529e2073defb5cf5df7cc832&name_0=MasterCI&name_1=Integration%20tests%20%28amd_binary_excluded_from_llvm%29 Session: cron:clickhouse-ci-task-worker:20260421-224500 Co-Authored-By: Claude Opus 4.7 <[email protected]>
euvre
pushed a commit
to euvre/ClickHouse
that referenced
this pull request
Apr 24, 2026
…ut-init CI: re-add CI Tests job; skip orphan-cleanup test until latent bug in performance_tests.py is fixed (ClickHouse#103307)
leshikus
marked this pull request as ready for review
April 24, 2026 18:03
leshikus
added a commit
to leshikus/ClickHouse
that referenced
this pull request
Apr 26, 2026
… build The Stage 1 instrumented clang was compiled with the default value-profiling counter limit of 3 slots per indirect call site. During ClickHouse profile collection, the instrumented binary emitted: LLVM Profile Warning: Unable to track new values: Running out of static counters. Consider using option -mllvm -vp-counters-per-site=<n> to allocate more value profile counters at compile time This saturates call-site counters and loses indirect-call frequency data needed by the PGO optimizer in Stage 2, reducing the quality of the final toolchain. Fix: pass `-mllvm -vp-counters-per-site=8` via `CMAKE_C_FLAGS` / `CMAKE_CXX_FLAGS` when building Stage 1. The flag is baked into the instrumented binary at compile time, so the running binary can track up to 8 distinct callees per indirect call site instead of 3. Seen in: ClickHouse#103307 Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
leshikus
added a commit
to leshikus/ClickHouse
that referenced
this pull request
Apr 27, 2026
…-serialization` PR ClickHouse#102596 (`yarik/fix-time64-serialization`) added a trailing-garbage check in `deserializeTextCSV`: after parsing the unquoted field as a time string, it now throws `UNEXPECTED_DATA_AFTER_PARSED_VALUE` if the buffer is not fully consumed. The test was using `45045123` as an unquoted CSV value. `readTime64Text` parsed only `45` (SS format) and left `045123` as "trailing garbage", causing the test to fail across all stateless-test configurations. Fix: replace the raw integer with `12:30:45.123`, a proper unquoted time string, and rename the section header accordingly. The expected output (`00:00:00.000` / `12:30:45.123`) is unchanged since the quoted-CSV and unquoted time-string paths both normalise correctly. Ref: ClickHouse#103307 Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
maxknv
reviewed
Apr 28, 2026
maxknv
left a comment
Member
There was a problem hiding this comment.
I'd like to see the Praktika change land separately - it's a significant update and shouldn't go in as a side fix.
Two suggestions:
- The new label shouldn't be a per-workflow property. It feels more like a basic debugging feature, so it should be a new Setting in Praktika that users can override when needed.
- I'd suggest naming the label
ci-force-all
maxknv
approved these changes
May 1, 2026
commit 600be4aa8a8613d0a4ba9b7e8ad846f789dc93ba Merge: febefb0 4e4a4c0 Author: Alexei Fedotov <[email protected]> Date: Sat May 2 13:48:18 2026 +0200 Merge branch 'master' into add-ci-tests-init commit febefb0 Author: Alexei Fedotov <[email protected]> Date: Fri May 1 01:13:37 2026 +0200 Remove unimplemented `job_filter_bypass_labels` field from `Workflow.Config` The field was declared but never consumed by the job filtering logic in `native_jobs.py`, so `"ci-all-jobs"` label would have had no effect. Also reverts the `BUILD_TOOLCHAIN (amd64)` timeout override that was included in the same commit by mistake. commit bca4a1f Merge: fa4ec08 a0aae2a Author: Alexei Fedotov <[email protected]> Date: Fri May 1 01:03:46 2026 +0200 Merge branch 'master' into add-ci-tests-init commit fa4ec08 Merge: 062b466 d3573bd Author: Alexei Fedotov <[email protected]> Date: Tue Apr 28 07:59:44 2026 +0200 Merge branch 'master' into add-ci-tests-init commit 062b466 Author: Alexei Fedotov <[email protected]> Date: Mon Apr 27 15:12:22 2026 +0200 Revert "Address review: keep release-PR guard unconditional when `ci-all-jobs` label is set" This reverts commit e9f8a95. commit e9f8a95 Author: Alexei Fedotov <[email protected]> Date: Mon Apr 27 15:07:34 2026 +0200 Address review: keep release-PR guard unconditional when `ci-all-jobs` label is set Add `job_filter_bypass_exclude_labels` to `Workflow.Config`. When any of those labels are present, `job_filter_bypass_labels` is ignored so `workflow_filter_hooks` and file-based job filtering both run normally. Configure `pull_request.py` with `job_filter_bypass_exclude_labels=["release", "release-lts"]` so a PR carrying both `ci-all-jobs` and a release label still has every job skipped by the `should_skip_job` release guard, consistent with the PR description ("Release labels still take priority"). Co-Authored-By: Claude Sonnet 4.6 <[email protected]> commit c07de66 Author: Alexei Fedotov <[email protected]> Date: Mon Apr 27 13:09:24 2026 +0200 Fix `04122_serialization_time64_formats` test after `yarik/fix-time64-serialization` PR ClickHouse#102596 (`yarik/fix-time64-serialization`) added a trailing-garbage check in `deserializeTextCSV`: after parsing the unquoted field as a time string, it now throws `UNEXPECTED_DATA_AFTER_PARSED_VALUE` if the buffer is not fully consumed. The test was using `45045123` as an unquoted CSV value. `readTime64Text` parsed only `45` (SS format) and left `045123` as "trailing garbage", causing the test to fail across all stateless-test configurations. Fix: replace the raw integer with `12:30:45.123`, a proper unquoted time string, and rename the section header accordingly. The expected output (`00:00:00.000` / `12:30:45.123`) is unchanged since the quoted-CSV and unquoted time-string paths both normalise correctly. Ref: ClickHouse#103307 Co-Authored-By: Claude Sonnet 4.6 <[email protected]> commit 0ebb9c7 Author: Alexei Fedotov <[email protected]> Date: Mon Apr 27 13:09:14 2026 +0200 Move `ci-all-jobs` bypass out of filter hooks into the call site `job_filter_bypass_labels` was only checked in the file-based filtering phase of `_config_workflow`, so `workflow_filter_hooks` (e.g. `private_job_filter`) still ran and skipped jobs even when the `ci-all-jobs` label was set. Fix: check `job_filter_bypass_labels` before iterating `workflow_filter_hooks` in `native_jobs.py` so the bypass is applied uniformly to all hook-based filtering, not just file-based filtering. The now-redundant early-return for `Labels.CI_ALL_JOBS` inside `should_skip_job` is removed — it is dead code once the call site handles the bypass. Co-Authored-By: Claude Sonnet 4.6 <[email protected]> commit dc35478 Author: Alexei Fedotov <[email protected]> Date: Mon Apr 27 08:54:44 2026 +0200 Fix race condition and error masking in `test_accept_invalid_certificate` `execute_query_native` wrote all test configurations to the same `configs/client.xml` path, causing parallel test invocations to clobber each other's config and produce inconsistent TLS behaviour. Additionally, calling `remove()` inside the `except` block could raise `FileNotFoundError`, which replaced the real SSL exception and broke the `assert "certificate verify failed"` checks. Fix: write each config to a unique temp file via `tempfile.mkstemp` and clean it up in a `finally` block that swallows `FileNotFoundError`. Co-Authored-By: Claude Sonnet 4.6 <[email protected]> commit 263d43a Merge: 5176553 c37e307 Author: Alexei Fedotov <[email protected]> Date: Mon Apr 27 08:50:41 2026 +0200 Merge branch 'master' into add-ci-tests-init commit 5176553 Author: Alexei Fedotov <[email protected]> Date: Sun Apr 26 09:48:31 2026 +0200 CI: fix `LLVM Profile Warning: Running out of static counters` in PGO build The Stage 1 instrumented clang was compiled with the default value-profiling counter limit of 3 slots per indirect call site. During ClickHouse profile collection, the instrumented binary emitted: LLVM Profile Warning: Unable to track new values: Running out of static counters. Consider using option -mllvm -vp-counters-per-site=<n> to allocate more value profile counters at compile time This saturates call-site counters and loses indirect-call frequency data needed by the PGO optimizer in Stage 2, reducing the quality of the final toolchain. Fix: pass `-mllvm -vp-counters-per-site=8` via `CMAKE_C_FLAGS` / `CMAKE_CXX_FLAGS` when building Stage 1. The flag is baked into the instrumented binary at compile time, so the running binary can track up to 8 distinct callees per indirect call site instead of 3. Seen in: ClickHouse#103307 Co-Authored-By: Claude Sonnet 4.6 <[email protected]> commit 22a4eb5 Author: Alexei Fedotov <[email protected]> Date: Sun Apr 26 00:17:19 2026 +0200 Update workflows commit e281776 Merge: 807b47f 7fc29dc Author: Alexei Fedotov <[email protected]> Date: Sun Apr 26 00:16:47 2026 +0200 Merge branch 'master' into add-ci-tests-init commit 807b47f Author: Alexei Fedotov <[email protected]> Date: Sun Apr 26 00:08:57 2026 +0200 CI: increase `Build Toolchain (PGO, BOLT) (amd64)` timeout to 8 h on PR 3 h was too tight; raise to 8 h to match the previous default. Co-Authored-By: Claude Sonnet 4.6 <[email protected]> commit eb73037 Author: Alexei Fedotov <[email protected]> Date: Sat Apr 25 10:55:39 2026 +0200 Update workflows commit 30ba815 Merge: 8154744 04bd709 Author: Alexei Fedotov <[email protected]> Date: Sat Apr 25 10:54:58 2026 +0200 Merge branch 'master' into add-ci-tests-init commit 8154744 Author: Alexei Fedotov <[email protected]> Date: Sat Apr 25 10:22:14 2026 +0200 CI: fix flaky check assertion and toolchain timeout on PR - In `integration_test_job.py`, fall back to a sanity test when `is_flaky_check` is True, no changed integration test modules are found, and `ci-all-jobs` label is set (which bypasses job skips and would otherwise hit the assertion) - In `pull_request.py`, override timeout to 3 hours for `Build Toolchain (PGO, BOLT) (amd64)` in the PR workflow Co-Authored-By: Claude Sonnet 4.6 <[email protected]> commit 040de15 Author: Alexei Fedotov <[email protected]> Date: Fri Apr 24 19:51:10 2026 +0200 CI: fix `_log_fd` leak in `ClickHouseService` when `Popen` raises Use a `with` block so the log file descriptor is always closed after `subprocess.Popen` returns, whether it raises or not. The child process holds its own dup'd fd, so closing Python's copy is safe. Removes the now-unnecessary `_log_fd` instance variable and its associated `flush`/`close` calls. Co-Authored-By: Claude Sonnet 4.6 <[email protected]> commit 1eeef90 Author: Alexei Fedotov <[email protected]> Date: Fri Apr 24 19:38:55 2026 +0200 CI: add `ci-all-jobs` label to bypass all job skips Add a new `ci-all-jobs` PR label that disables both filter-hook skips and file-based job filtering, so every job in the workflow runs regardless of changed files or other label-based conditions. Release labels still take priority. Co-Authored-By: Claude Sonnet 4.6 <[email protected]> commit f265406 Author: Alexei Fedotov <[email protected]> Date: Fri Apr 24 19:25:35 2026 +0200 Restore --init commit 72fda4b Merge: 7fcb083 cf81ad1 Author: Alexei Fedotov <[email protected]> Date: Fri Apr 24 19:24:06 2026 +0200 Merge branch 'master' into add-ci-tests-init commit 7fcb083 Author: Alexei Fedotov <[email protected]> Date: Wed Apr 22 22:05:03 2026 +0200 ci: resolve merge conflict in `ci_tests_job.py` Co-Authored-By: Claude Sonnet 4.6 <[email protected]> commit 5cac837 Merge: 8d8f5a1 3f97d3d Author: Alexei Fedotov <[email protected]> Date: Wed Apr 22 12:07:22 2026 +0200 Merge branch 'master' into add-ci-tests-init commit 8d8f5a1 Author: Alexei Fedotov <[email protected]> Date: Tue Apr 21 23:42:06 2026 +0200 CI: fix perf-test SIGTERM by using start_new_session=True, restore --init The performance test driver was being killed by its own `SIGTERM` because `Utils.terminate_process_group` called `os.killpg(os.getpgid(child_pid), SIGTERM)`, but the child server inherited the driver's own process group (since `subprocess.Popen` was called with `shell=True` and no session isolation). With `--init` injecting `tini` as PID 1 the driver was no longer immune to `SIGTERM`, so the bogus `killpg` killed it — producing "Job killed, exit code [143]". Root-cause fix: add `start_new_session=True` to both `Popen` calls in `ci/jobs/performance_tests.py` (`start_preconfig` and `start`). This gives the server its own process group, so `os.killpg` can only reach server processes and the driver is safe. With the real fix in place: - `--init` is restored in `ci/praktika/runner.py` (it provides correct zombie reaping and was correct to add in ClickHouse#102529). - The temporary `--skip test_cleanup_kills_orphaned_test_process` workaround is removed from the `CI Tests` job config; the test can now run normally. Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
leshikus
force-pushed
the
add-ci-tests-init
branch
from
May 2, 2026 11:51
febefb0 to
5f700f2
Compare
Collaborator
Author
|
try to sync |
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.
CHServer.startandCHServer.start_preconfiginci/jobs/performance_tests.pylaunched the server withshell=Truebut withoutstart_new_session=True, so the server process inherited the driver's process group.Utils.terminate_process_groupthen calledos.killpg(pgid, SIGTERM)on that shared group, killing the driver along with the server. This was masked when the driver ran as PID 1 (immune toSIGTERMby default); adding--initin #102529 made it visible — the driver now exits with code 143.Fix:
start_new_session=Trueon bothPopencalls inCHServer. Also restores--initinrunner.pyand removes the temporary--skip test_cleanup_kills_orphaned_test_processworkaround.Also cleans up
ClickHouseServiceinci/jobs/scripts/clickhouse_service.py: replaces theself._log_fdinstance attribute with awith open(...)block in__enter__(the parent's fd is safely closed afterPopensince the child retains its own copy viadup2) and removes the now-deadflush()andclose()calls.Changelog category (leave one):
Version info
26.5.1.425