You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently the default (async) file manager allows to save a file and to read it concurrently. If this happens, the read file content will probably not consist of the whole file, but a part of it.
Also, since save() is async, it could be cancelled in the middle, which will likely corrupt the file.
Proposed Solution
I am wondering if writing a file should prevent reading it at the same time. Also, I think that writing a file should be shielded from cancellation.
I think these constraints should be enforced here in jupyter-server, since this would avoid lots of issues upstream when using these methods. We could for instance use a file path based locking mechanism for preventing reading-while-writing.
Additional context
jupyter-collaboration shields write operations here, and uses locks for preventing reading-while-writing.
The text was updated successfully, but these errors were encountered:
Problem
Currently the default (async) file manager allows to save a file and to read it concurrently. If this happens, the read file content will probably not consist of the whole file, but a part of it.
Also, since
save()
is async, it could be cancelled in the middle, which will likely corrupt the file.Proposed Solution
I am wondering if writing a file should prevent reading it at the same time. Also, I think that writing a file should be shielded from cancellation.
I think these constraints should be enforced here in jupyter-server, since this would avoid lots of issues upstream when using these methods. We could for instance use a file path based locking mechanism for preventing reading-while-writing.
Additional context
jupyter-collaboration
shields write operations here, and uses locks for preventing reading-while-writing.The text was updated successfully, but these errors were encountered: