Drop idle persistent agent sockets after fatal failures - #4748
Conversation
|
Thanks for the PR @bender6696 . We'll review it. |
|
The logic is clear, however the reason why this change is significant is not sounds clear. |
|
Thanks, fair point. I agree the PR needs a concrete reproducer rather than a speculative explanation. I'll prepare a small docker-compose scenario with a balancer + worker and a script that triggers the fatal agent path, then compare the behavior with and without the patch. Once I have that, I'll update the PR with the reproducer and results. |
|
|
Summary
Why
With distributed tables that use persistent remote agents (
conn=pconn), a fatal network/protocol failure can leave other idle sockets for the same remote host in the persistent pool. Those sockets may be stale or associated with the same broken remote state, and can be reused by later requests.On a fatal failure we already close the active socket. This change also drops idle sockets in the same persistent pool so the next request does not reuse potentially poisoned connections.
Changes
PersistentConnectionsPool_c::CloseIdleConnections()AgentConn_t::Fatal()for persistent agents before closing the failed socketChecks
git diff --check upstream/main..HEAD