Skip to content

Avoid 301/305 code about fetch schema failed #15813

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 25, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,10 @@ Map<IDeviceID, Map<String, Binary>> fetchMissingDeviceSchemaForDataInsertion(
throw AsyncSendPlanNodeHandler.needRetry(e)
? new IoTDBRuntimeException(
e.getCause(), TSStatusCode.SYNC_CONNECTION_ERROR.getStatusCode())
: new RuntimeException("Fetch Table Device Schema failed. ", e);
: new IoTDBRuntimeException(
String.format("Fetch Table Device Schema failed because %s", e.getMessage()),
e.getErrorCode(),
e.isUserException());
}
if (!tsBlock.isPresent() || tsBlock.get().isEmpty()) {
break;
Expand Down Expand Up @@ -476,16 +479,16 @@ private void fetchMissingDeviceSchemaForQuery(
: mppQueryContext.getSession(),
String.format(
"fetch device for query %s : %s",
mppQueryContext.getQueryId(), mppQueryContext.getSql()),
mppQueryContext == null ? "unknown" : mppQueryContext.getQueryId(),
mppQueryContext == null ? "unknown" : mppQueryContext.getSql()),
LocalExecutionPlanner.getInstance().metadata,
mppQueryContext.getTimeOut()
- (System.currentTimeMillis() - mppQueryContext.getStartTime()),
false);

if (executionResult.status.getCode() != TSStatusCode.SUCCESS_STATUS.getStatusCode()) {
throw new RuntimeException(
new IoTDBException(
executionResult.status.getMessage(), executionResult.status.getCode()));
throw new IoTDBRuntimeException(
executionResult.status.getMessage(), executionResult.status.getCode());
}

final List<ColumnHeader> columnHeaderList =
Expand All @@ -497,7 +500,10 @@ private void fetchMissingDeviceSchemaForQuery(
tsBlock = coordinator.getQueryExecution(queryId).getBatchResult();
} catch (final IoTDBException e) {
t = e;
throw new RuntimeException("Fetch Table Device Schema failed. ", e);
throw new IoTDBRuntimeException(
String.format("Fetch Table Device Schema failed because %s", e.getMessage()),
e.getErrorCode(),
e.isUserException());
}
if (!tsBlock.isPresent() || tsBlock.get().isEmpty()) {
break;
Expand Down
Loading