Repository navigation
Make test_status_counts fail with the reload's own error when SYSTEM RELOAD DICTIONARY fails - #133141
Merged
alexey-milovidov merged 1 commit intoNov 20, 2026
Conversation
`metrics_during_load` ran `SYSTEM RELOAD DICTIONARY d_slow` in a `threading.Thread` and only joined it. A thread's exception reaches only `threading.excepthook`, so a failed reload before the poll saw the in-progress status was retried as a timing miss (ending in the misleading "the metrics were never computed while d_slow was LOADING"), and in the LOADED_AND_RELOADING check a failed reload kept the dictionary LOADED, so its sample was accepted and the test passed with only a thread warning. Run the reload through `ThreadPoolExecutor.submit` and call `future.result()` on both exits of the helper, the early return and after the sample, so a failed reload raises its own error before a sample is retried or accepted. `result()` waits like `join()`, and the executor's `shutdown(wait=True)` still waits for the reload when the main thread raises. Retries, assertions and the `d_fail` part are unchanged. Follow-up to ClickHouse#132816, as suggested in ClickHouse#132816 (comment) Co-Authored-By: Claude Opus 5.5 <[email protected]>
Collaborator
Author
Internal second-model review: adjudication log (click to expand)Pre-publication review by an independent model (engine: codex; 0 findings) plus my own review (1 nit).
Severity: ❌ blocker / Session id: cron:clickhouse-review-slot-10:20261120-025800 |
Contributor
|
Workflow [PR], commit [76b4203] Summary: ✅ AI ReviewSummaryReviewed #133141 at Final VerdictStatus: ✅ Approve |
Collaborator
Author
Pre-PR validation gate (click to expand)
Session id: cron:clickhouse-impl-slot-41:20261120-022300 |
alexey-milovidov
approved these changes
Nov 20, 2026
Merged
via the queue into
ClickHouse:master
with commit Nov 20, 2026
7b2deb3
576 of 578 checks passed
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.
Related: #132816
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Not required.
Description
Follow-up to #132816, as suggested in #132816 (comment).
metrics_during_loadintest_dictionary_asynchronous_metrics/test.py::test_status_countsranSYSTEM RELOAD DICTIONARY d_slowin athreading.Threadand only joined it. The thread's exception reached onlythreading.excepthook, so a failed reload was retried as a timing miss (ending in the misleadingthe metrics were never computed while d_slow was LOADING), and in theLOADED_AND_RELOADINGcheck the test passed with a thread warning, because a failed reload of a loaded dictionary keeps itLOADED.The reload now runs through
ThreadPoolExecutor.submit, andfuture.result()re-raises its exception before a sample is retried or accepted. Retries, assertions and thed_failpart are unchanged. Test-only change.Validation (local integration harness, debug build): with local-only mutations that make the reload fail, the old test fails with the timing message after 5 attempts, fails at a later unrelated assert, or passes with only a thread warning; the new one fails on the first attempt with the server's error (
Code: 60,36or395), in both checks and on both exits of the helper. Unmutated, 50/50 runs pass, each check on its first attempt.Workflow [PR]
Sync PR [sync-upstream/pr/133141]
Version info
26.12.1.15-master(included in26.12and later)