[SERVER-30101] Coverity analysis defect 101783: Unchecked return value Created: 12/Jul/17  Updated: 27/Oct/23  Resolved: 15/Jul/17

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

Type: Bug Priority: Major - P3
Reporter: Coverity Collector User Assignee: Judah Schvimer
Resolution: Works as Designed Votes: 0
Labels: coverity
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate
is duplicated by SERVER-35343 Coverity analysis defect 103593: Unch... Closed
Backwards Compatibility: Fully Compatible
Operating System: ALL
Participants:

 Description   

Value returned from a function is not checked for errors before being used

Defect 101783 (STATIC_C)
Checker CHECKED_RETURN (subcategory none)
File: /src/mongo/db/repl/sync_tail.cpp
Function mongo::repl::multiInitialSyncApply_noAbort(mongo::OperationContext *, std::vector<const mongo::repl::OplogEntry *, std::allocator<const mongo::repl::OplogEntry *>> *, mongo::repl::SyncTail *, mongo::AtomicWord<unsigned int> *)
/src/mongo/db/repl/sync_tail.cpp, line: 1192
Calling "fetchAndInsertMissingDocument" without checking return value (as is done elsewhere 2 out of 4 times).

                    st->fetchAndInsertMissingDocument(opCtx, entry.raw);



 Comments   
Comment by Eric Milkie [ 15/Jul/17 ]

Ignoring it sounds fine to me.

Comment by Judah Schvimer [ 14/Jul/17 ]

This is not a problem. The function returns a boolean indicating whether or not it found a document on the sync source. If it didn't, then we just assume the document will be deleted later in the oplog. We could check the return value and add a log line, make the function void, or just ignore this warning.

Generated at Thu Feb 08 04:22:41 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.