Skip to content

Commit

Permalink
Make lastMeterRolloverStartTime volatile (#4515)
Browse files Browse the repository at this point in the history
  • Loading branch information
izeye authored Jan 2, 2024
1 parent d631b4b commit 2bea6ac
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ public class OtlpMeterRegistry extends PushMeterRegistry {

// Time when the last scheduled rollOver has started. Applicable only for delta
// flavour.
private long lastMeterRolloverStartTime = -1;
private volatile long lastMeterRolloverStartTime = -1;

@Nullable
private ScheduledExecutorService meterPollingService;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public abstract class StepMeterRegistry extends PushMeterRegistry {
private ScheduledExecutorService meterPollingService;

// Time when the last scheduled rollOver has started.
private long lastMeterRolloverStartTime = -1;
private volatile long lastMeterRolloverStartTime = -1;

public StepMeterRegistry(StepRegistryConfig config, Clock clock) {
super(config, clock);
Expand Down

0 comments on commit 2bea6ac

Please sign in to comment.