Skip to content

Commit

Permalink
GH-467: Support concurrent behavior on MetricsRetryListener
Browse files Browse the repository at this point in the history
  • Loading branch information
huisam committed Sep 11, 2024
1 parent c0a4941 commit ed7f969
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

package org.springframework.retry.support;

import java.util.Collections;
import java.util.IdentityHashMap;
import java.util.Map;
import java.util.function.Function;
Expand Down Expand Up @@ -61,7 +62,8 @@ public class MetricsRetryListener implements RetryListener {

private final MeterRegistry meterRegistry;

private final Map<RetryContext, Timer.Sample> retryContextToSample = new IdentityHashMap<>();
private final Map<RetryContext, Timer.Sample> retryContextToSample = Collections
.synchronizedMap(new IdentityHashMap<>());

private final Timer.Builder retryMeterProvider;

Expand Down

0 comments on commit ed7f969

Please sign in to comment.