[SERVER-46045] Return false in shouldActivateFailCommandFailPoint if the command does not have a valid namespace Created: 07/Feb/20  Updated: 29/Oct/23  Resolved: 10/Feb/20

Status: Closed
Project: Core Server
Component/s: Sharding
Affects Version/s: None
Fix Version/s: 4.3.4

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

Issue Links:
Depends
Backwards Compatibility: Fully Compatible
Operating System: ALL
Sprint: Sharding 2020-02-24
Participants:
Linked BF Score: 6

 Description   

shouldActivateFailCommandFailPoint is a predicate function for FailPoint::executeIf so it should never throw an error. With the current code, the function could throw an exception if the invocation does not have a valid namespace. This line should be wrapped in a try/catch and if an exception is caught, the function should return false since we do not want to enable failCommand anyway in that case.



 Comments   
Comment by Githook User [ 10/Feb/20 ]

Author:

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

Message: SERVER-46045 Return false in shouldActivateFailCommandFailPoint if the command does not have a valid namespace
Branch: master
https://github.com/mongodb/mongo/commit/03afebeb32be04bc92ec205369922f318fc05a30

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