Skip to content

Fix concurrency issue regression #47

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

mnivet
Copy link
Contributor

@mnivet mnivet commented Feb 7, 2018

We recently upgrade Baseclass.Contrib.Nuget.Output package to support VS2017

However we discover that recent versions have a concurrency issue similar to the one I had fixed in the past.
Looking at the code it appears that a regression appear when the c# code has been moved from the targets file to a cs file in the c# project.
The mutex do not cover any more the read file operation but only the file extraction operation which cause concurrency issue when one try to read the file while one is currently extracting it which sometimes occurs on our build servers in CI.

The intend of this pull request is to fix that regression by re-introduce the file read operation inside the mutex.

I've also include the idea of issue #36 to improve performances in a concurrent build environment.

This is now running fine on our build servers with an internal pre-release package.

 When code has been moved from targets to csharp in commit c3354fa file read has been excluded from the mutex which produce concurrency issue like explain in the comment above the mutex creation

- Reduce scope of the mutex to optimize parallel compilations
 This is a really interesting proposition from issue baseclass#36
…he file

Mutex constructor search for the file when we provide a full path as a mutex name...
@romerod
Copy link
Member

romerod commented Feb 7, 2018

Thanks for the pull request.

Why did you remove the existence of the file before creating the mutex? There is no need to create it when the file is already there.

@mnivet
Copy link
Contributor Author

mnivet commented Feb 8, 2018

The file can be there but not fully written by one execution which unzip it. So expecting we can read the file just because it is present is wrong.
It's the issue that occurs sometime on our build server where we intensively parallelize builds

jmarsik added a commit to lekiscz/Contrib.Nuget that referenced this pull request Jan 3, 2023
…ith merged PR baseclass#47, version number corresponds to base version from upstream repo
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

Successfully merging this pull request may close these issues.

2 participants