diff options
author | Simon Rettberg | 2022-03-16 17:13:46 +0100 |
---|---|---|
committer | Simon Rettberg | 2022-03-16 17:13:46 +0100 |
commit | dd0b99e781173ace4803bd31501adfed8b792e42 (patch) | |
tree | 5038f51b4abf160bd781a32ae9eaeb9b7ca56eb3 | |
parent | [client] Better log cancel/failure reason for uploads (diff) | |
download | tutor-module-dd0b99e781173ace4803bd31501adfed8b792e42.tar.gz tutor-module-dd0b99e781173ace4803bd31501adfed8b792e42.tar.xz tutor-module-dd0b99e781173ace4803bd31501adfed8b792e42.zip |
[client] Some more logging regarding transfers
-rw-r--r-- | dozentenmodul/src/main/java/org/openslx/dozmod/filetransfer/TransferTask.java | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/dozentenmodul/src/main/java/org/openslx/dozmod/filetransfer/TransferTask.java b/dozentenmodul/src/main/java/org/openslx/dozmod/filetransfer/TransferTask.java index 4fa06592..cca42929 100644 --- a/dozentenmodul/src/main/java/org/openslx/dozmod/filetransfer/TransferTask.java +++ b/dozentenmodul/src/main/java/org/openslx/dozmod/filetransfer/TransferTask.java @@ -69,6 +69,7 @@ public abstract class TransferTask implements Runnable, TransferEventEmitter { ensureActivity(); Util.sleep(UPDATE_INTERVAL_MS); } + LOGGER.info("Transfer worker mainloop finished"); List<TransferThread> joinList = new ArrayList<>(); synchronized (transfers) { isCancelled = true; @@ -84,6 +85,7 @@ public abstract class TransferTask implements Runnable, TransferEventEmitter { Util.joinThread(t); } cleanup(); + LOGGER.info("Trasfer worker exiting"); } protected void cleanup() { @@ -195,8 +197,8 @@ public abstract class TransferTask implements Runnable, TransferEventEmitter { protected final void connectFailed(TransferThread thread) { synchronized (transfers) { connectingTransfers.remove(thread); - if (transfers.size() > 0) - return; + LOGGER.info("Establishing new transfer connection failed, [a:" + transfers.size() + "/c:" + + connectingTransfers.size() + "]"); } } @@ -205,6 +207,8 @@ public abstract class TransferTask implements Runnable, TransferEventEmitter { connectingTransfers.remove(thread); if (!isCancelled) { transfers.add(thread); + LOGGER.info("Establishing new transfer connection succeeded, [a:" + transfers.size() + "/c:" + + connectingTransfers.size() + "]"); return; } } @@ -215,6 +219,8 @@ public abstract class TransferTask implements Runnable, TransferEventEmitter { protected final void transferEnded(TransferThread thread, boolean success) { synchronized (transfers) { transfers.remove(thread); + LOGGER.info("A transfer connection has finished (success=" + success + "), [a:" + transfers.size() + "/c:" + + connectingTransfers.size() + "]"); if (endgame && !success && transfers.isEmpty()) { // We had a transfer that reported success before, so we assume there are no more pending blocks // not being actively transfered already. Only trigger a new upload if this was the last active @@ -226,7 +232,7 @@ public abstract class TransferTask implements Runnable, TransferEventEmitter { endgame = true; } if (success && transfers.isEmpty()) { - LOGGER.debug("Transfer might have finished"); + LOGGER.debug("Transfer might have finished, waiting for server"); lastConnectionAttempt = System.currentTimeMillis() + 3000; // Throttle reconnects return; // Skip ensureActivity check } |