[SERVER-50105] Coverity analysis defect 115661: Unchecked return value Created: 04/Aug/20  Updated: 29/Oct/23  Resolved: 13/Aug/20

Status: Closed
Project: Core Server
Component/s: Index Maintenance
Affects Version/s: None
Fix Version/s: 4.7.0

Type: Bug Priority: Major - P3
Reporter: Coverity Collector User Assignee: Benety Goh
Resolution: Fixed Votes: 0
Labels: coverity
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
is related to SERVER-46560 Make Abort index build logic determin... Closed
Backwards Compatibility: Fully Compatible
Operating System: ALL
Sprint: Execution Team 2020-08-24
Participants:

 Description   

Unchecked return value

If the function returns an error value, the error value may be mistaken for a normal value. Value returned from a function is not checked for errors before being used
/src/mongo/db/index_builds_coordinator.cpp:1315: CHECKED_RETURN 115661 Calling "abortIndexBuildByBuildUUID" without checking return value (as is done elsewhere 3 out of 4 times).



 Comments   
Comment by Githook User [ 13/Aug/20 ]

Author:

{'name': 'Benety Goh', 'email': 'benety@mongodb.com', 'username': 'benety'}

Message: SERVER-50105 check return value from IndexBuildsCoordinator::abortIndexBuildByBuildUUID()

Failing to abort an index build is not an error in these cases but will be logged for
informational purposes.

The only functional change is in the code for stopping index builds before rollback
where rollback will not attempt to restart the index build that we failed to abort.
Branch: master
https://github.com/mongodb/mongo/commit/39794a19f5e0d24260eea783db1312bd69077324

Comment by Benety Goh [ 07/Aug/20 ]

abortIndexBuildByBuildUUID() started returning a boolean in SERVER-46560.

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