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:22:32 UTC
[GitHub] [shardingsphere] sandynz commented on a change in pull request #16523: Fix is locked schema NPE
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