diff options
author | Simon Rettberg | 2019-11-13 17:07:07 +0100 |
---|---|---|
committer | Simon Rettberg | 2019-11-13 17:07:07 +0100 |
commit | 88403537111262d70baa9ad7d17776498adf5619 (patch) | |
tree | 5baecf592a4bead708c482caa6df534f4f7a59fb | |
parent | [TaskStatus] Fix comment (diff) | |
download | taskman-lite-88403537111262d70baa9ad7d17776498adf5619.tar.gz taskman-lite-88403537111262d70baa9ad7d17776498adf5619.tar.xz taskman-lite-88403537111262d70baa9ad7d17776498adf5619.zip |
[daemon] Better error logging, handling of duplicate UUID
-rw-r--r-- | daemon/src/main/java/org/openslx/taskmanager/main/Taskmanager.java | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/daemon/src/main/java/org/openslx/taskmanager/main/Taskmanager.java b/daemon/src/main/java/org/openslx/taskmanager/main/Taskmanager.java index b4df03d..8e55e14 100644 --- a/daemon/src/main/java/org/openslx/taskmanager/main/Taskmanager.java +++ b/daemon/src/main/java/org/openslx/taskmanager/main/Taskmanager.java @@ -98,7 +98,7 @@ public class Taskmanager implements FinishCallback, Runnable try { taskInstance = gson.fromJson( jsonData, taskClass ); } catch ( JsonSyntaxException e ) { - log.warn( "Invocation request for " + task + " with invalid json: " + jsonData ); + log.warn( "Invocation request for " + task + " with invalid json: " + jsonData, e ); return TaskStatus.ts_jsonError; } if ( taskInstance == null ) { @@ -111,7 +111,8 @@ public class Taskmanager implements FinishCallback, Runnable } // Now check for id collision synchronized ( instances ) { - if ( instances.containsKey( taskInstance.getId() ) ) { + AbstractTask existing = instances.get( taskInstance.getId() ); + if ( existing != null && !existing.isFinished() ) { log.info( "Ignoring task invocation of " + task + ": Duplicate ID: " + taskInstance.getId() ); return TaskStatus.ts_duplicateId; } |