[SERVER-20544] Coverity analysis defect 73709: Unchecked return value Created: 21/Sep/15  Updated: 07/Oct/15  Resolved: 29/Sep/15

Status: Closed
Project: Core Server
Component/s: Testing Infrastructure
Affects Version/s: None
Fix Version/s: 3.1.9

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

Backwards Compatibility: Fully Compatible
Operating System: ALL
Sprint: Platform A (10/09/15)
Participants:

 Description   

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

Defect 73709 (STATIC_C)
Checker CHECKED_RETURN (subcategory none)
File: /src/mongo/executor/network_interface_asio.cpp
Function mongo::executor::NetworkInterfaceASIO::startCommand(const mongo::executor::TaskExecutor::CallbackHandle &, const mongo::executor::RemoteCommandRequest &, const std::function<void (const mongo::StatusWith<mongo::executor::RemoteCommandResponse> &)> &)::[lambda(mongo::StatusWith<std::unique_ptr<mongo::executor::ConnectionPool::ConnectionInterface, mongo::executor::ConnectionPool::ConnectionHandleDeleter>>) (instance 1)]::operator ()(mongo::StatusWith<std::unique_ptr<mongo::executor::ConnectionPool::ConnectionInterface, mongo::executor::ConnectionPool::ConnectionHandleDeleter>>) const
/src/mongo/executor/network_interface_asio.cpp, line: 166
Calling "erase" without checking return value (as is done elsewhere 2 out of 3 times).

                    _inGetConnection.erase(cbHandle);



 Comments   
Comment by Githook User [ 29/Sep/15 ]

Author:

{u'username': u'amidvidy', u'name': u'Adam Midvidy', u'email': u'amidvidy@gmail.com'}

Message: SERVER-20544 prioritize reporting cancellation over reporting network error if we were canceled before we failed to get a connection from the pool
Branch: master
https://github.com/mongodb/mongo/commit/437fcb9c0d02779e1d7c7399953872f7d53dfacf

Generated at Thu Feb 08 03:54:32 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.