I do believe there is another possible notification issue. I've seen this pattern in
the jdk code. I believe a thread which is waiting can get interrupted at about the same
time that it is notified. if the InterruptedException is just thrown, that notification
will be lost. If you look in some of the jdk code, they have essentially:
| synchronized(obj) {
| try {
| obj.wait();
| } catch(InterruptedException e) {
| obj.notify();
| throw e;
| }
| }
|
This way an interrupted thread will not cause a notification to be lost. obviously, you
can generate spurious notifications, so your code needs to handle that as well. but
generally, extra notifications is better than lost notifications.
To bring it back to the referenced code:
(1) SocketServerInvoker could be doing the clientpool.wait()
(2) ServerThread sends a notification
(3) SocketServerInvoker gets interrupted and notified and bails out, swallowing the
notification
I'm not sure what scenarios might cause the SocketServerInvoker to be interrupted, but
certainly system stress might do it.
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4057938#...
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&a...