[SERVER-42922] failCommand + closeConnection can dereference a null session pointer Created: 20/Aug/19  Updated: 09/Oct/19  Resolved: 09/Oct/19

Status: Closed
Project: Core Server
Component/s: Internal Client, Internal Code, Networking
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: Daniel Gottlieb (Inactive) Assignee: Mira Carey
Resolution: Duplicate Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
is depended on by PYTHON-1948 Test retryable reads on MMAPv1 Backlog
Duplicate
duplicates SERVER-43079 failpoint triggered by LogicalSession... Closed
is duplicated by SERVER-42711 PyMongo's retryable reads spec tests ... Closed
Operating System: ALL
Steps To Reproduce:
  1. Initialize a replica set with test commands enabled
  2. db.adminCommand({configureFailPoint: "failCommand", mode: "alwaysOn", data: {failCommands: ["find"], closeConnection: true}})
  3. Wait for the HMAC monitoring periodic runner to execute (or issue a shutdown, which has the same effect)
Sprint: Service Arch 2019-10-21
Participants:

 Description   

The conditions evaluated to reach this line are not sufficient to guarantee the session object exists on the client (note the type definition: using SessionHandle = std::shared_ptr<Session>;).

Notably, the session may be null when using DBDirectClient such as inside the KeysCollectionClientDirect.



 Comments   
Comment by Mira Carey [ 09/Oct/19 ]

The fix in SERVER-43079 also covers this use case. As it avoids triggering the fail point for clients without transport sessions

Comment by Daniel Gottlieb (Inactive) [ 20/Aug/19 ]

Note that drivers use this failpoint extensively for testing. Their testing hits this on 4.0, though the reproducer will fire on master.

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