Skip to content

Commit

Permalink
fix(issue1526): avoid completing future before search complete (AutoM…
Browse files Browse the repository at this point in the history
…Q#1531)

Signed-off-by: Shichao Nie <[email protected]>
  • Loading branch information
SCNieh authored Jul 9, 2024
1 parent 801649d commit 7d92cc0
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,6 @@ void getObjects0(GetObjectsContext ctx) {
int streamSetObjectIndex = 0;
fillObjects(ctx, stream, objects, lastRangeIndex, streamObjectIndex, streamObjects, streamSetObjectIndex,
null, null);
ctx.cf.complete(new InRangeObjects(streamId, objects));
}

void fillObjects(GetObjectsContext ctx, S3StreamMetadataImage stream, List<S3ObjectMetadata> objects, int lastRangeIndex,
Expand Down Expand Up @@ -200,6 +199,7 @@ void fillObjects(GetObjectsContext ctx, S3StreamMetadataImage stream, List<S3Obj
// 1. can not find the range containing nextStartOffset, or
// 2. the range is the same as the last one, which means the nextStartOffset does not move on.
if (rangeIndex < 0 || lastRangeIndex == rangeIndex) {
ctx.cf.complete(new InRangeObjects(ctx.streamId, objects));
break;
}
lastRangeIndex = rangeIndex;
Expand Down

0 comments on commit 7d92cc0

Please sign in to comment.