GitHub user zentol opened a pull request:
https://github.com/apache/flink/pull/5959
[FLINK-9258][metrics] Thread-safe initialization of variables map
## What is the purpose of the change
This PR fixes a thread-safety issue in `ComponentMetricGroup` where a map
was assigned to the `variables` field in a synchronized block before it was
populated.
This meant that a modification could be made to the map that is already
visible to other threads, leading to `ConcurrentModificationExceptions`.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/zentol/flink 9258
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/flink/pull/5959.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #5959
----
----
---