diff options
| author | Jonathan Bauer | 2016-02-25 17:01:07 +0100 |
|---|---|---|
| committer | Jonathan Bauer | 2016-02-25 17:01:07 +0100 |
| commit | 4645342521f11c4b96a4fe07fc09dcfaee9ad4fd (patch) | |
| tree | 6847b0011cc468b67f10bec68f75c9abfa7123fb /dozentenmodulserver/src/main/java | |
| parent | [client] fix stupid way of getting the sat's address for the root node of the... (diff) | |
| parent | [server] Log delete actions on images (diff) | |
| download | tutor-module-4645342521f11c4b96a4fe07fc09dcfaee9ad4fd.tar.gz tutor-module-4645342521f11c4b96a4fe07fc09dcfaee9ad4fd.tar.xz tutor-module-4645342521f11c4b96a4fe07fc09dcfaee9ad4fd.zip | |
Merge branch 'v1.1' of git.openslx.org:openslx-ng/tutor-module into v1.1
Diffstat (limited to 'dozentenmodulserver/src/main/java')
3 files changed, 16 insertions, 1 deletions
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; } diff --git a/dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/thrift/ServerHandler.java b/dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/thrift/ServerHandler.java index 3244ac95..0ea9921d 100644 --- a/dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/thrift/ServerHandler.java +++ b/dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/thrift/ServerHandler.java @@ -29,6 +29,7 @@ import org.openslx.bwlp.sat.thrift.cache.OperatingSystemList; import org.openslx.bwlp.sat.thrift.cache.OrganizationList; import org.openslx.bwlp.sat.thrift.cache.VirtualizerList; import org.openslx.bwlp.sat.util.FileSystem; +import org.openslx.bwlp.sat.util.Formatter; import org.openslx.bwlp.sat.util.Sanitizer; import org.openslx.bwlp.sat.util.Util; import org.openslx.bwlp.thrift.iface.AuthorizationError; @@ -358,8 +359,13 @@ public class ServerHandler implements SatelliteServer.Iface { throw new TInvocationException(InvocationError.INTERNAL_SERVER_ERROR, "VM storage not mounted"); User.canDeleteImageVersionOrFail(user, imageVersionId); try { + ImageSummaryRead imageSummary = DbImage.getImageSummary(user, + DbImage.getBaseIdForVersionId(imageVersionId)); DbImage.markForDeletion(imageVersionId); DbImage.setDeletion(DeleteState.WANT_DELETE, imageVersionId); + LOGGER.info(Formatter.userFullName(user) + " (" + user.userId + ") deleted Version " + + imageVersionId + " of " + imageSummary.imageName + " (" + imageSummary.imageBaseId + + ")"); } catch (SQLException e) { throw new TInvocationException(); } @@ -393,6 +399,9 @@ public class ServerHandler implements SatelliteServer.Iface { } DeleteOldImages.hardDeleteImages(); } + LOGGER.info(Formatter.userFullName(user) + " (" + user.userId + ") deleted Image " + + imageDetails.imageName + " (" + imageDetails.imageBaseId + ") with all its versions (" + + index + ")"); try { DbImage.deleteBasePermanently(imageBaseId); } catch (SQLException e) { diff --git a/dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/util/Formatter.java b/dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/util/Formatter.java index d242d5be..f13df0eb 100644 --- a/dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/util/Formatter.java +++ b/dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/util/Formatter.java @@ -57,6 +57,8 @@ public class Formatter { } public static String userFullName(UserInfo ui) { + if (ui == null) + return "null"; return ui.firstName + " " + ui.lastName; } |
