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

shakapacker.lock is not cleaned up #269

Closed
chrkau opened this issue Mar 27, 2023 · 4 comments
Closed

shakapacker.lock is not cleaned up #269

chrkau opened this issue Mar 27, 2023 · 4 comments

Comments

@chrkau
Copy link

chrkau commented Mar 27, 2023

Expected behavior:

/tmp/shakapacker.lock should be cleaned up after compiling assets.

Actual behavior:

/tmp/shakapacker.lock is not cleaned up after compiling assets. This leads to problems when multiple stages under different users are hosted on the same host. If assets are compiled for staging e.g. then compiling assets for production will fail as it will not be able to create the lock file here:

File.open(lock_file_name, File::CREAT) do |lf|

Setup environment:

  • Ruby version: 3.1.2
  • Rails version: 7.0.4.2
  • Shakapacker version: 6.6.0
@chrkau chrkau added the bug label Mar 27, 2023
@justin808
Copy link
Member

  1. We should probably have a clear warning if the lock exists. Is the current warning sufficient?
  2. @chrkau can you modify your scripts to clean this lock when they start?

@justin808 justin808 added enhancement and removed bug labels Mar 28, 2023
@justin808
Copy link
Member

See #158.

@chrkau
Copy link
Author

chrkau commented Mar 29, 2023

  1. We should probably have a clear warning if the lock exists. Is the current warning sufficient?

If by "warning" you mean exception then I'd say its pretty clear. :)
But joking aside: It took me a moment to realize why deployment suddenly broke when deploying to a different stage.

2. @chrkau can you modify your scripts to clean this lock when they start?

That's kinda what I'm doing right now: clean the file once the deployment is done.

See #158.

Yes that would pretty much fix my problem. But I still think it would be good practice to remove the lock file once it's not longer needed - no matter which dir it is created in.

@ahangarha
Copy link
Contributor

@chrkau I assume this issue is resolved. If not, please let us know.

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

No branches or pull requests

3 participants