-
-
Notifications
You must be signed in to change notification settings - Fork 85
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
.NET Tool Crashes When Run Concurrently #733
Comments
It sounds like somehow the json file is getting corrupted, possibly with multiple processes trying to read and write it at the same time. I should have a chance to dig into trying to reproduce this locally in the next few days. As a fallback option, I am debating between adding an option to disable the cache or catching exceptions like this and falling back to not using the cache. The only thing I am curious about, does the error message vary? If so that seems like a good indication my hunch about two processes writing the file at the same time is correct. |
Yes, the message varies slightly. Here is a different example:
As a workaround, we added |
If we can't read the cache, just use the null cache trying out an idea for ensuring the file does not get corrupted.
I believe this should be resolved now with 0.19.2. I could reproduce the problem you saw semi-reliably and found a couple other issues. |
The fixes appear to be working for us so far, so I have removed |
I suspect #728 remains present at dotnet-csharpier 0.19.1, which we run as a pre-commit hook both locally and in CI. Here is the relevant excerpt from our
.pre-commit-config.yaml
:When we run pre-commit on all files in our repository, it filters out any non-C# files and feeds the rest to dotnet-csharpier in multiple batches, effectively running a series of commands of the following form in quick succession:
This seems to work reliably locally, but fails about 2/3 to 3/4 of the time in CI, starting when we upgraded from CSharpier 0.18.0 to 0.19.1. Perhaps the difference stems from there being more limited computing resources available in CI. Here is the pertinent pre-commit output from one of the failed runs:
Please let me know if I can provide additional information.
The text was updated successfully, but these errors were encountered: