Skip to content

[BACKPORT 6.7] Resolve concurrency with watcher trigger service#39219

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

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

Conversation

@tvernum
Copy link
Copy Markdown
Contributor

@tvernum tvernum commented Feb 21, 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 21, 2019

Stranglely, only elasticsearch-ci/docbldesx & elasticsearch-ci/oss-distro-docs were triggered for this PR.
@elasticmachine run elasticsearch-ci/1 & run elasticsearch-ci/2

@tvernum tvernum merged commit dcaa53d into elastic:6.7 Feb 21, 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