Skip to content

ci: upload complete stacktraces (from i.e. hung check) into artifacts - #114143

Merged
azat merged 1 commit into
ClickHouse:masterfrom
azat:ci/hung-check-fix
Aug 11, 2026
Merged

azat merged 1 commit into
ClickHouse:masterfrom
azat:ci/hung-check-fix

Conversation

@azat

@azat azat commented Aug 10, 2026 •

Copy link
Copy Markdown
Member

Otherwise it is hard to debug

Example: https://s3.amazonaws.com/clickhouse-test-reports/PRs/114127/6fe5a48b7b2a8285cb97fa3f081c07320d5d33ce/stress_test_amd_debug/hung_check.log

Changelog category (leave one):

  • Not for changelog (changelog entry is not required)

Version info

  • Merged into: 26.8.1.1194 (included in 26.8 and later)

@clickhouse-gh

clickhouse-gh Bot commented Aug 10, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [c57b5d8]

Summary: ❌

job_name test_name status info comment
Stress test (amd_tsan) FAIL
Hung check failed, possible deadlock found FAIL cidb
Stress test (arm_release) FAIL
Hung check failed, possible deadlock found FAIL cidb

AI Review

Summary

This PR makes the full sql_stacktraces.log / c_stacktraces.log dumps survive more CI paths by attaching them in functional tests, copying them out of stress.py, and preserving them across the upgrade-check cleanup. The hung-check timeout path is materially better, but the change still does not preserve a complete dump when the pre-stress smoke check itself times out, so the PR does not yet meet its own diagnostic contract.

Findings

⚠️ Majors

  • [ci/jobs/scripts/stress/stress.py:460, ci/jobs/scripts/stress/stress.py:546-566, ci/jobs/scripts/stress/stress.py:947-953] [dismissed by author -- https://github.com/ci: upload complete stacktraces (from i.e. hung check) into artifacts #114143#discussion_r3757330993] The new top-level finally broadens dump collection, but the smoke check still runs through subprocess.run(..., shell=True, timeout=180) with no dedicated session or orphan cleanup. A local repro leaves the timed-out child reparented to PID 1 after the shell dies, so a smoke-check timeout can still leave clickhouse-test writing sql_stacktraces.log / c_stacktraces.log while collect_stacktrace_dumps does the cross-mount shutil.move. In that case the uploaded artifact still loses the tail of the dump this PR is meant to preserve. Suggested fix: run the smoke check under Popen(..., start_new_session=True), kill and reap that process tree on timeout, and call clickhouse-test --cleanup (or otherwise wait for all remaining writers to exit) before collect_stacktrace_dumps.
Final Verdict

⚠️ Needs changes before merge: the smoke-check timeout path still violates the PR's promise to upload the complete stacktrace dump.

@clickhouse-gh clickhouse-gh Bot added the pr-not-for-changelog This PR should not be mentioned in the changelog label Aug 10, 2026
@azat
azat requested review from leshikus and maxknv August 10, 2026 11:50
@azat
azat force-pushed the ci/hung-check-fix branch from 1492bb4 to c4e6f58 Compare August 10, 2026 12:03
@azat azat changed the title ci: do not trim output of hung check (it makes it useless) ci: upload complete stacktraces (from i.e. hung check) into artifacts Aug 10, 2026
Comment thread ci/jobs/scripts/stress/stress.py Resolved
azat added a commit to azat/ClickHouse that referenced this pull request Aug 10, 2026
The 600s hard timeout raised TimeoutExpired before the move loop,
losing the dumps for exactly the hung-check failures being preserved.
Move the collection into a finally block.

Refs: ClickHouse#114143 (comment)

Co-Authored-By: Claude Fable 5 <[email protected]>
@azat

azat commented Aug 10, 2026

Copy link
Copy Markdown
Member Author

The stress tests failures caused by the test from #113772, but seems that it is due to IStorage hold somewhere else, then #113397 may help

@azat
azat enabled auto-merge August 10, 2026 19:38
@azat
azat disabled auto-merge August 10, 2026 19:38
azat added a commit to azat/ClickHouse that referenced this pull request Aug 10, 2026
subprocess.call(timeout=...) kills only the shell; a still-running
clickhouse-test survives reparented to PID 1 and keeps appending to
sql_stacktraces.log/c_stacktraces.log while the cross-mount copy+unlink
snapshots them, losing the tail of the dump.

Run the hung check in its own session and SIGKILL the process group on
timeout. Waiting for tee to hit EOF is the barrier: the pipe is
inherited as stdout/stderr by the whole tree, so EOF means every
potential writer has exited before the copy starts.

Verified with a standalone repro (shell + detached writer grandchild):
after killpg + tee EOF no group members remain and the log stops
growing.

Refs: ClickHouse#114143 (comment)

Co-Authored-By: Claude Fable 5 <[email protected]>
@azat
azat enabled auto-merge August 10, 2026 20:11

@leshikus leshikus left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Maybe I should add a common helper for logs instead of duplicating sql_stacktraces.log, c_stacktraces.log across all jobs. Also it makes sense to add some reasonable timeout to tee.wait() - this may speed up execution.

@azat
azat force-pushed the ci/hung-check-fix branch 2 times, most recently from 51cb3c6 to 33bf1ab Compare August 11, 2026 08:19
Comment thread ci/jobs/scripts/stress/stress.py Resolved
@azat
azat force-pushed the ci/hung-check-fix branch 2 times, most recently from 59a8a6b to 68e57c1 Compare August 11, 2026 10:51
Comment thread ci/jobs/scripts/stress/stress.py Resolved
…l tests

The full dumps (sql_stacktraces.log, c_stacktraces.log) land in the cwd
of clickhouse-test, which neither job uploads. Move them into the stress
output folder; attach as debug files in functional tests.

Refs: https://s3.amazonaws.com/clickhouse-test-reports/PRs/114127/6fe5a48b7b2a8285cb97fa3f081c07320d5d33ce/stress_test_amd_debug/hung_check.log
Related: ClickHouse#114127

Co-Authored-By: Claude Fable 5 <[email protected]>
@azat
azat force-pushed the ci/hung-check-fix branch from 68e57c1 to c57b5d8 Compare August 11, 2026 11:59
@azat
azat added this pull request to the merge queue Aug 11, 2026
Merged via the queue into ClickHouse:master with commit 51f3c8a Aug 11, 2026
178 of 181 checks passed
@azat
azat deleted the ci/hung-check-fix branch August 11, 2026 23:50
@robot-ch-test-poll4 robot-ch-test-poll4 added the pr-synced-to-cloud The PR is synced to the cloud repo label Aug 12, 2026
groeneai added a commit to groeneai/ClickHouse that referenced this pull request Aug 13, 2026
…races-on-hung-check-abort

Resolved one conflict in ci/jobs/functional_tests.py. Master gained an inline
attach of sql_stacktraces.log / c_stacktraces.log to debug_files (azat,
c57b5d8, ClickHouse#114143) at the same point where this branch attaches them via
collect_stacktrace_logs(). The two blocks resolve to an identical file set from
the same directory, so keeping both would attach each dump twice. Kept this
branch's helper, which is the tested form (ci/tests/test_print_stacktraces.py
pins the call count, the scanned directory and the attach position) and which
also clears stale dumps on TEST entry; dropped the duplicate inline block.

Master's own changes to the file are unaffected: allow_oversubscription,
attach_post_verdict_artifacts, the seaweedfs rename, the failure allowance and
the llvm-profdata-22 detection are all present.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr-not-for-changelog This PR should not be mentioned in the changelog pr-synced-to-cloud The PR is synced to the cloud repo

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants