[SERVER-77195] executor::ConnectionPool should appropriately handle the case where a connection is returned with a network error Created: 16/May/23  Updated: 29/Oct/23  Resolved: 15/Jun/23

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 7.1.0-rc0, 6.0.7, 7.0.0-rc4

Type: Improvement Priority: Major - P3
Reporter: George Wangensteen Assignee: George Wangensteen
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Backports
Assigned Teams:
Service Arch
Backwards Compatibility: Fully Compatible
Backport Requested:
v7.0, v6.0
Sprint: Service Arch 2023-06-12, Service Arch 2023-06-26
Participants:

 Description   

Essentially, we need to address this TODO: https://github.com/mongodb/mongo/blob/744678da09dcab9885ae6af3e368864387fbfb82/src/mongo/executor/connection_pool.cpp#L1013 

Currently, when a connection is checked out from the pool and is returned with failure indicated, we discard that individual connection. However, we don't examine the failure in any way, and don't drop other connections to the same host (and bump the SpecificPool generation appropriately) if the failure is a Network error or other error that leads us to believe that the host is down and current-generation connections are likely to be unhealthy. 

This is distinct from the behavior in the case where we  observe a network-error on a connection during the refresh process; in this case, we treat the host as down, bump the generation of the SpecificPool to that host, and drop other connections to that host. The cases of a network error on a returned connection vs. one that has finished refreshing are very similar and should probably be treated in the same manner. 



 Comments   
Comment by Githook User [ 15/Jun/23 ]

Author:

{'name': 'George Wangensteen', 'email': 'george.wangensteen@mongodb.com', 'username': 'gewa24'}

Message: SERVER-77195 Make executor::ConnectionPool close current generation connections to a remote when a connection to that remote is returned with a network error (cherry picked from commit 085eb1f4d5aba0414df96071084aa0d0620ba153)
Branch: v6.0
https://github.com/mongodb/mongo/commit/2cfe1350443e89c12a7e345130d90de7bd318ab2

Comment by Githook User [ 14/Jun/23 ]

Author:

{'name': 'George Wangensteen', 'email': 'george.wangensteen@mongodb.com', 'username': 'gewa24'}

Message: SERVER-77195 Make executor::ConnectionPool close current generation connections to a remote when a connection to that remote is returned with a network error

(cherry picked from commit 085eb1f4d5aba0414df96071084aa0d0620ba153)
Branch: v7.0
https://github.com/mongodb/mongo/commit/3f389bf74e17e99076945d8590443418acbdadf2

Comment by Githook User [ 13/Jun/23 ]

Author:

{'name': 'George Wangensteen', 'email': 'george.wangensteen@mongodb.com', 'username': 'gewa24'}

Message: SERVER-77195 Make executor::ConnectionPool close current generation connections to a remote when a connection to that remote is returned with a network error
Branch: master
https://github.com/mongodb/mongo/commit/085eb1f4d5aba0414df96071084aa0d0620ba153

Generated at Thu Feb 08 06:34:47 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.