You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by GitBox <gi...@apache.org> on 2022/03/31 12:18:20 UTC

[GitHub] [shardingsphere] soulasuna opened a new pull request #16523: Fix is locked schema NPE

soulasuna opened a new pull request #16523:
URL: https://github.com/apache/shardingsphere/pull/16523


   ## Fix is locked schema NPE
   
   Related to #16269.
   
   Changes proposed in this pull request:
   - Fix is locked schema NPE.
   


-- 
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: notifications-unsubscribe@shardingsphere.apache.org

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



[GitHub] [shardingsphere] sandynz merged pull request #16523: Fix is locked schema NPE

Posted by GitBox <gi...@apache.org>.
sandynz merged pull request #16523:
URL: https://github.com/apache/shardingsphere/pull/16523


   


-- 
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: notifications-unsubscribe@shardingsphere.apache.org

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



[GitHub] [shardingsphere] soulasuna commented on a change in pull request #16523: Fix is locked schema NPE

Posted by GitBox <gi...@apache.org>.
soulasuna commented on a change in pull request #16523:
URL: https://github.com/apache/shardingsphere/pull/16523#discussion_r839542208



##########
File path: shardingsphere-mode/shardingsphere-mode-type/shardingsphere-memory-mode/shardingsphere-memory-mode-core/src/main/java/org/apache/shardingsphere/mode/manager/memory/lock/MemoryLockContext.java
##########
@@ -56,7 +58,6 @@ public ShardingSphereLock getOrCreateSchemaLock(final String schemaName) {
     
     @Override
     public boolean isLockedSchema(final String schemaName) {
-        ShardingSphereLock shardingSphereLock = locks.get(schemaName);
-        return null != shardingSphereLock && shardingSphereLock.isLocked(schemaName);
+        return null != schemaName && null != locks.get(schemaName) && locks.get(schemaName).isLocked(schemaName);
     }

Review comment:
       I will fix.




-- 
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: notifications-unsubscribe@shardingsphere.apache.org

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



[GitHub] [shardingsphere] sandynz commented on pull request #16523: Fix is locked schema NPE

Posted by GitBox <gi...@apache.org>.
sandynz commented on pull request #16523:
URL: https://github.com/apache/shardingsphere/pull/16523#issuecomment-1084523444


   Local test is passed.


-- 
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: notifications-unsubscribe@shardingsphere.apache.org

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



[GitHub] [shardingsphere] sandynz commented on a change in pull request #16523: Fix is locked schema NPE

Posted by GitBox <gi...@apache.org>.
sandynz commented on a change in pull request #16523:
URL: https://github.com/apache/shardingsphere/pull/16523#discussion_r839541586



##########
File path: shardingsphere-mode/shardingsphere-mode-type/shardingsphere-memory-mode/shardingsphere-memory-mode-core/src/main/java/org/apache/shardingsphere/mode/manager/memory/lock/MemoryLockContext.java
##########
@@ -56,7 +58,6 @@ public ShardingSphereLock getOrCreateSchemaLock(final String schemaName) {
     
     @Override
     public boolean isLockedSchema(final String schemaName) {
-        ShardingSphereLock shardingSphereLock = locks.get(schemaName);
-        return null != shardingSphereLock && shardingSphereLock.isLocked(schemaName);
+        return null != schemaName && null != locks.get(schemaName) && locks.get(schemaName).isLocked(schemaName);
     }

Review comment:
       `locks.get(schemaName)` run 2 times, the second time of `locks.get(schemaName)` might return different value as the first result.




-- 
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: notifications-unsubscribe@shardingsphere.apache.org

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