Repository navigation
Conversation
The build_profile_hook post-hook runs on every master Build variant and uploads compile-time-trace telemetry to a shared remote analytics DB. The ~25 variants of a master push finish and upload at once, so the per-user INSERTs routinely cross the DB's memory limit and one is killed with Code: 241 MEMORY_LIMIT_EXCEEDED (during ParallelParsingBlockInputFormat). insert_* turns that rejection into an AssertionError, which the hook treated as fatal (sys.exit 1), so a successful build was reported as a failed "Post Hooks" check. This telemetry is observability-only and has no bearing on the produced binaries, so a rejected upload must not fail the build. Catch upload errors per artifact in _upload_profile_artifacts, log them, and continue. Genuine build/producer errors still fail loudly: they surface earlier, in prepare-time-trace.sh under strict Shell.check and in local file assembly, outside the upload loop. PR ClickHouse#107117 guarded the missing/empty-artifact case (ClickHouse#84159) but left the remote-rejection case fatal; this addresses that remaining mechanism, which is the dominant cause of the chronic master Build Post Hooks failures across all variants (~600/day, build-content-independent). Co-Authored-By: Claude Opus 4.8 <[email protected]>
Pre-PR validation gate
Session id: cron:clickhouse-worker-slot-3:20260623-130300 |
|
cc @maxknv — follow-up to #107117 (which you approved). That guarded the missing/empty build-profile artifact case; this makes the telemetry INSERT itself best-effort so a |
|
@groeneai you can just disable the parallel parsing. |
The shared LogCluster analytics DB rejects the build_profile_hook INSERT with Code 241 MEMORY_LIMIT_EXCEEDED while executing ParallelParsingBlockInputFormat when the ~25 master Build variants finish and upload at once. The per-user limit is fixed server-side, so the existing max_memory_usage_for_user override does not help; the only lever is lowering the INSERT's peak parse memory. Parallel parsing buffers many chunks at once, and that peak is what crosses the limit. Send input_format_parallel_parsing=0 on the telemetry INSERT (LogCluster.do_query, used only by the three build-profile uploads) so the INSERT is accepted and the telemetry is kept rather than dropped. The best-effort catch from the prior commit stays as a guard for transient connectivity rejections, without masking genuine producer errors (those surface earlier under strict Shell.check). Co-Authored-By: Claude Opus 4.8 <[email protected]>
|
Done. Pushed The INSERT is killed Regression test added: |
|
Workflow [PR], commit [a53bf73] Summary: ❌
AI ReviewSummaryThis PR limits Missing context / blind spots
Final VerdictStatus: ✅ Approve No required changes. |
CI finish ledger — 5e66c70Every failure below links a fixing PR (ours or external). Only
The stress red is Session id: cron:our-pr-ci-monitor:20260624-033000 |
|
Thanks for digging into this — the root-cause analysis (parallel-parsing buffer crossing the per-user limit) is solid and well-explained. I do want to push back on the failure model the fix relies on, though. 1. The framing of "fatal" overstates it. The post hook failing doesn't fail the build itself — the 2. Reporting a failed operation as success doesn't sit right with me. Making the upload best-effort means a non-trivial operation can fail and we'll never know. Today's failure is loud and annoying, but it's at least visible. Swallowing it trades a noisy-but-honest signal for a silent one, and we can end up doing real work that quietly fails. 3. If the workload is too heavy for the cluster, let's reduce the workload. The real problem is ~25 variants uploading simultaneously on every master push. That points at scheduling/throttling — e.g. don't profile every variant, or every commit — rather than at suppressing the error. Fixing the parse memory helps, but it's treating the symptom of "too much at once." 4. If a failed profile upload is genuinely fine to ignore, do we need it at all? These two positions are in tension: either the telemetry matters (then losing it should be visible and we should fix the capacity), or it doesn't (then dropping the check entirely is cleaner than catching-and-logging). 5. Overall this feels like sweeping the dust under the rug. The Concretely, I'd suggest splitting this: keep the parallel-parsing fix (it's a clear win), and instead of making failures best-effort, address the contention directly — throttle/stagger uploads or reduce how often we profile. If we decide the telemetry is expendable, let's say so explicitly and drop it rather than keep a check that's green regardless of outcome. |
|
@maxknv Agreed on the core point: making the upload best-effort reports a failed operation as success, which is the wrong trade. I'll drop that half and keep only One caveat so the call is informed: I can't verify from this PR that single-threaded parsing alone keeps all ~25 variants under the per-user limit. The hook only runs on master (the That part is a capacity/scheduling decision I don't want to make on my own. Which would you prefer, and in this PR or a follow-up?
I'll remove best-effort now and implement whichever you pick. I won't build throttling speculatively. |
|
Let's upload profiling for a smaller subset of builds: amd_release and arm_release. Make it an explicit list; other builds may be commented out. Add a brief comment explaining why a small subset was used. |
The build_profile_hook telemetry upload contends for the shared LogCluster analytics DB: on a master push ~25 Build variants finish and upload at once, and the combined load crosses the cluster's per-user memory limit (Code 241 MEMORY_LIMIT_EXCEEDED). Restrict the upload to an explicit subset of two representative release builds (amd_release, arm_release) so the contention is removed at the source rather than its symptom suppressed. The other build names are listed commented-out so re-enabling one is a one-line change. input_format_parallel_parsing=0 on the INSERT is kept. With the workload reduced, drop the best-effort catch-and-log of upload failures: a genuine INSERT rejection now means a real lost upload and must stay visible (the hook fails loudly) instead of being reported as success. The empty-artifact skip (ClickHouse#84159, builds that produce no profile data) is unrelated to error handling and stays. Co-Authored-By: Claude Opus 4.8 <[email protected]>
|
@maxknv done, pushed in a53bf73.
Tests updated: assert the subset gate, assert an upload rejection propagates (was: swallowed), keep the parallel-parsing assertion. One caveat for the record: the hook is master-only ( |
996192e
…hook-upload-best-effort CI: collect Build profile telemetry for a subset of builds
Related: #84159
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
...
Description
build_profile_hookruns on every master Build variant and uploads compile-time-trace telemetry to a shared remote analytics DB. The ~25 variants of a master push finish and upload at roughly the same time, so the per-user INSERTs cross that DB's memory limit and one is killed withCode: 241 MEMORY_LIMIT_EXCEEDED(While executing ParallelParsingBlockInputFormat). The hook treated that rejection as fatal (sys.exit(1)), so a successful build was reported as a failedPost Hookscheck (~600/day, all variants, build-content-independent).Reduce the workload at the source: collect build profile telemetry only for an explicit subset of two representative release builds (
amd_release,arm_release) instead of all ~25 variants, so they no longer upload at once and cross the per-user limit. The other build names are listed commented-out, so re-enabling one is a one-line change.Keep
input_format_parallel_parsing=0on the INSERT (per @nikitamikhaylov): the kill happens inParallelParsingBlockInputFormat, whose chunk buffering is the memory peak, and single-threaded parsing keeps a single upload's peak parse memory low.Upload errors are no longer swallowed. With the workload reduced, a genuine INSERT rejection means a real lost upload and now fails the hook loudly instead of being reported as success. The empty-artifact skip (#84159, builds that produce no profile data) is unrelated to error handling and stays.
Example failure (master
Build (amd_release), 2026-06-23): https://s3.amazonaws.com/clickhouse-test-reports/json.html?REF=master&sha=4dde9a6abaa86ed9c3897525f053b02a284f6a67&name_0=MasterCI&name_1=Build%20%28amd_release%29Regression tests in
ci/tests/test_build_profile_hook.py: telemetry is collected only for the allow-listed release builds; the INSERT runs withinput_format_parallel_parsing=0; an upload rejection propagates rather than being swallowed. Each fails against the un-fixed code and passes with this change.Version info
26.7.1.156(included in26.7and later)