Closed GoogleCodeExporter closed 9 years ago
Guava version: 14.0.1
Original comment by a...@relational.io
on 17 Jul 2013 at 7:31
Original comment by kak@google.com
on 17 Jul 2013 at 7:46
The issue is that if a listener was configured to use the sameThreadExecutor it
would hold the internal state lock on the service manager and block other state
modifying operations. So if you performed a long running or blocking operation
you could block state transitions. So in this case System.exit() never returns
(by spec) and so the lock is never released and awaitStopped will never get
called. In fact an identical issue existed in AbstractService as well.
This was fixed in
https://code.google.com/p/guava-libraries/source/detail?r=efa4d2b38592c8ab69b560
733eac47d3914e78e7&path=/guava/src/com/google/common/util/concurrent/ServiceMana
ger.java on April 8th by ensuring that no user code (i.e. listeners) are run
with the lock held.
The workaround of executing the listener in another thread (using the
singleThreadExecutor() as you suggest) is the best way to work around this in
guava 14.0.1, sorry for the trouble.
Original comment by lu...@google.com
on 2 Aug 2013 at 6:39
Original comment by cgdecker@google.com
on 2 Aug 2013 at 6:49
This issue has been migrated to GitHub.
It can be found at https://github.com/google/guava/issues/<issue id>
Original comment by cgdecker@google.com
on 1 Nov 2014 at 4:12
Original comment by cgdecker@google.com
on 3 Nov 2014 at 9:08
Original issue reported on code.google.com by
a...@relational.io
on 17 Jul 2013 at 7:26