Skip to content

Allow repeated settings in the hung check's server stack dump - #113391

Closed
alexey-milovidov wants to merge 2 commits into
masterfrom
fix-hung-check-stack-dump-repeated-settings
Closed

alexey-milovidov wants to merge 2 commits into
masterfrom
fix-hung-check-stack-dump-repeated-settings

Conversation

@alexey-milovidov

Copy link
Copy Markdown
Member

Changelog category (leave one):

  • CI Fix or improvement (changelog entry is not required)

In the stress test's hung check, the system.stack_trace all-threads dump is built from get_additional_client_options, which concatenates CLICKHOUSE_CLIENT_OPT with the --client-option values — and in that job both carry the same settings (max_untracked_memory, max_memory_usage_for_user, memory_profiler_step, ast_fuzzer_runs). The client then refuses to start with Bad arguments: option '--max_untracked_memory' cannot be specified more than once, and the stack dump is lost exactly when it is needed to find the thread that holds a lock. The regular test-runner path already appends --allow_repeated_settings for the same reason (see add_effective_settings in tests/clickhouse-test); do it in get_stacktraces_from_clickhouse as well.

Observed in this Stress test (amd_debug) report: hung_check.log shows 74 queries waiting on the DatabaseFilesystem mutex, and the dump that would show the holder failed with the error above.

Related: #111990

In the stress test's hung check, `get_stacktraces_from_clickhouse` builds the
client command from `get_additional_client_options`, which concatenates
`CLICKHOUSE_CLIENT_OPT` with the `--client-option` values - and in that job both
carry the same settings (`max_untracked_memory`, `max_memory_usage_for_user`,
`memory_profiler_step`, `ast_fuzzer_runs`). The client then fails with `Bad
arguments: option '--max_untracked_memory' cannot be specified more than once`
and the `system.stack_trace` dump is lost exactly when it is needed to find the
thread that holds a lock. The regular test-runner path already appends
`--allow_repeated_settings` for the same reason; do it here as well.

Observed in https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=111990&sha=4a7da581fa41048c63b20cc7df609a5676bfede8&name_0=PR&name_1=Stress%20test%20%28amd_debug%29
(`hung_check.log`: 74 queries waiting on the `DatabaseFilesystem` mutex, and the
all-threads dump that would show the holder failed with the error above).
@clickhouse-gh

clickhouse-gh Bot commented Aug 4, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [3e385a1]

Summary: ✅


AI Review

Summary

This PR adds --allow_repeated_settings to the system.stack_trace client invocation in get_stacktraces_from_clickhouse, matching the existing runner behavior when CLICKHOUSE_CLIENT_OPT and --client-option inject the same settings. I did not find a remaining correctness issue in the merged code: the flag is parsed as a standalone client switch, the change is scoped to the failing hung-check path, and current Praktika CI is green.

Missing context / blind spots
  • ⚠️ There is no focused regression test that deterministically exercises the duplicated-settings hung-check path, so validation here is by code inspection plus green CI rather than by a reproducer that would fail without the patch.
Final Verdict

No material findings. The change looks correct to merge.

@clickhouse-gh clickhouse-gh Bot added the pr-ci label Aug 4, 2026
@alexey-milovidov

Copy link
Copy Markdown
Member Author

🕵 The Stress test (arm_asan_ubsan, s3) failure (Logical error: '!database_name.empty()' in StorageMerge from a background mutation thread, plus the consequent Cannot start clickhouse-server) is unrelated to this PR — this PR only touches the hung check's stack dump command in tests/clickhouse-test. It is the known bug where the merge table function used in a mutation resolves an empty database in the background thread; the fix is in progress in #113185. Merged master to freshen the branch.

@alexey-milovidov alexey-milovidov left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

LGTM

@alexey-milovidov alexey-milovidov self-assigned this Aug 5, 2026
@alexey-milovidov

Copy link
Copy Markdown
Member Author

Already merged in another PR.

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant