You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by mi...@apache.org on 2021/08/28 22:44:55 UTC

[maven-resolver] branch master updated (f8dda75 -> 4fecfd7)

This is an automated email from the ASF dual-hosted git repository.

michaelo pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/maven-resolver.git.


    from f8dda75  [MRESOLVER-191] Document how to analyze lock issues
     new e8fb972  [MRESOLVER-190] [Regression] Revert MRESOLVER-184
     new 4fecfd7  [MRESOLVER-193] Properly type lock key names in Redis

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../named/redisson/RedissonReadWriteLockNamedLockFactory.java     | 4 +++-
 .../aether/named/redisson/RedissonSemaphoreNamedLockFactory.java  | 8 ++++++--
 2 files changed, 9 insertions(+), 3 deletions(-)

[maven-resolver] 02/02: [MRESOLVER-193] Properly type lock key names in Redis

Posted by mi...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

michaelo pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/maven-resolver.git

commit 4fecfd7d9e95525755943a76455c7d3a4f60f4a1
Author: Michael Osipov <mi...@apache.org>
AuthorDate: Sun Aug 29 00:19:12 2021 +0200

    [MRESOLVER-193] Properly type lock key names in Redis
---
 .../aether/named/redisson/RedissonReadWriteLockNamedLockFactory.java  | 4 +++-
 .../aether/named/redisson/RedissonSemaphoreNamedLockFactory.java      | 4 +++-
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/maven-resolver-named-locks-redisson/src/main/java/org/eclipse/aether/named/redisson/RedissonReadWriteLockNamedLockFactory.java b/maven-resolver-named-locks-redisson/src/main/java/org/eclipse/aether/named/redisson/RedissonReadWriteLockNamedLockFactory.java
index 647f775..30b7a93 100644
--- a/maven-resolver-named-locks-redisson/src/main/java/org/eclipse/aether/named/redisson/RedissonReadWriteLockNamedLockFactory.java
+++ b/maven-resolver-named-locks-redisson/src/main/java/org/eclipse/aether/named/redisson/RedissonReadWriteLockNamedLockFactory.java
@@ -35,10 +35,12 @@ public class RedissonReadWriteLockNamedLockFactory
 {
     public static final String NAME = "rwlock-redisson";
 
+    private static final String TYPED_NAME_PREFIX = NAME_PREFIX + NAME + ":";
+
     @Override
     protected ReadWriteLockNamedLock createLock( final String name )
     {
-        RReadWriteLock readWriteLock = redissonClient.getReadWriteLock( NAME_PREFIX + name );
+        RReadWriteLock readWriteLock = redissonClient.getReadWriteLock( TYPED_NAME_PREFIX + name );
         return new ReadWriteLockNamedLock( name, this, readWriteLock );
     }
 }
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 8d393ae..e883218 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
@@ -38,6 +38,8 @@ public class RedissonSemaphoreNamedLockFactory
 {
     public static final String NAME = "semaphore-redisson";
 
+    private static final String TYPED_NAME_PREFIX = NAME_PREFIX + NAME + ":";
+
     private final ConcurrentMap<String, RSemaphore> semaphores;
 
     public RedissonSemaphoreNamedLockFactory()
@@ -50,7 +52,7 @@ public class RedissonSemaphoreNamedLockFactory
     {
         RSemaphore semaphore = semaphores.computeIfAbsent( name, k ->
         {
-            RSemaphore result = redissonClient.getSemaphore( NAME_PREFIX + k );
+            RSemaphore result = redissonClient.getSemaphore( TYPED_NAME_PREFIX + k );
             result.trySetPermits( Integer.MAX_VALUE );
             return result;
         } );

[maven-resolver] 01/02: [MRESOLVER-190] [Regression] Revert MRESOLVER-184

Posted by mi...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

michaelo pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/maven-resolver.git

commit e8fb972b1e6bed5c0873a9f9277a5ceff50f8d5c
Author: Michael Osipov <mi...@apache.org>
AuthorDate: Sat Aug 28 20:52:47 2021 +0200

    [MRESOLVER-190] [Regression] Revert MRESOLVER-184
    
    Never delete semaphores from Redis because other Maven processes might
    use it which leads to concurrency issues and build failures.
---
 .../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 73c538a..8d393ae 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
@@ -65,7 +65,9 @@ public class RedissonSemaphoreNamedLockFactory
         {
             throw new IllegalStateException( "Semaphore expected but does not exist: " + name );
         }
-        semaphore.delete();
+        /* Threre is no reasonable way to destroy the semaphore in Redis because we cannot know
+         * when the last process has stopped using it.
+         */
     }
 
     private static final class RedissonSemaphore implements AdaptedSemaphoreNamedLock.AdaptedSemaphore