You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by GitBox <gi...@apache.org> on 2021/05/26 17:45:38 UTC

[GitHub] [maven-resolver] michael-o opened a new pull request #108: [MRESOLVER-184] Destroy Redisson semaphores if not used anymore

michael-o opened a new pull request #108:
URL: https://github.com/apache/maven-resolver/pull/108


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [maven-resolver] cstamas edited a comment on pull request #108: [MRESOLVER-184] Destroy Redisson semaphores if not used anymore

Posted by GitBox <gi...@apache.org>.
cstamas edited a comment on pull request #108:
URL: https://github.com/apache/maven-resolver/pull/108#issuecomment-850164274


   IMO -1 for this PR (but +1 for removal of semaphores, but let's do it differently), let me explain:
   a) you do same thing as lock factory (map of locks by name), repeating 
   b) lets add new method (ie. `destroy()`) on NamedLockSupport that is by default noop, and is overridden by those (redis, hz) that needs to do something when lock destroyed by factory (as ref count goes to 0).
   
   This way, all this PR becomes just a change in `createLock` method, where you override `destroy` method of created NamedLockSupport. WDYT?
   
   This cleans up this flow as well: lock.close -> factory.close -IF refCount = 0-> destroyLock -> lock.destroy


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [maven-resolver] michael-o commented on pull request #108: [MRESOLVER-184] Destroy Redisson semaphores if not used anymore

Posted by GitBox <gi...@apache.org>.
michael-o commented on pull request #108:
URL: https://github.com/apache/maven-resolver/pull/108#issuecomment-860259341


   Superseded by #111.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [maven-resolver] cstamas commented on pull request #108: [MRESOLVER-184] Destroy Redisson semaphores if not used anymore

Posted by GitBox <gi...@apache.org>.
cstamas commented on pull request #108:
URL: https://github.com/apache/maven-resolver/pull/108#issuecomment-850164274


   IMO -1 for this PR (but +1 for removal of semaphores, but let's do it differently), let me explain:
   a) you do same thing as lock factory (map of locks by name), repeating 
   b) lets add new method (ie. `destroy()`) on NamedLockSupport that is by default noop, and is overridden by those (redis, hz) that needs to do something when lock destroyed by factory (as ref count goes to 0).
   
   This way, all this PR becomes just a change in `createLock` method, where you override `destroy` method of created NamedLockSupport. WDYT?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [maven-resolver] cstamas commented on pull request #108: [MRESOLVER-184] Destroy Redisson semaphores if not used anymore

Posted by GitBox <gi...@apache.org>.
cstamas commented on pull request #108:
URL: https://github.com/apache/maven-resolver/pull/108#issuecomment-850257311


   Alternate PR https://github.com/apache/maven-resolver/pull/110


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [maven-resolver] michael-o closed pull request #108: [MRESOLVER-184] Destroy Redisson semaphores if not used anymore

Posted by GitBox <gi...@apache.org>.
michael-o closed pull request #108:
URL: https://github.com/apache/maven-resolver/pull/108


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [maven-resolver] cstamas commented on a change in pull request #108: [MRESOLVER-184] Destroy Redisson semaphores if not used anymore

Posted by GitBox <gi...@apache.org>.
cstamas commented on a change in pull request #108:
URL: https://github.com/apache/maven-resolver/pull/108#discussion_r641290295



##########
File path: maven-resolver-named-locks-redisson/src/main/java/org/eclipse/aether/named/redisson/RedissonSemaphoreNamedLockFactory.java
##########
@@ -37,12 +41,31 @@
 {
     public static final String NAME = "semaphore-redisson";
 
+    private final ConcurrentMap<String, RSemaphore> semaphores;
+
+    @Inject
+    public RedissonSemaphoreNamedLockFactory()
+    {
+        super();

Review comment:
       ?




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org