Skip to content

Fix crash in WriteBufferFromHTTPServerResponse::onProgress() for async restore started via HTTP protocol - #92103

Merged
vitlibar merged 1 commit into
ClickHouse:masterfrom
vitlibar:fix-async-http-restore
Dec 16, 2025
Merged

vitlibar merged 1 commit into
ClickHouse:masterfrom
vitlibar:fix-async-http-restore

Conversation

@vitlibar

@vitlibar vitlibar commented Dec 13, 2025 •

Copy link
Copy Markdown
Member

Changelog category (leave one):

  • Not for changelog (changelog entry is not required)

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

Fix crash in WriteBufferFromHTTPServerResponse::onProgress() for async restore started via HTTP protocol.

See https://github.com/ClickHouse/clickhouse-private/issues/41937

Version info

  • Merged into: 25.12.1.564
  • Backported to: 25.8.17.14

for async restore started via HTTP protocol.
@clickhouse-gh

clickhouse-gh Bot commented Dec 13, 2025 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [f18c9ae]

Summary: ❌

job_name test_name status info comment
Stateless tests (arm_asan, targeted) failure
02973_backup_of_in_memory_compressed FAIL cidb
01459_manual_write_to_replicas_quorum_detach_attach FAIL cidb
Integration tests (arm_binary, distributed plan, 2/4) failure
test_peak_memory_usage/test.py::test_clickhouse_client_max_peak_memory_usage_distributed FAIL cidb
BuzzHouse (amd_debug) failure
Logical error: 'Inconsistent AST formatting in Subquery: the query: FAIL cidb

@clickhouse-gh clickhouse-gh Bot added the pr-not-for-changelog This PR should not be mentioned in the changelog label Dec 13, 2025
@vitlibar
vitlibar requested a review from Copilot December 13, 2025 21:21

Copilot AI left a comment

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.

Pull request overview

This PR fixes a crash in WriteBufferFromHTTPServerResponse::onProgress() that occurs when an async restore operation is initiated via HTTP protocol. The crash happens because progress callbacks from the original HTTP request context remain active even after the async restore query completes and continues executing in the background.

Key changes:

  • Clear progress callbacks in contexts used for database and table creation during restore operations
  • Add TODO comments noting the need to eliminate query_context usage in RestorerFromBackup

@vitlibar

Copy link
Copy Markdown
Member Author

A test is added here

@jkartseva jkartseva self-assigned this Dec 14, 2025

@jkartseva jkartseva left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks good.

@vitlibar

vitlibar commented Dec 16, 2025 •

Copy link
Copy Markdown
Member Author

@vitlibar
vitlibar enabled auto-merge December 16, 2025 16:35
@vitlibar
vitlibar added this pull request to the merge queue Dec 16, 2025
Merged via the queue into ClickHouse:master with commit 1ab6cd0 Dec 16, 2025
@vitlibar
vitlibar deleted the fix-async-http-restore branch December 16, 2025 16:48
@robot-clickhouse robot-clickhouse added the pr-synced-to-cloud The PR is synced to the cloud repo label Dec 16, 2025
@tavplubix tavplubix added the pr-must-backport Pull request should be backported intentionally. Use this label with great care! label Feb 9, 2026
@robot-clickhouse robot-clickhouse added the pr-must-backport-synced The `*-must-backport` labels are synced into the cloud Sync PR label Feb 9, 2026
robot-clickhouse added a commit that referenced this pull request Feb 9, 2026
…se::onProgress() for async restore started via HTTP protocol
robot-clickhouse added a commit that referenced this pull request Feb 9, 2026
…nse::onProgress() for async restore started via HTTP protocol
clickhouse-gh Bot added a commit that referenced this pull request Feb 9, 2026
Backport #92103 to 25.8: Fix crash in WriteBufferFromHTTPServerResponse::onProgress() for async restore started via HTTP protocol
@robot-clickhouse-ci-1 robot-clickhouse-ci-1 added the pr-backports-created Backport PRs are successfully created, it won't be processed by CI script anymore label Feb 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr-backports-created Backport PRs are successfully created, it won't be processed by CI script anymore pr-must-backport Pull request should be backported intentionally. Use this label with great care! pr-must-backport-synced The `*-must-backport` labels are synced into the cloud Sync PR pr-not-for-changelog This PR should not be mentioned in the changelog 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.

6 participants