From dd0b99e781173ace4803bd31501adfed8b792e42 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Wed, 16 Mar 2022 17:13:46 +0100 Subject: [client] Some more logging regarding transfers --- .../java/org/openslx/dozmod/filetransfer/TransferTask.java | 12 +++++++++--- 1 file 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 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 } -- cgit v1.2.3-55-g7522