Description
We are using ScheduledExecutorService#scheduleWithFixedDelay to periodically reporting metrics. From javadoc of this method
If any execution of the task encounters an exception, subsequent executions are suppressed.
We could see if any uncaught exception like NPE thrown in the task thread, there won't be any error thrown but the task would be silently terminated.
In our real case we were making some modification to the metrics and causing NPE carelessly, then we found metrics disappeared but cannot get a clue from RS log.
Suggest to catch Throwable in MetricsRegionServerWrapperImpl$RegionServerMetricsWrapperRunnable, add some log there and suppress the exception to give it another try at next scheduled run.