Skip to content

Conversation

gordonpn
Copy link
Member

@gordonpn gordonpn commented Dec 22, 2023

Issue #, if available: V1163459895

Description of changes:

A customer found that using many threads could throw a NullPointerException during a putMetric() call. Multiple threads could be calling putMetric() at the same time.

The HashMap may be re-hashing during a call to get().

https://stackoverflow.com/questions/21754098/java-hashmap-returning-null-on-get-call

We can use a ConcurrentHashMap instead of a HashMap to mitigate this issue.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@gordonpn gordonpn self-assigned this Dec 22, 2023
@gordonpn gordonpn merged commit c142f45 into awslabs:master Dec 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants