Author ronaldoussoren
Recipients Giovanni Pizzi, ned.deily, ronaldoussoren
Date 2020-07-15.07:15:50
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
If it is reproducable in C this is likely a bug in macOS, and should be reported to them. 

I get the same behaviour as you with the test script, even if I add calls to fhandle.flush and os.fsync to force the content to stable storage.

Interestingly enough I sometimes get other behaviour that shouldn't happen:

Traceback (most recent call last):
  File "/Users/ronald/Downloads/concurrency-tests/", line 33, in <module>
OSError: [Errno 22] Invalid argument

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "concurrency-tests/", line 34, in <module>
OSError: [Errno 22] Invalid argument

This is with the change I wrote about earlier:

    except FileNotFoundError:
        print(i, ">> DELETED <<")
        # Recreate the file
        time.sleep(0.001) # Wait a bit
        with open(dest_fname, 'wb') as fhandle:

This shouldn't happen, "fhandle" is open at this point and hence the low-level file descriptor should still be valid.
Date User Action Args
2020-07-15 07:15:50ronaldoussorensetrecipients: + ronaldoussoren, ned.deily, Giovanni Pizzi
2020-07-15 07:15:50ronaldoussorensetmessageid: <>
2020-07-15 07:15:50ronaldoussorenlinkissue41291 messages
2020-07-15 07:15:50ronaldoussorencreate