# HG changeset patch # User robcast # Date 1324328149 -3600 # Node ID 2c70e595e4d7923aa020a3580a854b77586f79f9 # Parent 66f1ba72d07b12781d0de734e91437af4e64175f better timeout log message diff -r 66f1ba72d07b -r 2c70e595e4d7 servlet3/src/main/java/digilib/servlet/AsyncServletWorker.java --- a/servlet3/src/main/java/digilib/servlet/AsyncServletWorker.java Mon Dec 19 21:39:17 2011 +0100 +++ b/servlet3/src/main/java/digilib/servlet/AsyncServletWorker.java Mon Dec 19 21:55:49 2011 +0100 @@ -36,7 +36,7 @@ private long startTime; private ErrMsg errMsgType = ErrMsg.IMAGE; private ImageJobDescription jobinfo; - /** flag to indicate that the response is completed (on abort)*/ + /** flag to indicate that the response is completed (on abort) */ private boolean completed = false; /** AsyncRequest timeout */ protected static long timeout = 60000l; @@ -133,23 +133,27 @@ } imageWorker.stopNow(); this.completed = true; - Scaler.digilibError(errMsgType, Error.UNKNOWN, null, (HttpServletResponse) asyncContext.getResponse()); + Scaler.digilibError(errMsgType, Error.UNKNOWN, null, + (HttpServletResponse) asyncContext.getResponse()); asyncContext.complete(); } @Override public void onTimeout(AsyncEvent event) throws IOException { - logger.error("AsyncServletWorker TIMED OUT! (increase worker-timeout?)"+event); + logger.error("AsyncServletWorker TIMED OUT after " + + (System.currentTimeMillis() - startTime) + + "ms! (increase worker-timeout?)"); if (completed) { logger.debug("AsyncServletWorker already completed (TimeOut)!"); return; } imageWorker.stopNow(); this.completed = true; - Scaler.digilibError(errMsgType, Error.UNKNOWN, null, (HttpServletResponse) asyncContext.getResponse()); + Scaler.digilibError(errMsgType, Error.UNKNOWN, null, + (HttpServletResponse) asyncContext.getResponse()); asyncContext.complete(); } - + public static long getTimeout() { return timeout; }