Skip to content

Backport #122222 to 26.3: Do not wait for the peer in TLS shutdown when a write is still pending - #122414

Merged
PedroTadim merged 2 commits into
26.3from
backport/26.3/122222
Sep 28, 2026
Merged

PedroTadim merged 2 commits into
26.3from
backport/26.3/122222

Conversation

@robot-clickhouse-ci-1

@robot-clickhouse-ci-1 robot-clickhouse-ci-1 commented Sep 26, 2026 •

Copy link
Copy Markdown
Contributor

Original pull-request #122222

This pull-request is a last step of an automated backporting.
Treat it as a standard pull-request: look at the checks and resolve conflicts.
Merge it only if you intend to backport changes to the target branch, otherwise just close it.

The PR source

The PR is created in the CI job

Version info

  • Merged into: 26.3.35.6

@robot-clickhouse-ci-1 robot-clickhouse-ci-1 added the pr-backport Changes, backported to release branch. Do not use manually - automated use only! label Sep 26, 2026
@clickhouse-gh

clickhouse-gh Bot commented Sep 26, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [BackportPR], commit [23e86fa]

Summary: ✅

@groeneai

Copy link
Copy Markdown
Collaborator

The build fails only in unit_tests_dbms: the new tests in src/Common/tests/gtest_ssl_send_timeout.cpp call EphemeralCert::makeContext and SecureStreamSocketImpl::ssl(), which 26.3 does not have. The Poco part of the backport builds as is.

The fix is one commit on top of this PR's head a730c74e96e1, touching only that test file: b47ed0471b49. It uses the file's own 26.3 helper makeContext(cert, usage), and drops the three checks that read the SSL object, because 26.3 has no accessor for it. The two checks that fail without the Poco change (shutdown() does not throw and returns within 2 s) are unchanged.

Checked on 26.3 with this commit (clang-21, Debug, unit_tests_dbms): without the Poco change, shutdown() in both new tests blocks for 10009 ms and throws Poco::TimeoutException; with it all four SSLSocketTimeout.* tests pass, and the two new ones passed 25 of 25 repeated runs each, every run under 1 s.

I cannot push to this repository, so to apply it:

git fetch https://github.com/groeneai/ClickHouse fix-26.3-backport-122222-gtest
git push origin FETCH_HEAD:backport/26.3/122222

The test came from master, which has two things 26.3 does not:
`EphemeralCert::makeContext` as a member (26.3 keeps the free function
`makeContext(cert, usage)`), and the `ssl()` accessor on
`Poco::Net::SecureStreamSocketImpl`.

Adapt the two call sites to the free function, and backport the `ssl()`
accessors from master rather than drop the assertions that use them:
`SSL_want_write` pins that the read replaced the reported SSL state while
the write stayed pending, and `SSL_SENT_SHUTDOWN` keeps skipping the
orderly shutdown from passing the test.

CI report:
https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=122414&sha=a730c74e96e12c6d0e438438a4c62f4b1ccc4883&name_0=BackportPR&name_1=Build%20%28amd_debug%29
Related: #122414

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr-backport Changes, backported to release branch. Do not use manually - automated use only!

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants