From eb0989b573086d12e9bce385a2d1ee59881d1b8c Mon Sep 17 00:00:00 2001 From: Diego Lovison Date: Fri, 3 Jan 2025 15:25:22 -0300 Subject: [PATCH] more log --- .../java/io/hyperfoil/tools/qdup/cmd/Dispatcher.java | 6 +++--- .../java/io/hyperfoil/tools/qdup/cmd/ScriptContext.java | 9 ++++++++- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/src/main/java/io/hyperfoil/tools/qdup/cmd/Dispatcher.java b/src/main/java/io/hyperfoil/tools/qdup/cmd/Dispatcher.java index 6ccad245..bf529ffc 100644 --- a/src/main/java/io/hyperfoil/tools/qdup/cmd/Dispatcher.java +++ b/src/main/java/io/hyperfoil/tools/qdup/cmd/Dispatcher.java @@ -376,7 +376,7 @@ public void start(){ //start all the scripts attached to this dispatcher if(!scriptContexts.isEmpty()){ logger.info("starting {} scripts", scriptContexts.size()); if(nannyFuture == null) { - logger.debug("starting nanny"); + logger.info("starting nanny"); nannyFuture = scheduler.scheduleAtFixedRate(() -> { long timestamp = System.currentTimeMillis(); nannyTask.accept(timestamp); @@ -385,7 +385,7 @@ public void start(){ //start all the scripts attached to this dispatcher for(Cmd script : scriptContexts.keySet()){ ScriptContext contextResult = scriptContexts.get(script); scriptObservers.forEach(observer -> observer.onStart(contextResult)); - logger.trace("queueing\n host={}\n script={}", + logger.info("queueing\n host={}\n script={}", contextResult.getShell().getHost().getHostName(), script); contextResult.getContextTimer().start("waiting in run queue"); @@ -397,7 +397,7 @@ public void start(){ //start all the scripts attached to this dispatcher }else{ logger.info("cannot start an already active Dispatcher"); } - logger.trace("start"); + logger.info("start"); } diff --git a/src/main/java/io/hyperfoil/tools/qdup/cmd/ScriptContext.java b/src/main/java/io/hyperfoil/tools/qdup/cmd/ScriptContext.java index 76cc75e3..217029b5 100644 --- a/src/main/java/io/hyperfoil/tools/qdup/cmd/ScriptContext.java +++ b/src/main/java/io/hyperfoil/tools/qdup/cmd/ScriptContext.java @@ -454,13 +454,20 @@ public void run(Cmd cmd,String input){ if (!lineQueue.isEmpty()) {//clear any unhandled output lines //TODO log that we are clearing orphaned lines //need to make sure we don't clear if another thread needs to pickup up the CLOSE_QUEUE + logger.info("here 1"); try{ + logger.info("here 2"); lineQueueSemaphore.acquire(); + logger.info("here 3"); lineQueue.clear(); + logger.info("here 4"); } catch (InterruptedException e) { + logger.info("here 5"); System.out.printf("Interrupted cmd=%s%n",cmd.toString()); - e.printStackTrace(); + logger.info("here 6"); + logger.error("maybe here", e); } finally { + logger.info("here 7"); lineQueueSemaphore.release(); }