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

COLI-1216: Combinator: File is being used by another process #23

Closed
wants to merge 4 commits into from

Conversation

aracsibalint
Copy link
Member

@aracsibalint aracsibalint commented Oct 4, 2023

COLI-1216
Fixes #22.

CombinedResourceManager.cs Outdated Show resolved Hide resolved
CombinedResourceManager.cs Outdated Show resolved Hide resolved
Services/CacheFileService.cs Outdated Show resolved Hide resolved
CombinedResourceManager.cs Show resolved Hide resolved
@aracsibalint aracsibalint requested a review from Piedone December 20, 2023 21:18
if (resourceType == ResourceType.Style) result = _combinatorService.CombineStylesheets(resources, settings);
else if (resourceType == ResourceType.JavaScript) result = _combinatorService.CombineScripts(resources, settings);
else return base.BuildRequiredResources(stringResourceType);
using (var mutex = new Mutex(initiallyOwned: false, "Global\\CombinatorFileAccess"))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Functionally, this is the same as a simple lock. However, a Mutex is a heavy way of synchronization across processed, what you don't need. This can either be a simple semaphore as I mentioned (with any number of readers and a single writer) or you can do a slightly more sophisticated way with a named locking approach, so the locks are different per resource bundle.

Please decide with a team whether essentially making bundle writing serially executed (across the whole app) is acceptable, or you need a named lock.

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.

File is being used by another process (COLI-1216)
3 participants