Skip to content

Commit 4429e5b

Browse files
authored
fix set setRpcExecuteTimeout nullpointer (#415)
1 parent 544831d commit 4429e5b

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

src/main/java/com/alipay/oceanbase/rpc/ObTableClient.java

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -904,19 +904,21 @@ public void eraseTableEntry(String tableName) {
904904
public void setRpcExecuteTimeout(int rpcExecuteTimeout) {
905905
this.properties.put(RPC_EXECUTE_TIMEOUT.getKey(), String.valueOf(rpcExecuteTimeout));
906906
this.rpcExecuteTimeout = rpcExecuteTimeout;
907-
if (tableRoute != null) {
908-
ConcurrentHashMap<ObServerAddr, ObTable> tableRoster = tableRoute.getTableRoster().getTables();
907+
if (odpMode) {
908+
ObTable odpTable = tableRoute.getOdpTable();
909+
if (null != odpTable) {
910+
odpTable.setObTableExecuteTimeout(rpcExecuteTimeout);
911+
}
912+
} else {
913+
TableRoster tableRoster = tableRoute.getTableRoster();
909914
if (null != tableRoster) {
910-
for (ObTable obTable : tableRoster.values()) {
911-
if (obTable != null) {
915+
ConcurrentHashMap<ObServerAddr, ObTable> addTableMap = tableRoster.getTables();
916+
for (ObTable obTable : addTableMap.values()) {
917+
if (null != obTable) {
912918
obTable.setObTableExecuteTimeout(rpcExecuteTimeout);
913919
}
914920
}
915921
}
916-
ObTable odpTable = tableRoute.getOdpTable();
917-
if (null != odpTable) {
918-
odpTable.setObTableExecuteTimeout(rpcExecuteTimeout);
919-
}
920922
}
921923
}
922924

0 commit comments

Comments
 (0)