Skip to content

Revert URL cancellation PRs to fix flaky 02270_errors_in_files_s3 - #104077

Merged
alexey-milovidov merged 2 commits into
ClickHouse:masterfrom
Algunenano:revert-url-cancel-flake
May 5, 2026
Merged

alexey-milovidov merged 2 commits into
ClickHouse:masterfrom
Algunenano:revert-url-cancel-flake

Conversation

@Algunenano

@Algunenano Algunenano commented May 5, 2026 •

Copy link
Copy Markdown
Member

Revert #102801 ("Improve canceling queries with url() function") and #104014
("Refactor canceling queries with url() function") because they introduced
flakiness in 02270_errors_in_files_s3 (and likely other tests using url()
with globs and max_threads > 1).

The added cancellation hook in ReadWriteBufferFromHTTP::doWithRetries races
with the parser-error path: when one source's parse exception triggers
pipeline cancellation, sibling sources can throw QUERY_WAS_CANCELLED
without the (in file/uri ...) annotation, so the original parse error and
its URL context are lost.

Failure rate jumped to ~1.5% across master and PR runs after #102801 was
merged on 2026-05-04, with 38 failures on 2026-05-04 and 19 on 2026-05-05
(vs. 0 in the prior month). First master-CI failure: commit b7c00c2.

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.5.1.282

@clickhouse-gh

clickhouse-gh Bot commented May 5, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [4cf703f]


AI Review

Summary

This PR reverts recent URL-query cancellation changes to stop flaky failures in 02270_errors_in_files_s3, but it also deletes an existing stateless cancellation test. Verdict: request changes until test coverage is preserved instead of removed.

Findings

❌ Blockers

  • [tests/queries/0_stateless/04078_kill_query_url_function.sh:4] Existing test coverage is removed. Even with a revert, this drops protection against future regressions in URL cancellation/error-propagation behavior.
    • Suggested fix: keep coverage by replacing this test with a deterministic regression test for the parser-error/cancellation race (instead of deleting the test entirely).
ClickHouse Rules
Item Status Notes
Deletion logging ➖
Serialization versioning ➖
Core-area scrutiny ✅
No test removal ❌ Existing stateless test 04078_kill_query_url_function.sh is deleted.
Experimental gate ➖
No magic constants ✅
Backward compatibility ✅
SettingsChangesHistory.cpp ➖
PR metadata quality ✅
Safe rollout ⚠️ Revert removes test guardrails for behavior that recently regressed/flaked.
Compilation time ✅
No large/binary files ✅
Final Verdict
  • Status: ⚠️ Request changes
  • Minimum required actions:
    1. Restore coverage by adding a deterministic stateless test for the URL cancellation/parser-error interaction instead of deleting 04078.

@clickhouse-gh clickhouse-gh Bot added the pr-ci label May 5, 2026
#!/usr/bin/env bash
# Tags: no-fasttest, no-sanitizers-lsan, long
# Test that KILL QUERY cancels HTTP requests in url() function early.
# Tests cancellation during both HEAD and GET phases, with different

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.

Removing an existing stateless test is risky here. Even if we're reverting the cancellation implementation, we should keep coverage by replacing this with a deterministic regression test for the parser-error path that caused flakiness, rather than dropping the test entirely.

ClickHouse review rule: do not delete or relax existing tests; add/adjust tests to cover the new intended behavior.

@murphy-4o murphy-4o self-assigned this May 5, 2026
@clickhouse-gh

clickhouse-gh Bot commented May 5, 2026

Copy link
Copy Markdown
Contributor

LLVM Coverage Report

Metric Baseline Current Δ
Lines 84.00% 83.70% -0.30%
Functions 91.10% 91.10% +0.00%
Branches 76.50% 76.00% -0.50%

Changed lines: 100.00% (31/31) | lost baseline coverage: 2 line(s) · Uncovered code

Full report · Diff report

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.

4 participants