We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9eb11d4 commit 3590facCopy full SHA for 3590fac
1 file changed
cloud-core/src/main/java/org/incendo/cloud/CommandManager.java
@@ -413,7 +413,11 @@ public boolean hasCapability(final @NonNull CloudCapability capability) {
413
final boolean cache = this.settings.get(ManagerSetting.REDUCE_REDUNDANT_PERMISSION_CHECKS);
414
try {
415
if (cache) {
416
- this.threadLocalPermissionCache.get().second().incrementAndGet();
+ final int prev = this.threadLocalPermissionCache.get().second().incrementAndGet();
417
+ if (prev == 0) {
418
+ // Cleanup from case where cache was enabled mid-permission check
419
+ this.threadLocalPermissionCache.get().first().clear();
420
+ }
421
}
422
return this.testPermission_(sender, permission);
423
} finally {
0 commit comments