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

File/folder may be locked for delete on Windows

    • Type: Icon: Bug Bug
    • Resolution: Won't Fix
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: 5.1 Required
    • Component/s: Concurrency
    • Labels:
    • ALL
    • Security 2021-09-06
    • 40

      Windows may not allow for immediate file deletion thus causing an exception. An example of this is in BF-13075 and BFG-858391. Specific error is in src/mongo/shell/shell_utils_launcher.cpp in ResetDbpath, where Windows exceptions are handled by sleep followed by retry. This method reduces number of failures, but does not fully eliminate them

      Per https://docs.microsoft.com/en-us/windows/win32/fileio/closing-and-deleting-files , there is an alternative way of deleting an object: it has to be renamed and then a DeleteFile function invoked ("The DeleteFile function marks a file for deletion on close"). This would produce an empty directory, and the old one would be eventually gone

      Before starting work on this ticket, need to determine if this could be done using standard c++ or boost, whithout expressly invoking win32 functionality.

            Assignee:
            sergey.galtsev@mongodb.com Sergey Galtsev (Inactive)
            Reporter:
            sergey.galtsev@mongodb.com Sergey Galtsev (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: