Skip to content

Unify requests to cidb, sleep on errors - #115436

Merged
Felixoid merged 1 commit into
masterfrom
cidb-sleep-on-error
Aug 20, 2026
Merged

Felixoid merged 1 commit into
masterfrom
cidb-sleep-on-error

Conversation

@Felixoid

@Felixoid Felixoid commented Aug 19, 2026 •

Copy link
Copy Markdown
Member

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):

Sleep progressively on errors in requests to CIDB; address issues with too-quick failures.

Example

[2026-08-19 10:17:30] WARNING: CIDB query failed (status 500) - Attempt 1
[2026-08-19 10:17:30] WARNING: CIDB query failed (status 500) - Attempt 2
[2026-08-19 10:17:30] WARNING: CIDB query failed (status 500) - Attempt 3
[2026-08-19 10:17:30] WARNING: CIDB query failed (status 500) - Attempt 4
[2026-08-19 10:17:30] WARNING: CIDB query failed (status 500) - Attempt 5

See the timestamps.


Workflow [PR]
Sync PR [sync-upstream/pr/115436]

Version info

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

@clickhouse-gh

clickhouse-gh Bot commented Aug 19, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [0e12cc5]

Summary: ✅


AI Review

Summary

This PR factors CIDB POST handling into _post_with_retries and adds exponential backoff for HTTP and transport failures. The refactor fixes the original fast-fail path for non-OK responses, but CIDB.check still drops one class of smoke-test error out of the retry loop, so workflow generation can still fail too quickly on transient intermediary responses.

Findings

⚠️ Majors

  • [ci/praktika/cidb.py:429] CIDB.check used to retry the full SELECT 1 validation loop. After moving payload == 1 below _post_with_retries, a transient 200 OK response with the wrong JSON payload now returns False immediately instead of backing off and retrying. With mocked responses [0, 1], the current code makes one request and fails, whereas the previous loop would succeed on the second attempt. Because _check_db gates workflow generation, a temporary proxy or auth JSON payload can still abort the run too quickly. Suggested fix: keep the payload validation inside the retry loop, or let _post_with_retries accept a response validator so check can retry semantic smoke-test failures too.
Tests
  • ⚠️ There is still no focused regression coverage for the smoke-test retry matrix: 5xx, 200 with non-JSON, and 200 with wrong JSON payload. A small mocked Python test around CIDB.check and _post_with_retries would prove the behavior this PR is trying to preserve.
Final Verdict

Changes required before merge.

@clickhouse-gh clickhouse-gh Bot added the pr-ci label Aug 19, 2026
@Felixoid
Felixoid requested review from leshikus and maxknv August 19, 2026 11:04
@Felixoid
Felixoid force-pushed the cidb-sleep-on-error branch 3 times, most recently from 3a9549f to 4a8f10d Compare August 19, 2026 11:09
Comment thread ci/praktika/cidb.py Resolved
@Felixoid
Felixoid force-pushed the cidb-sleep-on-error branch from 4a8f10d to c3681ac Compare August 19, 2026 11:25
Comment thread ci/praktika/cidb.py Resolved
@Felixoid
Felixoid force-pushed the cidb-sleep-on-error branch from c3681ac to 0e12cc5 Compare August 19, 2026 11:44
Comment thread ci/praktika/cidb.py
)

return False, error
if not payload == 1:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

CIDB.check used to retry the whole smoke-test validation loop, so even a transient 200 OK response with the wrong JSON payload got another attempt. After moving the payload == 1 check below _post_with_retries, that class of error now returns False immediately instead of backing off and retrying. With mocked responses [0, 1], the current code makes one request and fails, while the previous loop would succeed on the second attempt. Because _check_db gates workflow generation, a temporary proxy/auth JSON payload can still abort the run too quickly unless this validation stays inside the retry loop or _post_with_retries grows a response validator.

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.

we don't have any proxy there

Sounds safe enough

@clickhouse-gh

clickhouse-gh Bot commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

Build profile diff (arm_release)

Comparing 0e12cc5e4 with master 747e52eb5 (stripped binary size, per-symbol sizes and ThinLTO time; compile times per translation unit against the most recent warmup build that recompiled it).

✅ No significant changes.

Binary sizes
Binary Master PR Δ
programs/clickhouse-stripped 702.05 MiB 699.02 MiB -3.03 MiB (-0.43%)

Only the stripped binary is compared: the official master build keeps debug symbols while PR builds strip them, so the other binaries differ by construction.

Compile time of recompiled translation units

13 translation units recompiled, 62 s compile time in total, 13 of them have a recent master baseline.

Job report

@Felixoid
Felixoid added this pull request to the merge queue Aug 20, 2026
Merged via the queue into master with commit d36103a Aug 20, 2026
175 checks passed
@Felixoid
Felixoid deleted the cidb-sleep-on-error branch August 20, 2026 13:18
@robot-ch-test-poll4 robot-ch-test-poll4 added the pr-synced-to-cloud The PR is synced to the cloud repo label Aug 20, 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