Skip to content

Commit

Permalink
more log
Browse files Browse the repository at this point in the history
  • Loading branch information
diegolovison committed Jan 3, 2025
1 parent d08eb9f commit eb0989b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/main/java/io/hyperfoil/tools/qdup/cmd/Dispatcher.java
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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");
Expand All @@ -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");


}
Expand Down
9 changes: 8 additions & 1 deletion src/main/java/io/hyperfoil/tools/qdup/cmd/ScriptContext.java
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}

Expand Down

0 comments on commit eb0989b

Please sign in to comment.