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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to