Skip to content

Commit

Permalink
If the chunk fails and we keep the 'slot' as free, make sure to remov…
Browse files Browse the repository at this point in the history
…e the files from disk
  • Loading branch information
autata committed Nov 22, 2024
1 parent 16d8f56 commit 4c67f9e
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -437,6 +437,11 @@ private void handleChunkAssignment(CacheSlotMetadata cacheSlotMetadata) {
// disregarding any errors
setChunkMetadataState(cacheSlotMetadata, Metadata.CacheSlotMetadata.CacheSlotState.FREE);
LOG.error("Error handling chunk assignment", e);
// also clean up downloaded files if the chunk could not be assigned as we're marking the as FREE / available
if (Files.isDirectory(dataDirectory)) {
LOG.info("Cleaning up directory after failed chunk assignment{}", dataDirectory);
cleanDirectory();
}
assignmentTimer.stop(chunkAssignmentTimerFailure);
} finally {
chunkAssignmentLock.unlock();
Expand Down

0 comments on commit 4c67f9e

Please sign in to comment.