Skip to content

[BACKPORT 7.0] Resolve concurrency with watcher trigger service#39167

Merged
tvernum merged 1 commit intoelastic:7.0from
tvernum:backport/7.0/39092-Resolve-concurrency-with-watcher
Feb 20, 2019
Merged

[BACKPORT 7.0] Resolve concurrency with watcher trigger service#39167
tvernum merged 1 commit intoelastic:7.0from
tvernum:backport/7.0/39092-Resolve-concurrency-with-watcher

Conversation

@tvernum
Copy link
Copy Markdown
Contributor

@tvernum tvernum commented Feb 20, 2019

The watcher trigger service could attempt to modify the perWatchStats
map simultaneously from multiple threads. This would cause the
internal state to become inconsistent, in particular the count()
method may return an incorrect value for the number of watches.

This changes replaces the implementation of the map with a
ConcurrentHashMap so that its internal state remains consistent even
when accessed from mutiple threads.

Backport of: #39092

The watcher trigger service could attempt to modify the perWatchStats
map simultaneously from multiple threads. This would cause the
internal state to become inconsistent, in particular the count()
method may return an incorrect value for the number of watches.

This changes replaces the implementation of the map with a
ConcurrentHashMap so that its internal state remains consistent even
when accessed from mutiple threads.

Backport of: elastic#39092
@tvernum tvernum changed the title Resolve concurrency with watcher trigger service [BACKPORT 7.0] Resolve concurrency with watcher trigger service Feb 20, 2019
@tvernum tvernum merged commit ab1f6c9 into elastic:7.0 Feb 20, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant