[SERVER-38196] Coverity analysis defect 105128: Unchecked return value Created: 17/Nov/18 Updated: 29/Oct/23 Resolved: 07/Dec/18 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Sharding |
| Affects Version/s: | None |
| Fix Version/s: | 3.6.10, 4.0.6, 4.1.7 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Coverity Collector User | Assignee: | Misha Tyulenev |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | coverity, neweng, sharding-wfbf-day | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||
| Backwards Compatibility: | Fully Compatible | ||||
| Operating System: | ALL | ||||
| Backport Requested: |
v4.0, v3.6
|
||||
| Sprint: | Sharding 2018-12-17 | ||||
| Participants: | |||||
| Description |
|
Value returned from a function is not checked for errors before being used Defect 105128 (STATIC_C)
|
| Comments |
| Comment by Githook User [ 27/Dec/18 ] |
|
Author: {'username': 'mikety', 'email': 'misha@mongodb.com', 'name': 'Misha Tyulenev'}Message: (cherry picked from commit ae54786e2830073387673b4c0ea921559065ed5f) |
| Comment by Githook User [ 27/Dec/18 ] |
|
Author: {'username': 'mikety', 'email': 'misha@mongodb.com', 'name': 'Misha Tyulenev'}Message: |
| Comment by Githook User [ 07/Dec/18 ] |
|
Author: {'name': 'Misha Tyulenev', 'email': 'misha@mongodb.com', 'username': 'mikety'}Message: |
| Comment by Kaloian Manassiev [ 03/Dec/18 ] |
|
I don't think we can return because in cases where the batch doesn't result in actual writes, it would skip fetching the next batch of mods from the donor. However I think you can just continue; because _applyMigrateOp would be equivalent to lastOpApplied not changing and that would get continued here anyways. Overall though, I don't think there is much benefit to that so you could just ignore the result of this function. |
| Comment by Misha Tyulenev [ 03/Dec/18 ] |
|
kaloian.manassiev should the MigrationDestinationDriver return here if _applyMigrateOp returns false - i.e. nothing is applied? |