Skip to content

Commit 5c9062d

Browse files
authored
wait for all the futures in fillLastHistoryEntries() to complete (#4424)
fixes #4333
1 parent 7af3423 commit 5c9062d

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

opengrok-indexer/src/main/java/org/opengrok/indexer/history/FileHistoryCache.java

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -761,6 +761,12 @@ private String getCachedRevision(Repository repository, String revPath) {
761761
return rev;
762762
}
763763

764+
/**
765+
* Attempt to fill the date and description for the input instances from pertaining last history entries.
766+
* @param entries list of {@link DirectoryEntry} instances
767+
* @return true if all of them were filled, false otherwise in which case the date/description field
768+
* for the entries will be zeroed.
769+
*/
764770
@Override
765771
public boolean fillLastHistoryEntries(List<DirectoryEntry> entries) {
766772
if (entries == null) {
@@ -800,15 +806,14 @@ public boolean fillLastHistoryEntries(List<DirectoryEntry> entries) {
800806
}));
801807
}
802808

809+
// Wait for all the futures to complete. This is important as they are modifying the input parameter.
803810
for (Future<Boolean> future : futures) {
804811
try {
805812
if (!future.get()) {
806813
ret = false;
807-
break;
808814
}
809815
} catch (Exception e) {
810816
ret = false;
811-
break;
812817
}
813818
}
814819

0 commit comments

Comments
 (0)