Skip to content

Commit

Permalink
Isolate polling of pollables in StatsdMeterRegistry (#2549)
Browse files Browse the repository at this point in the history
This prevents a misbehaving pollable meter (a gauge with a custom value function that might throw an NPE, for example) from preventing other ongoing polling of other pollable meters.

Fixes gh-2543
  • Loading branch information
matthewlowry authored Apr 14, 2021
1 parent b433283 commit 17024fb
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,11 @@ private <M extends Meter> void removePollableMeter(M m) {

void poll() {
for (StatsdPollable pollableMeter : pollableMeters.values()) {
pollableMeter.poll();
try {
pollableMeter.poll();
} catch (RuntimeException e) {
// Silently ignore misbehaving pollable meter
}
}
}

Expand Down

0 comments on commit 17024fb

Please sign in to comment.