Skip to content

[8.19] 🌊 Streams: Prevent concurrent access (#222961)#224098

Merged
kibanamachine merged 2 commits intoelastic:8.19from
kibanamachine:backport/8.19/pr-222961
Jun 17, 2025
Merged

[8.19] 🌊 Streams: Prevent concurrent access (#222961)#224098
kibanamachine merged 2 commits intoelastic:8.19from
kibanamachine:backport/8.19/pr-222961

Conversation

@kibanamachine
Copy link
Contributor

Backport

This will backport the following commits from main to 8.19:

Questions ?

Please refer to the Backport tool documentation

This PR guards changes to the streams state that go through
`State.attemptChanges` via the newly introduced lock manager.

If two requests are happening at the same time, one of them now fails
with a 409.

## Concerns

* Lock expiry is 30s for now - is this too little? Should be good enough
for now, maybe we need to reconsider once we introduce the bulk api
* This is only guarding changes that go through the `State` class - some
things like queries and dashboards do not, so they can still be subject
to race conditions. We could sprinkle more locks over the code base, but
I would like to solve this by moving them into `State` as well, that
seems like the cleaner approach, even though a bit more effort
* Biggest question - on this PR the concurrent request fails directly
with a 409. Is this OK or should it wait and retry a couple times? I'm
in favor of starting like this and seeing if this is actually a problem.

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Kevin Lacabane <kevin.lacabane@elastic.co>
(cherry picked from commit a8b2ac6)
@kibanamachine kibanamachine added the backport This PR is a backport of another PR label Jun 16, 2025
@kibanamachine kibanamachine enabled auto-merge (squash) June 16, 2025 16:00
@kibanamachine kibanamachine merged commit e170a00 into elastic:8.19 Jun 17, 2025
8 checks passed
@elasticmachine
Copy link
Contributor

💛 Build succeeded, but was flaky

Failed CI Steps

Test Failures

  • [job] [logs] Jest Tests #15 / UseInfiniteFindCaseUserActions calls the API with correct parameters

Metrics [docs]

✅ unchanged

History

cc @flash1293

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport This PR is a backport of another PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants