-
Notifications
You must be signed in to change notification settings - Fork 220
problem saving a file to disk #5823
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
The code I mentioned above in #5674 is now live, and there haven't been any new reports of this issue. I'll close this for now, but if any new reports come up (esp with a project restarted since yesterday!), then I'll reopen it. |
I've seen evidence of this, even after the change. Observations:
So the one thing that isn't happening is the patches aren't being applied to the version of the file in memory in the project. |
More observations:
I carefully studied logs, and this the problem, I think:
There is a request to OPEN from a frontend about 1.5 seconds after closing the sync tables, but before (I suspect) the syncdoc itself is closed. A way to simulate this:
Here's what should happen, and did happen later (after waiting 5 minutes, trying again, and it working):
|
Good news. I put this code: setTimeout(() => {
log("DOING delayed patches_table re-close", opts.path);
syncdocs[opts.path]?.patches_list.close();
}, 15000); in log("syncstring table closed, so closing syncdoc", opts.path);
close_syncdoc(opts.path); and was able to exactly reproduce the bug. Finally! |
I think a root cause that made this vanishing unlikely event highly likely is c98e510#diff-f5abc78278efe51cc4ae9ad7a67c1f96ed281d04816aec6740e2adc857efeecaR16 which I just fixed. |
It's now been over two weeks with me heavily using CoCalc, and I haven't seen any indication of this (or any other) sync bug. Moreover, there have been no reports from anybody else either. Finally! Maybe our sync implementation is "bug free", at least within the constraints of what is possible give our choices... |
There has again been a report of a file not saving to disk.
I don't know how to reproduce this. It might be fixed in #5674, since I did a deep dive into the realtime sync code, and fixed a bug that could I think have caused exactly this behavior. (It was a bug where in rare instances something could get stuck causing sync to not move forward.) So when that is merged (soon!), this might be fixed.
WORKAROUND: Though painful, restarting the project resets the backend sync state, which works around this.
The text was updated successfully, but these errors were encountered: