← All contributions
OPENTELEMETRY JAVA / MERGED #8499

When removing one entry skips another.

A bucket iteration bug in PooledHashMap could skip live metric series during collection.

The problem

PooledHashMap walked each bucket by increasing index. When a callback removed its current entry, the next entry shifted into that same slot. Incrementing the index then skipped it.

The change

The merged change walks each bucket back-to-front. Removing the current entry shifts only entries that have already been visited.

What the tests establish

Regression tests cover colliding keys and removal during iteration, plus metric storage collecting live series while stale series are removed.

Scope matters

This concerns the reusable-data path. It is not evidence that all metric collection modes were affected, or that data was permanently lost.

Inspect the evidence

The public pull request contains the implementation, regression tests, review discussion, and merge status.

Open the merged contribution ↗

Read the technical note with an interactive bucket example →