From 871fab1a8be393f64a7998e6f2e31e2caea05ae9 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Wed, 24 Feb 2016 17:54:42 +0100 Subject: [server] Log if an upload is aborted due to lack of disk space --- .../java/org/openslx/bwlp/sat/fileserv/IncomingDataTransfer.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'dozentenmodulserver/src/main/java') diff --git a/dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/fileserv/IncomingDataTransfer.java b/dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/fileserv/IncomingDataTransfer.java index 7bad59a3..92f533e8 100644 --- a/dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/fileserv/IncomingDataTransfer.java +++ b/dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/fileserv/IncomingDataTransfer.java @@ -489,8 +489,12 @@ public class IncomingDataTransfer extends AbstractTransfer implements HashCheckC return null; // No more chunks, returning null tells the Downloader we're done. } // Check remaining disk space and abort if it's too low - if (FileSystem.getAvailableStorageBytes() < MIN_FREE_SPACE_BYTES) { + long space = FileSystem.getAvailableStorageBytes(); + if (space != -1 && space < MIN_FREE_SPACE_BYTES) { downloader.sendErrorCode("Out of disk space"); + LOGGER.error("Out of space: Cancelling upload of " + + (image == null ? "image" : image.imageName) + " by " + + Formatter.userFullName(owner)); cancel(); return null; } -- cgit v1.2.3-55-g7522