adityamukho commented on code in PR #7488:
URL: https://github.com/apache/ignite-3/pull/7488#discussion_r2757411911
##########
modules/metrics/src/main/java/org/apache/ignite/internal/metrics/MetricManagerImpl.java:
##########
@@ -186,18 +188,38 @@ public void registerSource(MetricSource src) {
@Override
public void unregisterSource(MetricSource src) {
- inBusyLockSafe(busyLock, () -> {
- disable(src);
- registry.unregisterSource(src);
- });
+ try {
+ if (metricSources().contains(src)) {
+ inBusyLockSafe(busyLock, () -> {
+ disable(src);
+ registry.unregisterSource(src);
+ });
+ }
+ } catch (Exception e) {
+ Throwable rootEx = unwrapRootCause(e);
+
+ if (!(rootEx instanceof NodeStoppingException)) {
+ log.error("Failed to unregister metrics source {}", e,
src.name());
+ }
Review Comment:
`MessagingService`-related metrics, when being unregistered, were triggering
the `NodeStoppingException` in certain integration tests. While not a fatal
error in itself (since the cluster and node were anyway shutting down), it was
polluting test console output (and would likely pollute production output as
well). I added this check to prevent that, while still logging any other,
unexpected cause.
--
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]