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

Failure to write cache hash makes task to exit with non 0 exit code (to fail) #6957

Closed
minijus opened this issue Sep 8, 2021 · 3 comments
Closed
Labels

Comments

@minijus
Copy link
Contributor

minijus commented Sep 8, 2021

Current Behavior

In not very stable fs environments (mounted cache directory with NFS based volume) there are sometimes failures on atomic fs operations. Ideally these should be handled (when possible) and the actual task run should not exit with failure.

image

Expected Behavior

Failure to write latest cache hash should be reported but it should not make the task run exit with failure.

Would it be enough to wrap writeToFile into try/catch? Could it potentially break something on workspace? Or is it just that latest cache hash entry will be missing?

Steps to Reproduce

  • Have unstable fs, or
  • Mock fs import to fail.

Failure Logs

Environment

>  NX  Report complete - copy this into the issue template

  Node : 14.17.5
  OS   : darwin x64
  npm  : 6.14.14
  
  nx : Not Found
  @nrwl/angular : 12.9.0
  @nrwl/cli : 12.9.0
  @nrwl/cypress : 12.9.0
  @nrwl/devkit : 12.9.0
  @nrwl/eslint-plugin-nx : 12.9.0
  @nrwl/express : Not Found
  @nrwl/jest : 12.9.0
  @nrwl/linter : 12.9.0
  @nrwl/nest : 12.9.0
  @nrwl/next : Not Found
  @nrwl/node : 12.9.0
  @nrwl/nx-cloud : Not Found
  @nrwl/react : Not Found
  @nrwl/schematics : Not Found
  @nrwl/tao : 12.9.0
  @nrwl/web : Not Found
  @nrwl/workspace : 12.9.0
  @nrwl/storybook : 12.9.0
  @nrwl/gatsby : Not Found
  typescript : 4.3.5

@minijus
Copy link
Contributor Author

minijus commented Sep 10, 2021

Had to revert @nrwl/* back to 12.8 for now. The issue is not present with 12.8.

@FrozenPandaz FrozenPandaz added the scope: core core nx functionality label Sep 10, 2021
leosvelperez added a commit that referenced this issue Oct 1, 2021
…sh cache files (#6959)

* fix(core): wrap writing cache hash into try/catch

Instead of failing the task run process it will allow the process to continue.

Fixes of #6957

* fix(core): ignore errors writing latest output hash cache files

Co-authored-by: Leosvel Pérez Espinosa <leosvel.perez.espinosa@gmail.com>
@FrozenPandaz
Copy link
Collaborator

Fixed with #6959

@github-actions
Copy link

This issue has been closed for more than 30 days. If this issue is still occuring, please open a new issue with more recent context.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 23, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants