Take a mutex before accessing the l_ApiScriptFrames#10675
Conversation
julianbrost
left a comment
There was a problem hiding this comment.
First of all: good catch and thanks for bringing this up.
54e3b15 to
d126cfa
Compare
|
@julianbrost understood. Should be good to go now. |
67e81b5 to
c716bdd
Compare
julianbrost
left a comment
There was a problem hiding this comment.
Looking good mostly now, there are just two places that need some minor cleanup. Apart from that, I noticed there's also a race condition if multiple requests are sent in parallel for the same session ID, I'll create a second PR for that one soon.
Take a mutex to avoid race conditions in the map that lead to segmentation faults. Move the ApiScriptFrame object back behind a shared pointer to avoid holding the mutex for too long. Fixes Icinga#10674
c716bdd to
11726b7
Compare
|
@julianbrost I am so sorry. I genuinely thought this PR was already merged and have not look at it since. Fixed your comments and rebased onto master :D |
julianbrost
left a comment
There was a problem hiding this comment.
Thank you!
I am so sorry. I genuinely thought this PR was already merged and have not look at it since.
Don't worry, I said to myself that I'll wait for a week or two and otherwise just do that small cleanup myself, and then I forgot about it myself. 😅
|
Backport failed for Please cherry-pick the changes locally and resolve any conflicts. git fetch origin support/2.15
git worktree add -d .worktree/backport-10675-to-support/2.15 origin/support/2.15
cd .worktree/backport-10675-to-support/2.15
git switch --create backport-10675-to-support/2.15
git cherry-pick -x 11726b741cfbb0813e13193d11b69c2228836bea |
Take a mutex to avoid race conditions in the map that lead to segmentation faults. Move the ApiScriptFrame object back behind a shared pointer to avoid holding the mutex for too long.
Fixes #10674