Skip to content

Commit

Permalink
fix batch mode Stuck
Browse files Browse the repository at this point in the history
  • Loading branch information
JNSimba committed Nov 5, 2024
1 parent 6f3efe0 commit f7cf0bf
Showing 1 changed file with 17 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,7 @@ public synchronized void writeRecord(String database, String table, byte[] recor
lock.lock();
try {
while (currentCacheBytes.get() >= maxBlockedBytes) {
checkFlushException();
LOG.info(
"Cache full, waiting for flush, currentBytes: {}, maxBlockedBytes: {}",
currentCacheBytes.get(),
Expand Down Expand Up @@ -486,11 +487,22 @@ public void load(String label, BatchRecordBuffer buffer) throws IOException {
putBuilder.setLabel(label + "_" + retry);
reason = respContent.getMessage();
} else {
String errMsg =
String.format(
"stream load error: %s, see more in %s",
respContent.getMessage(),
respContent.getErrorURL());
String errMsg = null;
if (StringUtils.isBlank(respContent.getMessage())
&& StringUtils.isBlank(respContent.getErrorURL())) {
// sometimes stream load will not return message
errMsg =
String.format(
"stream load error, response is %s",
loadResult);
throw new DorisBatchLoadException(errMsg);
} else {
errMsg =
String.format(
"stream load error: %s, see more in %s",
respContent.getMessage(),
respContent.getErrorURL());
}
throw new DorisBatchLoadException(errMsg);
}
}
Expand Down

0 comments on commit f7cf0bf

Please sign in to comment.