/v1/console: prevent concurrent use of the same session by multiple requests#10681
Merged
Conversation
…equests If there are such requests, without this change, they would all be allowed and processed, resulting in unsafe concurrent (write) access to these data structures, which can ultimately crash the daemon or lead to other unintended behavior.
b671e80 to
0d376b5
Compare
yhabteab
approved these changes
Mar 12, 2026
|
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-10681-to-support/2.15 origin/support/2.15
cd .worktree/backport-10681-to-support/2.15
git switch --create backport-10681-to-support/2.15
git cherry-pick -x 0d376b5d5a64599d2f641471ac08c6d1678fdbbf |
|
Successfully created backport PR for |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
If there are such requests, without this change, they would all be allowed and processed, resulting in unsafe concurrent (write) access to these data structures, which can ultimately crash the daemon or lead to other unintended behavior.
This PR is a follow-up to #10675 adding more required locking.
Tests
I was able to somewhat reliably trigger that race condition using the following command (
abis ApacheBench):Before (0f44133)
With the current master, I was able to observe Icinga 2 crashing with a SIGSEGV (typically after around ~10k to ~30k):
However, I also observed instances where Icinga 2 stopped responding to
ab.After (0d376b5)
With this PR, Icinga 2 now survives the ab-torture (even multiple runs, so more than 100k requests).