diff options
| author | Konstantin Khlebnikov <[email protected]> | 2026-05-13 11:33:44 +0300 |
|---|---|---|
| committer | robot-piglet <[email protected]> | 2026-05-13 11:57:29 +0300 |
| commit | 350f075730f27c4e6c66bc44f2ecb85188a15bfd (patch) | |
| tree | b85fa1ffc7b478feea0aef4a9d8fd761fedd255e /library/cpp/cppparser | |
| parent | a4220a688a661e2d61a0ff8007ce454fcc9cd16c (diff) | |
yt/yt/core/http: throw TransportError at reusing stale connection
Root Cause: A classic race condition in yt/yt/core/http/connection_pool.cpp.
When the client extracts a connection from the pool:
TConnectionPool::Connect() calls CheckPooledConnection() → IsValid() → Connection->IsIdle()
IsIdle() checks !PeerDisconnectedList_.IsFired() — but this is asynchronous and
depends on the poller detecting the peer's TCP FIN. There's a window where
the server has already sent FIN to close the connection, but the poller
hasn't processed it yet. The connection appears valid, but when the client
writes the request and tries to read the response, it gets immediate EOF.
This triggers: "Connection was closed before the first byte of HTTP message".
Proper fix should be retrying request using different connection when
connection was taken from the pool and requires is safe to retry.
For example this logic is implemented inside golang http client.
Here we could simply throw error code NRpc::EErrorCode::TransportError.
And as a result request will be retried by high-level retrying logic
in yt/cpp/mapreduce/common/retry_lib.cpp
Link: https://github.com/ytsaurus/ytsaurus/issues/1691
Signed-off-by: Konstantin Khlebnikov <[email protected]>
---
* Changelog entry
Type: fix
Component: cpp-sdk
Handle error and retry request if HTTP(s) connection picked from pool is stale.
---
Pull Request resolved: https://github.com/ytsaurus/ytsaurus/pull/1692
commit_hash:8e5157c3b050007fd27d637e2ba64d8aa46a8881
Diffstat (limited to 'library/cpp/cppparser')
0 files changed, 0 insertions, 0 deletions
