CODETOOLS-7901807: Deadlock while trying to remove Handler during termination

Pavel Punegov pavel.punegov at oracle.com
Fri Sep 23 18:08:09 UTC 2016


Hi,

here is a suggested fix for CODETOOLS-7901807

1. Remove handlers.remove() that makes harness dead lock while BinaryLinkServer::terminate() tries to join this handler

2. Start each handler only if there is a task available. Each task added to the BinaryLinkServer unlocks a Handler. 
This was done to make Acceptor don’t wait on socket.accept and ignore a SocketException, that could hide some connection issues. I think it's better to wait for an available tasks on a semaphore. This could be replaced with a simple counter, but as soon as the BinaryLinkServer is written in the way it is accepting tasks on the fly, I think a semaphore is a better solution. 

webrev: http://cr.openjdk.java.net/~ppunegov/CODETOOLS-7901807/webrev.00/ <http://cr.openjdk.java.net/~ppunegov/CODETOOLS-7901807/webrev.00/>
bug: https://bugs.openjdk.java.net/browse/CODETOOLS-7901807 <https://bugs.openjdk.java.net/browse/CODETOOLS-7901807>

— Thanks,
Pavel Punegov



More information about the jcstress-dev mailing list