Skip to content
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

Windows: Concurrent file access with broccoli serve #128

Closed
joliss opened this issue May 2, 2014 · 1 comment
Closed

Windows: Concurrent file access with broccoli serve #128

joliss opened this issue May 2, 2014 · 1 comment

Comments

@joliss
Copy link
Member

joliss commented May 2, 2014

With broccoli serve, the server can have files open when a rebuild is triggered. Triggering the rebuild causes temporary directories to be deleted. This is no problem on Unix, but on Windows, it appears that we cannot delete a file while it is open. To my understanding, if on Windows we call unlinkSync on a file that is currently open, unlinkSync will return successfully, but the file will continue to exist on the file system until it is closed. Trying to rmdir the containing directory then throws an error. Also, subsequent opens on the file will fail.

I would assume that the correct fix is to close all files that the server has open before starting the rebuild. We are currently using send for serving, and at the moment there doesn't seem to be a way to tell it to close the stream that it opens.

Thanks to @krisselden to @stefanpenner for tracking this down. Also see Stef's example gist.

@joliss joliss changed the title Concurrent file access with broccoli serve causes errors on Windows Windows: Concurrent file access with broccoli serve May 2, 2014
@joliss joliss mentioned this issue May 2, 2014
@joliss joliss closed this as completed in 0aed49d May 3, 2014
joliss added a commit that referenced this issue May 3, 2014
readFileSync instead of using send module (fixes #128)
@recipher
Copy link

recipher commented May 3, 2014

Good work.

On 3 May 2014 13:10, Jo Liss [email protected] wrote:

Closed #128 https://github.com/joliss/broccoli/issues/128 via 0aed49dhttps://github.com/joliss/broccoli/commit/0aed49d5530fdc0ba74f15c5fadff9368f15ab4c
.


Reply to this email directly or view it on GitHubhttps://github.com/joliss/broccoli/issues/128
.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants