You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@helix.apache.org by GitBox <gi...@apache.org> on 2021/10/12 03:43:17 UTC

[GitHub] [helix] hungvm90 opened a new issue #1893: Why LockListener is not public

hungvm90 opened a new issue #1893:
URL: https://github.com/apache/helix/issues/1893


   ### Describe the bug
   interface LockListener {
     /**
      * call back called when the lock is preempted
      */
     void onCleanupNotification();
   }
   This interface should be public
   
   ### To Reproduce
   When not set LockListener, try to lock with higher priority, it throw "Cleanup has not been finished by lock owner"
   
   ### Expected behavior
   interface LockListener should be public, or when not set LockListener, it should be pass
   
   ### Additional context
   Add any other context about the problem here.
   


-- 
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.

To unsubscribe, e-mail: reviews-unsubscribe@helix.apache.org

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



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@helix.apache.org
For additional commands, e-mail: reviews-help@helix.apache.org


[GitHub] [helix] hungvm90 edited a comment on issue #1893: Why LockListener is not public

Posted by GitBox <gi...@apache.org>.
hungvm90 edited a comment on issue #1893:
URL: https://github.com/apache/helix/issues/1893#issuecomment-1021235151


   Sorry, my description for this issue is not correct, but I think LockListener should be public.
   For example, I implement lock with priority, so I need ack when I lose this lock. But LockListener is not public, so I can't implement it.
   
   > lock = new ZKDistributedNonblockingLock.Builder()
                   .setLockScope(new HelixLockScope(HelixLockScope.LockScopeProperty.RESOURCE, pathKeys))
                   .setZkAddress(zooKeeperHost)
                   .setUserId(instanceName)
                   .setTimeout(timeout)
                   .setPriority(LOCK_LOW_PRIORITY)
                   .setLockListener(new LockListener() {
                       @Override
                       public void onCleanupNotification() {
                           for (LockLoseListener listener : listeners) {
                               listener.onLoseLock(lock);
                           }
                       }
                   })
                   .setLockMsg(String.format("Lock %s from %s", resource, instanceName))
                   .build();


-- 
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.

To unsubscribe, e-mail: reviews-unsubscribe@helix.apache.org

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



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@helix.apache.org
For additional commands, e-mail: reviews-help@helix.apache.org


[GitHub] [helix] hungvm90 edited a comment on issue #1893: Why LockListener is not public

Posted by GitBox <gi...@apache.org>.
hungvm90 edited a comment on issue #1893:
URL: https://github.com/apache/helix/issues/1893#issuecomment-1021235151


   Sorry, my description for this issue is not correct, but I think LockListener should be public.
   For example, I implement lock with priority, so I need ack when I lose this lock. But LockListener is not public, so I can't implement it.
   
   `lock = new ZKDistributedNonblockingLock.Builder()
                   .setLockScope(new HelixLockScope(HelixLockScope.LockScopeProperty.RESOURCE, pathKeys))
                   .setZkAddress(zooKeeperHost)
                   .setUserId(instanceName)
                   .setTimeout(timeout)
                   .setPriority(LOCK_LOW_PRIORITY)
                   .setLockListener(new LockListener() {
                       @Override
                       public void onCleanupNotification() {
                           for (LockLoseListener listener : listeners) {
                               listener.onLoseLock(lock);
                           }
                       }
                   })
                   .setLockMsg(String.format("Lock %s from %s", resource, instanceName))
                   .build();`


-- 
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.

To unsubscribe, e-mail: reviews-unsubscribe@helix.apache.org

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



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@helix.apache.org
For additional commands, e-mail: reviews-help@helix.apache.org


[GitHub] [helix] mgao0 edited a comment on issue #1893: Why LockListener is not public

Posted by GitBox <gi...@apache.org>.
mgao0 edited a comment on issue #1893:
URL: https://github.com/apache/helix/issues/1893#issuecomment-1004269728


   @zhangmeng916 Is not set LockListener an expected user behavior? I tried making LockListener public, but it didn't solve the problem because not setting LockListener will cause NPE, no matter if the interface is public or not. 


-- 
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.

To unsubscribe, e-mail: reviews-unsubscribe@helix.apache.org

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



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@helix.apache.org
For additional commands, e-mail: reviews-help@helix.apache.org


[GitHub] [helix] zhangmeng916 commented on issue #1893: Why LockListener is not public

Posted by GitBox <gi...@apache.org>.
zhangmeng916 commented on issue #1893:
URL: https://github.com/apache/helix/issues/1893#issuecomment-1004327379


   @hungvm90 The LockListener needs to be set for the lock to be able to work, since it listens on Zookeeper once there is any change in the lock path.


-- 
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.

To unsubscribe, e-mail: reviews-unsubscribe@helix.apache.org

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



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@helix.apache.org
For additional commands, e-mail: reviews-help@helix.apache.org


[GitHub] [helix] hungvm90 commented on issue #1893: Why LockListener is not public

Posted by GitBox <gi...@apache.org>.
hungvm90 commented on issue #1893:
URL: https://github.com/apache/helix/issues/1893#issuecomment-1021235151


   Sorry, my description for this issue is not correct, but I think LockListener should be public.
   For example, I implement lock with priority, so I need ack when I lose this lock. But LockListener is not public, so I can't implement it.
   
   lock = new ZKDistributedNonblockingLock.Builder()
                   .setLockScope(new HelixLockScope(HelixLockScope.LockScopeProperty.RESOURCE, pathKeys))
                   .setZkAddress(zooKeeperHost)
                   .setUserId(instanceName)
                   .setTimeout(timeout)
                   .setPriority(LOCK_LOW_PRIORITY)
                   .setLockListener(new LockListener() {
                       @Override
                       public void onCleanupNotification() {
                           for (LockLoseListener listener : listeners) {
                               listener.onLoseLock(lock);
                           }
                       }
                   })
                   .setLockMsg(String.format("Lock %s from %s", resource, instanceName))
                   .build();


-- 
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.

To unsubscribe, e-mail: reviews-unsubscribe@helix.apache.org

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



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@helix.apache.org
For additional commands, e-mail: reviews-help@helix.apache.org


[GitHub] [helix] mgao0 commented on issue #1893: Why LockListener is not public

Posted by GitBox <gi...@apache.org>.
mgao0 commented on issue #1893:
URL: https://github.com/apache/helix/issues/1893#issuecomment-1004269728


   @zhangmeng916 Is not set LockListener an expected user behavior? I tried making LockListener public, but it didn't solve the problem.


-- 
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.

To unsubscribe, e-mail: reviews-unsubscribe@helix.apache.org

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



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@helix.apache.org
For additional commands, e-mail: reviews-help@helix.apache.org


[GitHub] [helix] hungvm90 edited a comment on issue #1893: Why LockListener is not public

Posted by GitBox <gi...@apache.org>.
hungvm90 edited a comment on issue #1893:
URL: https://github.com/apache/helix/issues/1893#issuecomment-1021235151






-- 
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.

To unsubscribe, e-mail: reviews-unsubscribe@helix.apache.org

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



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@helix.apache.org
For additional commands, e-mail: reviews-help@helix.apache.org


[GitHub] [helix] junkaixue commented on issue #1893: Why LockListener is not public

Posted by GitBox <gi...@apache.org>.
junkaixue commented on issue #1893:
URL: https://github.com/apache/helix/issues/1893#issuecomment-942504543


   Thanks @hungvm90. Will let original author to fix it.


-- 
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.

To unsubscribe, e-mail: reviews-unsubscribe@helix.apache.org

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



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@helix.apache.org
For additional commands, e-mail: reviews-help@helix.apache.org


[GitHub] [helix] junkaixue commented on issue #1893: Why LockListener is not public

Posted by GitBox <gi...@apache.org>.
junkaixue commented on issue #1893:
URL: https://github.com/apache/helix/issues/1893#issuecomment-942504543


   Thanks @hungvm90. Will let original author to fix it.


-- 
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.

To unsubscribe, e-mail: reviews-unsubscribe@helix.apache.org

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



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@helix.apache.org
For additional commands, e-mail: reviews-help@helix.apache.org


[GitHub] [helix] junkaixue commented on issue #1893: Why LockListener is not public

Posted by GitBox <gi...@apache.org>.
junkaixue commented on issue #1893:
URL: https://github.com/apache/helix/issues/1893#issuecomment-954161379


   @mgao0 


-- 
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.

To unsubscribe, e-mail: reviews-unsubscribe@helix.apache.org

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



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@helix.apache.org
For additional commands, e-mail: reviews-help@helix.apache.org


[GitHub] [helix] hungvm90 commented on issue #1893: Why LockListener is not public

Posted by GitBox <gi...@apache.org>.
hungvm90 commented on issue #1893:
URL: https://github.com/apache/helix/issues/1893#issuecomment-1021235151


   Sorry, my description for this issue is not correct, but I think LockListener should be public.
   For example, I implement lock with priority, so I need ack when I lose this lock. But LockListener is not public, so I can't implement it.
   
   lock = new ZKDistributedNonblockingLock.Builder()
                   .setLockScope(new HelixLockScope(HelixLockScope.LockScopeProperty.RESOURCE, pathKeys))
                   .setZkAddress(zooKeeperHost)
                   .setUserId(instanceName)
                   .setTimeout(timeout)
                   .setPriority(LOCK_LOW_PRIORITY)
                   .setLockListener(new LockListener() {
                       @Override
                       public void onCleanupNotification() {
                           for (LockLoseListener listener : listeners) {
                               listener.onLoseLock(lock);
                           }
                       }
                   })
                   .setLockMsg(String.format("Lock %s from %s", resource, instanceName))
                   .build();


-- 
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.

To unsubscribe, e-mail: reviews-unsubscribe@helix.apache.org

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



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@helix.apache.org
For additional commands, e-mail: reviews-help@helix.apache.org