[DRIVERS-390] Call "ping" on a socket that has been idle for socketCheckIntervalMS Created: 14/Jun/17  Updated: 28/Oct/23  Resolved: 13/Nov/18

Status: Closed
Project: Drivers
Component/s: None
Fix Version/s: None

Type: Bug Priority: Minor - P4
Reporter: A. Jesse Jiryu Davis Assignee: Unassigned
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
depends on GODRIVER-631 Call "ping" on a socket that has been... Closed
depends on NODE-1755 Call "ping" on a socket that has been... Closed
depends on PHPC-1296 Call "ping" on a socket that has been... Closed
is depended on by CDRIVER-2172 Call "ping" on a socket that has been... Closed
Driver Compliance:
Key Status/Resolution FixVersion
PERL-785 Fixed 2.1.0
NODE-1755 Won't Fix
PHPC-1296 Works as Designed
GODRIVER-631 Done No Release

 Description   

Change to specification for single-threaded clients and the meaning of socketCheckIntervalMS.

Before, single-threaded drivers were required to call "ismaster" on a socket that's been idle for socketCheckIntervalMS before using the socket. It was not clear what the driver should do with the ismaster response, or what it should do if ismaster failed.

Instead, what the driver should do is re-check an idle socket right after server selection. If a server is selected that has an existing connection that's been idle for 5 seconds, the driver should attempt to call "ping", not ismaster, since we're not trying to update the topology. If "ping" succeeds, use the socket. If it failed, set the server's type to Unknown and re-enter server selection once, re-discovering the topology if needed (as SDAM already specifies), then proceed from there.



 Comments   
Comment by A. Jesse Jiryu Davis [ 14/Jun/17 ]

I've marked most of the drivers "validated" if they're not single-threaded. I'll do the libmongoc update and the drivers that use libmongoc (in non-pooled mode) will get the fix for free when they upgrade. Perl definitely needs changes.

I don't know if the socketCheckIntervalMS spec applies to mgo or Node driver.

Generated at Thu Feb 08 08:21:24 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.