Skip to content

Commit 1eee9ff

Browse files
committed
review comments from @flyrain
1 parent 6f90986 commit 1eee9ff

File tree

2 files changed

+7
-9
lines changed

2 files changed

+7
-9
lines changed

runtime/service/src/main/java/org/apache/polaris/service/config/FilterPriorities.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222

2323
public final class FilterPriorities {
2424
public static final int REQUEST_ID_FILTER = Priorities.AUTHENTICATION - 101;
25-
public static final int REALM_CONTEXT_FILTER = Priorities.AUTHENTICATION - 100;
25+
public static final int REALM_CONTEXT_FILTER = REQUEST_ID_FILTER + 1;
2626
public static final int RATE_LIMITER_FILTER = Priorities.USER;
2727
public static final int MDC_FILTER = REALM_CONTEXT_FILTER + 1;
2828
public static final int TRACING_FILTER = REALM_CONTEXT_FILTER + 2;

runtime/service/src/main/java/org/apache/polaris/service/tracing/RequestIdGenerator.java

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -36,14 +36,12 @@ public class RequestIdGenerator {
3636
public String generateRequestId() {
3737
long currentCounter = COUNTER.incrementAndGet();
3838
String requestId = baseDefaultUuid + "_" + currentCounter;
39-
if (currentCounter >= COUNTER_SOFT_MAX) {
40-
if (resetInProgress.compareAndSet(false, true)) {
41-
// If we get anywhere close to danger of overflowing Long (which, theoretically,
42-
// would be extremely unlikely) rotate the UUID and start again.
43-
baseDefaultUuid = UUID.randomUUID().toString();
44-
COUNTER.set(0);
45-
resetInProgress.set(false);
46-
}
39+
if (currentCounter >= COUNTER_SOFT_MAX && resetInProgress.compareAndSet(false, true)) {
40+
// If we get anywhere close to danger of overflowing Long (which, theoretically,
41+
// would be extremely unlikely) rotate the UUID and start again.
42+
baseDefaultUuid = UUID.randomUUID().toString();
43+
COUNTER.set(0);
44+
resetInProgress.set(false);
4745
}
4846
return requestId;
4947
}

0 commit comments

Comments
 (0)