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

Fixes #16374: Race condition in technique variable filling #2664

Conversation

fanf
Copy link
Member

@fanf fanf commented Dec 9, 2019

@Normation-Quality-Assistant
Copy link
Contributor

OK, merging this PR

@Normation-Quality-Assistant Normation-Quality-Assistant merged commit 31a330b into Normation:branches/rudder/6.0 Dec 9, 2019
}
}

def getTemplateFromContent(templateName: String,content: String): IOResult[SynchronizedFileTemplate] = {
for {
c <- semaphore.withPermit(cache.get(content) match {
semaphore.withPermit(for {
Copy link
Member

Choose a reason for hiding this comment

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

here, you are locking with the same semaphore than fill ; you should have a distrinct semaphore (if possible)

Copy link
Member Author

Choose a reason for hiding this comment

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

they have the same name but there is two ZioRuntime.unsafeRun(Semaphore.make(1)) so there are not the same (actually, there is one semaphore for each SynchronizedFileTemplate, so for each fill)

@fanf fanf deleted the bug_16374/race_condition_in_technique_variable_filling branch March 15, 2024 10:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants