thomasmueller commented on code in PR #1691:
URL: https://github.com/apache/jackrabbit-oak/pull/1691#discussion_r1746657956
##########
oak-run-commons/src/main/java/org/apache/jackrabbit/oak/index/indexer/document/flatfile/pipelined/PipelinedMongoDownloadTask.java:
##########
@@ -547,15 +547,9 @@ private Future<?>
submitDownloadTask(ExecutorCompletionService<Void> executor, D
try {
downloadTask.download(mongoFilter);
downloadTask.reportFinalResults();
- } catch (InterruptedException | MongoInterruptedException e) {
- LOG.info("Thread interrupted: {}", e.toString());
+ } catch (Throwable e) {
+ LOG.warn("Error during download: {}", e.toString());
Review Comment:
Technically, with InterruptedException we should set the interrupt flag?
##########
oak-run-commons/src/main/java/org/apache/jackrabbit/oak/index/indexer/document/flatfile/FlatFileStoreIterator.java:
##########
@@ -121,8 +121,8 @@ protected NodeStateEntry computeNext() {
private NodeStateEntry computeNextEntry() {
if (!buffer.isEmpty()) {
if (buffer.size() > maxBufferSize || buffer.estimatedMemoryUsage()
> maxBufferSizeBytes) {
- maxBufferSize = buffer.size();
- maxBufferSizeBytes = buffer.estimatedMemoryUsage();
+ maxBufferSize = Math.max(buffer.size(), maxBufferSize);
Review Comment:
Yes the change makes sense.
We could also have to "if" statements and two updates methods (without max),
but then we would need two log statements. Your change is a bit shorter (even
thought, harder to understand).
But the old behavior looks incorrect.
##########
oak-run-commons/src/main/java/org/apache/jackrabbit/oak/index/indexer/document/flatfile/pipelined/PipelinedMongoDownloadTask.java:
##########
@@ -682,8 +677,15 @@ private void download(Bson mongoQueryFilter) throws
InterruptedException, Timeou
downloadRange(nextRange, mongoQueryFilter,
downloadOrder);
}
downloadCompleted = true;
+ } catch (IllegalStateException | InterruptedException |
MongoInterruptedException e) {
+ if (cancelled) {
Review Comment:
Same here with the interrupt flag,
https://www.baeldung.com/java-interrupted-exception
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]