-
-
Notifications
You must be signed in to change notification settings - Fork 179
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
Synced files are sometimes unexpectedly truncated #223
Comments
Can you describe your setup please? Maybe paste |
I'm calling figwheel from within a boot pod that's running in a totally On Fri, Jun 12, 2015 at 2:27 PM, Micha Niskin notifications@github.com
|
One thing you can try that might solve the problem is increasing the
My guess is that figwheel is writing to a bunch of files sequentially. The filesystem modify event is fired by the OS when the first file is written to. Boot waits 10ms and then makes its filesystem diff against what it has in the fileset and starts to copy. Meanwhile figwheel is writing to other files, introducing a race condition. I feel like boot could be smarter about how it does the diffing and copying and detect this condition. Recommendations are certainly welcome 😄 |
@aaronc closing this, reopen if the problem persists. |
Hi @martinklepsch, this issue is definitely not fixed. By the way @micha, my apologies for not responding earlier - I got side-tracked with other things. Changing the |
@aaronc cool, thanks for the feedback. Is there any chance you can provide a reproduction case of some sort? |
Hi Martin, I wish I had time to put together a full reproduction, but what I can tell you quickly is that if you try to run something like figwheel in a separate process and then serve the generated js from a ring handler that serves the files based on their resource path, you'll probably eventually end up with the scenario that the files that boot serves are truncated and you'll know this by looking at your browser's debugger. I imagine the StreamClosed exception is related but I can't say for sure. Basically it looks like boot starts copying a file while the external process is still writing the file and then never gets notified of additional changes later on. As @micha was saying, boot probably needs to be smarter about how it handles these change diffs. |
The files generated by figwheel are probably not updated atomically (eg. write to temp file and move to destination). Assuming this is the case I'm not sure how boot can know when it's safe to read a file, because some other process that boot knows nothing about could be writing to it while it's being read. Unless anyone has ideas for how to approach this I think we can close the issue. |
I notice this issue when an outside process (in this case figwheel) updates files in my projects resources folder. Boot syncs them to temporary files but sometimes the files are unexplainably truncated (i.e. missing the last n lines). I can verify that the file in my actual resources folder is correct and that the file in boot's temp folder is truncated by examining the corresponding file in boot's fileset.
The text was updated successfully, but these errors were encountered: