Skip to content

Cherry pick #92807 to 25.8: Fix crash when receiving from disconnected Connection#92983

Merged
robot-ch-test-poll2 merged 7 commits intobackport/25.8/92807from
cherrypick/25.8/92807
Dec 24, 2025
Merged

Cherry pick #92807 to 25.8: Fix crash when receiving from disconnected Connection#92983
robot-ch-test-poll2 merged 7 commits intobackport/25.8/92807from
cherrypick/25.8/92807

Conversation

@robot-ch-test-poll2
Copy link
Copy Markdown
Contributor

Original pull-request #92807

Do not merge this PR manually

This pull-request is a first step of an automated backporting.
It contains changes similar to calling git cherry-pick locally.
If you intend to continue backporting the changes, then resolve all conflicts if any.
Otherwise, if you do not want to backport them, then just close this pull-request.

The check results does not matter at this step - you can safely ignore them.

Troubleshooting

If the conflicts were resolved in a wrong way

If this cherry-pick PR is completely screwed by a wrong conflicts resolution, and you want to recreate it:

  • delete the pr-cherrypick label from the PR
  • delete this branch from the repository

You also need to check the Original pull-request for pr-backports-created label, and delete if it's presented there

The PR source

The PR is created in the CI job

rienath and others added 7 commits December 22, 2025 17:16
It is possible that RemoteSource will finish() query multiple times,
while the exception will be suppressed by the PipelineExecutor

First finish():

    2025-12-21 15:32:06.673840      Debug   2236    ReadBuffer      ReadBuffer is canceled by the exception: Code: 209. DB::NetException: Timeout exceeded while reading from socket (peer: 10.49.85.26:9000, local: 10.49.18.205:49572, 300000 ms). (SOCKET_TIMEOUT), Stack trace (when copying this message, always include the lines below):

    0. ./ci/tmp/build/./src/Common/Exception.cpp:131: DB::Exception::Exception(DB::Exception::MessageMasked&&, int, bool) @ 0x0000000010ff8d70
    1. DB::Exception::Exception(String&&, int, String, bool) @ 0x000000000baa45d8
    2. ./src/Common/NetException.h:26: DB::NetException::NetException<String, String, long>(int, FormatStringHelperImpl<std::type_identity<String>::type, std::type_identity<String>::type, std::type_identity<long>::type>, String&&, String&&, long&&) @ 0x00000000111e84ac
    3. ./ci/tmp/build/./src/IO/ReadBufferFromPocoSocket.cpp:87: DB::ReadBufferFromPocoSocketBase::socketReceiveBytesImpl(char*, unsigned long) @ 0x00000000111e8094
    4. ./ci/tmp/build/./src/IO/ReadBufferFromPocoSocket.cpp:107: DB::ReadBufferFromPocoSocketBase::nextImpl() @ 0x00000000111e876c
    5. ./ci/tmp/build/./src/IO/ReadBuffer.cpp:96: DB::ReadBuffer::next() @ 0x00000000110c4774
    6. ./src/IO/ReadBuffer.h:81: DB::Connection::receivePacket() @ 0x0000000016e00200
    7. ./ci/tmp/build/./src/Client/MultiplexedConnections.cpp:398: DB::MultiplexedConnections::receivePacketUnlocked(std::function<void (int, Poco::Timespan, DB::AsyncEventTimeoutType, String const&, unsigned int)>) @ 0x0000000016e4090c
    8. ./ci/tmp/build/./src/Client/MultiplexedConnections.cpp:253: DB::MultiplexedConnections::receivePacket() @ 0x0000000016e406c4
    9. ./ci/tmp/build/./src/QueryPipeline/RemoteQueryExecutor.cpp:808: DB::RemoteQueryExecutor::finish() @ 0x0000000014571abc
    10. ./ci/tmp/build/./src/Processors/Executors/ExecutingGraph.cpp:253: DB::ExecutingGraph::updateNode(unsigned long, std::queue<DB::ExecutingGraph::Node*, std::deque<DB::ExecutingGraph::Node*, AllocatorWithMemoryTracking<DB::ExecutingGraph::Node*>>>&, std::queue<DB::ExecutingGraph::Node*, std::deque<DB::ExecutingGraph::Node*, AllocatorWithMemoryTracking<DB::ExecutingGraph::Node*>>>&) @ 0x00000000170a97ec

Second finish():

    2.1. inlined from ./src/IO/VarInt.h:98: DB::readVarUInt(unsigned long&, DB::ReadBuffer&)
    2. ./ci/tmp/build/./src/Client/Connection.cpp:1310: DB::Connection::receivePacket() @ 0x0000000016e000b9
    3. ./ci/tmp/build/./src/Client/MultiplexedConnections.cpp:398: DB::MultiplexedConnections::receivePacketUnlocked(std::function<void (int, Poco::Timespan, DB::AsyncEventTimeoutType, String const&, unsigned int)>) @ 0x0000000016e4090c
    4. ./ci/tmp/build/./src/Client/MultiplexedConnections.cpp:253: DB::MultiplexedConnections::receivePacket() @ 0x0000000016e406c4
    5. ./ci/tmp/build/./src/QueryPipeline/RemoteQueryExecutor.cpp:808: DB::RemoteQueryExecutor::finish() @ 0x0000000014571abc
    6. ./ci/tmp/build/./src/Processors/Sources/RemoteSource.cpp:216: DB::RemoteSource::tryGenerate() @ 0x0000000017417ea8
    7. ./ci/tmp/build/./src/Processors/ISource.cpp:110: DB::ISource::work() @ 0x0000000017096e80
    8.0. inlined from ./ci/tmp/build/./src/Processors/Executors/ExecutionThreadContext.cpp:53: DB::executeJob(DB::ExecutingGraph::Node*, DB::ReadProgressCallback*)
Fix crash when receiving from disconnected `Connection`
@robot-ch-test-poll2 robot-ch-test-poll2 added pr-cherrypick Cherry-pick of merge-commit before backporting. Do not use manually - automated use only! do not test disable testing on pull request pr-bugfix Pull request with bugfix, not backported by default labels Dec 24, 2025
@robot-ch-test-poll2 robot-ch-test-poll2 merged commit f023521 into backport/25.8/92807 Dec 24, 2025
26 of 27 checks passed
@robot-ch-test-poll2 robot-ch-test-poll2 deleted the cherrypick/25.8/92807 branch December 24, 2025 11:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

do not test disable testing on pull request pr-bugfix Pull request with bugfix, not backported by default pr-cherrypick Cherry-pick of merge-commit before backporting. Do not use manually - automated use only!

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants