mina-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Xu Congyuan <xcongy...@gmail.com>
Subject Re: Mina stop work cause by exception in OrderedThreadPoolExecutor.Worker.run()
Date Fri, 13 Jan 2017 01:12:27 GMT
Thanks for reply. Sorry for not clear it.
Basically, we will get the number of idleWorkers 0 or more than 0,
if idleWorkers = 0, that's meaning no work is idle, we should add workers
if it's necessary;
if idleWorkers > 0 , that's meaning there are idle works, no necessary to
add workers.
Do I get the point?
Let's back to the original,  while the MINA starting. At this time, the num
of idleWorker == 0, therefor we call addWorkerIfNecessary() method when
task is coming, because of idleWorker == 0,  we do addWorker and increase
the num of idle at line 259 (version 2.0.16). so idleWorker == 1 at this
time, the first worker be fired and start running, we enter the infinite
loop, and decrease the num of idleWorker to 0 at line 686(version 2.0.16),
basically that's we expected, but there is exception throw by runTasks(),
the finally code is executed at line 707,  and increase the idleWorker to 1
again, the infinite 'for' loop drop out because we don't catch the
exception, the outer try...finally code executed at line 712 removed the
Let's sort out ideas, by now,  the idleWorker == 1 and there is no worker
is running, is right? so the mina fall into fake dead.

Please let me know I did the right investigation.

2017-01-13 0:11 GMT+08:00 Emmanuel L├ęcharny <elecharny@gmail.com>:

> Hi !
> sorry for the delayed response, was busy...
> I'm not sure I understand : if you get an exception in the runTasks()
> call, the 'finally' code is executed, and the number of idle worker is
> incremented, no matter what...
> Can you check that ?
> --
> Emmanuel Lecharny
> Symas.com
> directory.apache.org

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message