Skip to content

Conversation

@minxhe
Copy link

@minxhe minxhe commented Jan 6, 2026

We have been observing intermittent missing metrics for Beam metrics emitted from async threads. This pull request improves thread safety in the Flink metrics implementation by switching to concurrent data structures. The most important changes are:

Flink metrics thread safety:

  • Replaced HashMap with ConcurrentHashMap for flinkCounterCache, flinkDistributionGaugeCache, and flinkGaugeCache in FlinkMetricContainerBase.java to improve thread safety in metric storage. [1] [2]

Thank you for your contribution! Follow this checklist to help us incorporate your contribution quickly and easily:

  • Mention the appropriate issue in your description (for example: addresses #123), if applicable. This will automatically add a link to the pull request in the issue. If you would like the issue to automatically close on merging the pull request, comment fixes #<ISSUE NUMBER> instead.
  • Update CHANGES.md with noteworthy changes.
  • If this contribution is large, please file an Apache Individual Contributor License Agreement.

See the Contributor Guide for more tips on how to make review process smoother.

To check the build health, please visit https://github.com/apache/beam/blob/master/.test-infra/BUILD_STATUS.md

GitHub Actions Tests Status (on master branch)

Build python source distribution and wheels
Python tests
Java tests
Go tests

See CI.md for more information about GitHub Actions CI.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant