The example IndexedDB virtual filesystem implementation checks and sets an isLocked flag in IndexedDB and just returns a SQLITE_BUSY error when attempting to lock a file that is already locked (instead of waiting to obtain the lock). [this is no longer how it works] While this might work for some applications, it has some drawbacks:
A retry-on-busy approach is prone to starvation.
The lock can be orphaned if the lock holder exits without releasing it.
Ideally a lock expires automatically with the holder lifetime, which is not the case when the lock is stored in IndexedDB.
Orphaned locks typically require user-initiated clearing.
Here are some alternative mechanisms for synchronization on the web platform:
The example IndexedDB virtual filesystem implementation checks and sets an[this is no longer how it works] While this might work for some applications, it has some drawbacks:isLockedflag in IndexedDB and just returns aSQLITE_BUSYerror when attempting to lock a file that is already locked (instead of waiting to obtain the lock).Here are some alternative mechanisms for synchronization on the web platform:
Not supported on Safari (but in preview behind a flag).[Supported now]The text was updated successfully, but these errors were encountered: