Hallvard Breien Furuseth wrote:
On 05/19/2014 05:55 PM, Howard Chu wrote:
Hallvard Breien Furuseth wrote:
Right... Though I can think of one non-kernel possibility:
Previous process wrote something and got killed - maybe while fsyncing the changes. Then rapidly open and closed another mdb env - and close(sync descriptor) waits for the old changes to be synced in order to decide whether to return success or failure.
That's nonsense.
POSIX defines no such behavior for close(). In particular, close()'s success/failure result cannot depend on some other process's state.
There is no other process.
You just said "previous process wrote something and got killed while fsyncing" - so you assumed there was another process.
The point would be that the system's only descriptor to a file with outstanding syncs is being closed.
But close() in the current process cannot report success/failure of that sync, because the current process didn't initiate the sync. Doing so would be an information leak, and violates the process model.
Anyway, there's no point in speculating. Anyone interested should dig into MacOSX and find the answer there.