[SERVER-13397] Report fopen errno in GridFS::storefile rather than using boost::filesystem Created: 28/Mar/14 Updated: 03/Sep/15 Resolved: 03/Sep/15 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Internal Code |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Improvement | Priority: | Major - P3 |
| Reporter: | Andrew Morrow (Inactive) | Assignee: | Andrew Morrow (Inactive) |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Backwards Compatibility: | Fully Compatible |
| Sprint: | Platform 9 (09/18/15) |
| Participants: |
| Description |
|
We currently use boost::filesystem to assert the existence of the file, but then use fopen to actually open the file. This is a bit silly: in principle you could race with the deletion of the file between the ::exists call and the fopen call, so the ::exists call is not sufficient. Second, fopen will fail if the file doesn't exist, so the boost check isn't really buying anything. If we made the error handling for fopen a little better so that it reported the errno string, we could drop the insufficient boost::filesystem check. |
| Comments |
| Comment by Andrew Morrow (Inactive) [ 03/Sep/15 ] |
|
The GridFS::storeFile function was removed in https://github.com/mongodb/mongo/commit/3aab6338926d1bba4c2d377360c40467516c927b |