[fix](column-id) fix null conn ctx in column id flusher and parser for database field in corresponding show stmt (#25393)

This commit is contained in:
Siyang Tang
2023-10-18 14:11:31 +08:00
committed by GitHub
parent 76abbfc555
commit 0ec537edef
4 changed files with 16 additions and 6 deletions

View File

@ -65,13 +65,23 @@ public class AlterLightSchChangeHelper {
private static final Logger LOG = LogManager.getLogger(AlterLightSchChangeHelper.class);
private static final long DEFAULT_RPC_TIMEOUT = 900L;
private final Database db;
private final OlapTable olapTable;
private final long rpcTimoutMs;
public AlterLightSchChangeHelper(Database db, OlapTable olapTable) {
this.db = db;
this.olapTable = olapTable;
ConnectContext connectContext = ConnectContext.get();
if (connectContext == null) {
rpcTimoutMs = DEFAULT_RPC_TIMEOUT * 1000L;
} else {
rpcTimoutMs = connectContext.getExecTimeout() * 1000L;
}
}
/**
@ -158,7 +168,7 @@ public class AlterLightSchChangeHelper {
}
// wait for and get results
final long start = System.currentTimeMillis();
long timeoutMs = ConnectContext.get().getExecTimeout() * 1000L;
long timeoutMs = rpcTimoutMs;
final List<PFetchColIdsResponse> resultList = new ArrayList<>();
try {
for (Map.Entry<Long, Future<PFetchColIdsResponse>> entry : beIdToRespFuture.entrySet()) {