stefan-egli commented on code in PR #31:
URL:
https://github.com/apache/sling-org-apache-sling-event/pull/31#discussion_r1250696403
##########
src/main/java/org/apache/sling/event/impl/jobs/stats/GaugeSupport.java:
##########
@@ -150,8 +154,10 @@ private void registerWithSuffix(String suffix, int count,
Gauge<Long> value) {
metricRegistry.register(metricName, value);
gaugeMetricNames.add(metricName);
} catch (IllegalArgumentException e) {
- if (queueName != null) {
+ if (queueName != null && count <= 10) {
registerWithSuffix(suffix, count + 1, value);
+ } else {
+ logger.debug("Failed to register suffix {} for the queue {},
attempt {}", suffix, queueName, count, e);
Review Comment:
What about logging an error if it hits `10` and logging debug in any other
case? eg like so:
```suggestion
if (queueName != null && count <= 10) {
logger.debug("Failed to register suffix {} for the queue {},
attempt {}, retrying.", suffix, queueName, count, e);
registerWithSuffix(suffix, count + 1, value);
} else {
logger.error("Failed to register suffix {} for the queue {},
attempt {}, giving up.", suffix, queueName, count, e);
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]