Hello Spring team. I was glad to hear that official support MetricsRetryListener class by this issue #458
But I have a question about this class behavior.
Question
The retryContextToSample field is considered for reusable many retry operations.
And the RetryListener can be registered by bean from RetryConfiguration class.
If the MetricsRetryListener registered by bean, the MetricsRetryListener can called by concurrent retry operations.
In conclusion, my question is why retryContextToSample was defined to IdentityHashMap ?
private final Map<RetryContext, Timer.Sample> retryContextToSample = new IdentityHashMap<>();
On IdentityHashMap javadoc, it doesn't support thread safe behavior.
Suggestion
Can you support the thread safe behavior from the retryContextToSample?
private final Map<RetryContext, Timer.Sample> retryContextToSample = new ConcurrentHashMap<>();
Discussion
Please feel free to comment on this issue. If my suggestion is wrong, then I will close this issue.
Hello Spring team. I was glad to hear that official support
MetricsRetryListenerclass by this issue #458But I have a question about this class behavior.
Question
The
retryContextToSamplefield is considered for reusable many retry operations.And the RetryListener can be registered by bean from
RetryConfigurationclass.If the
MetricsRetryListenerregistered by bean, theMetricsRetryListenercan called by concurrent retry operations.In conclusion, my question is why
retryContextToSamplewas defined toIdentityHashMap?On
IdentityHashMapjavadoc, it doesn't support thread safe behavior.Suggestion
Can you support the thread safe behavior from the
retryContextToSample?Discussion
Please feel free to comment on this issue. If my suggestion is wrong, then I will close this issue.