in flume-hdfs-sink/src/main/java/org/apache/flume/sink/hdfs/BucketWriter.java [341:364]
public void close(boolean immediate) {
closeTries++;
boolean shouldRetry = closeTries < maxRetries && !immediate;
try {
callWithTimeout(createCloseCallRunner());
sinkCounter.incrementConnectionClosedCount();
} catch (InterruptedException | IOException e) {
LOG.warn("Closing file: " + path + " failed. Will " +
"retry again in " + retryInterval + " seconds.", e);
if (timedRollerPool != null && !timedRollerPool.isTerminated()) {
if (shouldRetry) {
timedRollerPool.schedule(this, retryInterval, TimeUnit.SECONDS);
}
} else {
LOG.warn("Cannot retry close any more timedRollerPool is null or terminated");
}
if (!shouldRetry) {
LOG.warn("Unsuccessfully attempted to close " + path + " " +
maxRetries + " times. Initializing lease recovery.");
sinkCounter.incrementConnectionFailedCount();
recoverLease();
}
}
}