[SERVER-44775] Make FailPoint::pauseWhileSet increment _timesEntered once Created: 21/Nov/19  Updated: 29/Oct/23  Resolved: 03/Dec/19

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

Type: Bug Priority: Major - P3
Reporter: Cheahuychou Mao Assignee: Cheahuychou Mao
Resolution: Fixed Votes: 1
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Backports
Duplicate
is duplicated by SERVER-44829 FailPoint::pauseWhileSet should incre... Closed
Related
related to SERVER-48171 replace OperationContext with Interru... Closed
Backwards Compatibility: Fully Compatible
Operating System: ALL
Backport Requested:
v4.2
Sprint: Sharding 2019-12-02, Sharding 2019-12-16
Participants:

 Description   

SERVER-44666 was done with the misconception that calling pauseWhileSet should not count as entering a fail point because this pattern shows up widely in the codebase:

 

if (failPoint.shouldFail()) {    
 LOG(0) << "log line that used to be used for checkLog";     
 failPoint.pauseWhileSet(); 
}

 

However, the intended use of the function is for entering and waiting for a fail point to be disabled. Therefore, it should be made to increment _timesEntered once. Also, the tests that wait for additional times entered > 1 should be reverted to use checkLog.

Note: I also discovered that there is code all over that uses combinations of shouldFail, pauseWhileSet, executeIf, and execute when entering a fail point. This implies that prior to SERVER-44666 and even SERVER-39165, for the fail points that are entered that way, the times and skip mode in the configureFailPoint command did not have the correct behavior because we always overcounted the number of times entered and returned early. 
 
 



 Comments   
Comment by Githook User [ 10/Dec/19 ]

Author:

{'name': 'Cheahuychou Mao', 'username': 'cheahuychou', 'email': 'cheahuychou.mao@mongodb.com'}

Message: SERVER-44775 Make pauseWhileSet increment _timesEntered once

(cherry picked from commit 966d9b880ad80b6d126f5bb4ad777312562cd93e)
Branch: v4.2
https://github.com/mongodb/mongo/commit/a5a12709b4ed00d9cdb579da3b2ce03ad6fb6fb4

Comment by Githook User [ 03/Dec/19 ]

Author:

{'name': 'Cheahuychou Mao', 'username': 'cheahuychou', 'email': 'cheahuychou.mao@mongodb.com'}

Message: SERVER-44775 Make pauseWhileSet increment _timesEntered once
Branch: master
https://github.com/mongodb/mongo/commit/966d9b880ad80b6d126f5bb4ad777312562cd93e

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