Hello,
Please review the fix for
issue : https://bugs.openjdk.java.net/browse/JDK-8141591
webrev : http://cr.openjdk.java.net/~hb/8141591/webrev.00/
Fix details:
The root-cause for the issue is that NotifFetcher thread was suspended
at L562 after which main thread ran to completion shutting down both
client and server and stopping the executor. Fixing as
synchronized (ClientNotifForwarder.this) {
if (state == STARTED) {
executor.execute(new NotifFetcher());
}
}
will not solve the problem since NotifFetcher can get suspended after
checking state==STARTED and still hit the same problem.
One way to solve would be to catch RejectedExecutionException and then
fallback on linearExecutor. This will take care of necessary cleanup
if client/server are shutdown or keeps the system running if executor
is abrupty shutdown by the client without stopping the client/server.
The comments section of the issue also has discussion about various ways
of fixing the issue and merits/demerits of different approaches. It also
helps in getting a perspective on issue and the fix.
Thanks
Harsha