This is an automated email from the ASF dual-hosted git repository. gnodet pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/maven-resolver.git
commit a96473d4e909ff7fb135f37cd529c9711be63f54 Author: Guillaume Nodet <[email protected]> AuthorDate: Sun Jun 7 06:50:27 2026 +0000 Fix Redisson trySetPermits() — log warning on failure F-22: Check the return value of trySetPermits(). If it returns false (e.g., a crashed process left the semaphore in a depleted state), log a warning instead of silently proceeding with a potentially broken semaphore. --- .../aether/named/redisson/RedissonSemaphoreNamedLockFactory.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/maven-resolver-named-locks-redisson/src/main/java/org/eclipse/aether/named/redisson/RedissonSemaphoreNamedLockFactory.java b/maven-resolver-named-locks-redisson/src/main/java/org/eclipse/aether/named/redisson/RedissonSemaphoreNamedLockFactory.java index 99bdbfa97..06ff32959 100644 --- a/maven-resolver-named-locks-redisson/src/main/java/org/eclipse/aether/named/redisson/RedissonSemaphoreNamedLockFactory.java +++ b/maven-resolver-named-locks-redisson/src/main/java/org/eclipse/aether/named/redisson/RedissonSemaphoreNamedLockFactory.java @@ -50,7 +50,9 @@ public class RedissonSemaphoreNamedLockFactory extends RedissonNamedLockFactoryS protected AdaptedSemaphoreNamedLock createLock(final NamedLockKey key) { RSemaphore semaphore = semaphores.computeIfAbsent(key, k -> { RSemaphore result = redissonClient.getSemaphore(TYPED_NAME_PREFIX + k.name()); - result.trySetPermits(Integer.MAX_VALUE); + if (!result.trySetPermits(Integer.MAX_VALUE)) { + logger.warn("Failed to set permits on semaphore '{}'; it may be in a stale state", k.name()); + } return result; }); return new AdaptedSemaphoreNamedLock(key, this, new RedissonSemaphore(semaphore));
