Skip to content

Add timeout to SYSTEM STOP DISTRIBUTED SENDS in stop_server - #102149

Merged
alexey-milovidov merged 2 commits into
masterfrom
fix-stop-server-distributed-sends-timeout
Apr 9, 2026
Merged

alexey-milovidov merged 2 commits into
masterfrom
fix-stop-server-distributed-sends-timeout

Conversation

@alexey-milovidov

@alexey-milovidov alexey-milovidov commented Apr 8, 2026 •

Copy link
Copy Markdown
Member

The stop_server function in stress_tests.lib retries SYSTEM STOP DISTRIBUTED SENDS up to 30 times before calling clickhouse stop. When the server is unresponsive (e.g. after a stress test under TSan), each attempt waits for the default receive_timeout of 300 seconds. This means the loop burns 30 × 300 = 9000 seconds (2.5 hours) before proceeding to actually stop the server, consuming the entire CI job timeout and preventing any diagnostics (gdb stack traces, log collection, etc.).

Add --receive_timeout=10 so each attempt fails within 10 seconds when the server is unresponsive. Worst case the loop now takes 300 seconds instead of 9000.

Found in: https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=102011&sha=8ed7fb8bcfdac4af8d2a062200b104281178981b&name_0=PR&name_1=Stress%20test%20%28arm_tsan%29

Changelog category (leave one):

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

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

...

Documentation entry for user-facing changes

  • Documentation is written (mandatory for new features)

Version info

  • Merged into: 26.4.1.734

The `stop_server` function retries `SYSTEM STOP DISTRIBUTED SENDS` up
to 30 times before calling `clickhouse stop`. When the server is
unresponsive (e.g. after a stress test), each attempt waits for the
default `receive_timeout` of 300 seconds. This means the loop can burn
30 × 300 = 9000 seconds (2.5 hours) before proceeding to actually stop
the server, consuming the entire CI job timeout.

Add `--receive_timeout=10` so each attempt fails within 10 seconds
when the server is unresponsive. Worst case the loop now takes
30 × 10 = 300 seconds instead of 9000.

Found in: https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=102011&sha=8ed7fb8bcfdac4af8d2a062200b104281178981b&name_0=PR&name_1=Stress%20test%20%28arm_tsan%29
PR: #102011

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
@clickhouse-gh

clickhouse-gh Bot commented Apr 8, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [646782f]

Summary: ✅


AI Review

Summary

This PR updates stop_server in tests/docker_scripts/stress_tests.lib to run SYSTEM STOP DISTRIBUTED SENDS with --receive_timeout=10, preventing excessively long waits when the server is unresponsive during stress-test shutdown. The change is narrowly scoped, aligns with the stated CI-failure motivation, and appears safe for rollout.

ClickHouse Rules
Item Status Notes
Deletion logging ➖
Serialization versioning ➖
Core-area scrutiny ✅
No test removal ✅
Experimental gate ➖
No magic constants ✅
Backward compatibility ✅
SettingsChangesHistory.cpp ➖
PR metadata quality ✅
Safe rollout ✅
Compilation time ✅
No large/binary files ✅
Final Verdict
  • Status: ✅ Approve

@clickhouse-gh clickhouse-gh Bot added the pr-ci label Apr 8, 2026
@alexey-milovidov

Copy link
Copy Markdown
Member Author

The MSan stress test failure (MemorySanitizer: use-of-uninitialized-value, STID 4179-5154 or 4148-3044) is a known pre-existing issue unrelated to this PR. Fix: #102158

@Algunenano Algunenano self-assigned this Apr 9, 2026
@alexey-milovidov
alexey-milovidov added this pull request to the merge queue Apr 9, 2026
Merged via the queue into master with commit 8cfaca4 Apr 9, 2026
164 checks passed
@alexey-milovidov
alexey-milovidov deleted the fix-stop-server-distributed-sends-timeout branch April 9, 2026 18:16
@robot-ch-test-poll2 robot-ch-test-poll2 added the pr-synced-to-cloud The PR is synced to the cloud repo label Apr 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr-ci 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