Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-13397

Report fopen errno in GridFS::storefile rather than using boost::filesystem

    XMLWordPrintableJSON

Details

    • Icon: Improvement Improvement
    • Resolution: Done
    • Icon: Major - P3 Major - P3
    • None
    • None
    • Internal Code
    • None
    • Fully Compatible
    • Platform 9 (09/18/15)

    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.

      Attachments

        Activity

          People

            andrew.morrow@mongodb.com Andrew Morrow (Inactive)
            andrew.morrow@mongodb.com Andrew Morrow (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: