Skip to content

Commit

Permalink
update retry
Browse files Browse the repository at this point in the history
  • Loading branch information
nianliuu committed Oct 31, 2024
1 parent f6e7a13 commit bdb669d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ private void upsertWrite(String partitionName, List<JsonObject> data)
} catch (Exception e) {
if (e.getMessage().contains("rate limit exceeded")
|| e.getMessage().contains("received message larger than max")) {
if (data.size() > 10) {
if (data.size() > 2) {
log.warn("upsert data failed, retry in smaller chunks: {} ", data.size() / 2);
this.batchSize = this.batchSize / 2;
log.info("sleep 1 minute to avoid rate limit");
Expand All @@ -306,7 +306,6 @@ private void upsertWrite(String partitionName, List<JsonObject> data)
e);
}
}
log.info("upsert data success");
}

private void insertWrite(String partitionName, List<JsonObject> data) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ private void queryIteratorData(
}
}
} catch (Exception e) {
if (e.getMessage().contains("rate limit exceeded") && batchSize > 10) {
if ((e.getMessage().contains("rate limit exceeded") || e.getMessage().contains("received message larger than max")) && batchSize > 1) {
log.error(
"Query Iterate data from milvus failed, retry from beginning with smaller batch size: {} after 30 s",
batchSize / 2,
Expand Down

0 comments on commit bdb669d

Please sign in to comment.