Skip to content

[BACKPORT 7.x] Resolve concurrency with watcher trigger service#39164

Merged
tvernum merged 1 commit intoelastic:7.xfrom
tvernum:backport/7.x/39092-Resolve-concurrency-with-watcher
Feb 20, 2019
Merged

[BACKPORT 7.x] Resolve concurrency with watcher trigger service#39164
tvernum merged 1 commit intoelastic:7.xfrom
tvernum:backport/7.x/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
Copy link
Copy Markdown
Contributor Author

tvernum commented Feb 20, 2019

Version bump hadn't been merged to 6.6 when this ran.
@elasticmachine test this please

@tvernum tvernum merged commit 4aa50ed into elastic:7.x 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