Java catch/finally blocks skipped completely? -


We have Thredpul Aksclor-back performance module I have some functions are abolished apparently application code but The worker leaves the code in any way by attempting / holding / ending and just raises the next task, so that the last one misses the critical status reporting code.

In this example, 257832: 5 was raised from thread-8 but this thread eventually starts another task.

 2012-07-11 15: 53: 39,389 information [pool-1-thread-6]: work (258861: 5): Getting started 2012-07-11 15: 53: 39,389 INFO [pool -1-thread -6]: A work in progress ### Logged by App Logic 2012-07-11 15: 54: 18,186 INFO [Pool 1-Thread-6]: Work (258868: 5): Getting Started ### Pick Up Another Suddenly! 2012-07-11 15: 54: 18,186 info [pool-1-thread-6]: a work going on ### logged by AP logic 2012-07-11 15: 54: 18,445 information [pool 1-thread -6]: Work (258868: 5): Returning from work. 2012-07-11 15: 54: 18,446 info [pool-1-thread-6]: work (258868: 5): finalizing 2012-07-11 15: 54: 18,487 information [pool-1-thread 6 ]: Work (258,868: 5): Reporting results for this result: 200 2012-07-11 15: 54: 18,487 information [pool-1- thread-6]: work (258868: 5): ending  

Runable for Threadpool Exporter) looks fine. It looks like

  public void run () {log.info (String.Format ( "Task (% s:% s) :. start", wfId, taskId)); Try {Object Result = task.doWork (...); // Confirm application code log (string.form ("Task (% s:% s): Task. Returned from Duvark.", WfId, taskId); Status = "finished"; } Catch (throbable T) {log. Terror ("Error in executing the task:" + + + + "+ + + + squarename);} Finally {log.info (string format (" work (% s:% s): finalization ", wfId , TaskId); // Notify the status of a server log.info (String format ("Work (% s:% s): Finish", wfId, taskId)}}} // Work structure looks like / / (allows use of larger, with a queue size numThreads since ThreadPoolExecutor # getActiveCount) call only an approximate calculation this.executor = new ThreadPoolExecutor (numThreads, numThreads, 60, TimeUnit.SECONDS, new ArrayBlockingQueue & lt; Runnable & Gt; (numThreads * 2 )); Executor.execute (new TaskRunnable (...));   

Note:

  1. We hold ultimate Throabl but between two functions Exception is not
  2. No sign is called exit () or the program restarts
  3. The first one left all the log lines, even if the app code is called After or in the catch and finally the block, and leave the status reporting
  4. This is random with only a low probability; But due to the large number of tasks executed, it still causes the cause of our headache.

    If the thread pool executor as it would have been just magical runnable (otherwise it will need a InterruptedException which will be held as a qualified throwing evicts; Java thread non Except for the shutdown / exits) and leave all the blocks. I have checked the ThreeadPoolExecutor Javadok, nothing should be born for such an event.

    What could have been? After the text "itemprop =" text ">

    after a

    After looking at the blocks, a possible explanation for the log message is that at the end of execution of blocks An exception was thrown:

    • If log was null at that point, you would get an NPE. (If log is declared as final , you can terminate this as a possible cause.)

    • < p> are based on objects, so you can be an unhandled exception in wfId or taskId objects' toString () methods.
    • logger object can be broken ...


      Also It is possible that you are looking for the wrong source code for some reason.


      Yet another theoretical probability is that the Android platform Thread.destroy () is actually implemented to do something, and some have it thread. If it was implemented incorrectly according to the original watchman, then you think that last blocks were not executed. It may also be possible to equalize it from outside the JVM but if it is happening then all bets are closed!

Comments

Popular posts from this blog

Python SQLAlchemy:AttributeError: Neither 'Column' object nor 'Comparator' object has an attribute 'schema' -

java - How not to audit a join table and related entities using Hibernate Envers? -

mongodb - CakePHP paginator ignoring order, but only for certain values -