Skip to content

Commit

Permalink
load-tsfile: Add retry logic for load memory controls (#12782)
Browse files Browse the repository at this point in the history
  • Loading branch information
SteveYurongSu authored Jun 21, 2024
1 parent 500d4a9 commit 4900407
Showing 1 changed file with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ public static void main(String[] args) {
ioTPrinter.println(
"Successfully load "
+ loadFileSuccessfulNum.sum()
+ " file(s) (--on_success operation(s): "
+ " tsfile(s) (--on_success operation(s): "
+ processingLoadSuccessfulFileSuccessfulNum.sum()
+ " succeed, "
+ (loadFileSuccessfulNum.sum() - processingLoadSuccessfulFileSuccessfulNum.sum())
Expand Down Expand Up @@ -386,6 +386,7 @@ public static void importTsFile() {

try {
sessionPool.executeNonQueryStatement(sql);

loadFileSuccessfulNum.increment();
ioTPrinter.println("Imported [ " + filePath + " ] file successfully!");

Expand All @@ -401,6 +402,14 @@ public static void importTsFile() {
+ processSuccessException.getMessage());
}
} catch (Exception e) {
// Reject because of memory controls, do retry later
if (Objects.nonNull(e.getMessage()) && e.getMessage().contains("memory")) {
ioTPrinter.println(
"Rejecting file [ " + filePath + " ] due to memory constraints, will retry later.");
tsfileQueue.put(filePath);
continue;
}

loadFileFailedNum.increment();
ioTPrinter.println("Failed to import [ " + filePath + " ] file: " + e.getMessage());

Expand Down

0 comments on commit 4900407

Please sign in to comment.