Skip to content

Commit

Permalink
Fixing requestId generator bug in PinotBrokerDebug Resource
Browse files Browse the repository at this point in the history
  • Loading branch information
xiangfu0 committed Jul 30, 2024
1 parent a6cf197 commit 464b7ab
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@
public class PinotBrokerDebug {

// Request ID is passed to the RoutingManager to rotate the selected replica-group.
private final AtomicLong _requestIdGenerator = new AtomicLong();
private final static AtomicLong _requestIdGenerator = new AtomicLong();

@Inject
private BrokerRoutingManager _routingManager;
Expand Down Expand Up @@ -272,6 +272,9 @@ public String getServerRoutingStats() {
}

private long getRequestId() {
if (_requestIdGenerator.get() == Long.MAX_VALUE) {
_requestIdGenerator.set(0);
}
return _requestIdGenerator.getAndIncrement();
}

Expand Down

0 comments on commit 464b7ab

Please sign in to comment.