Closed GoogleCodeExporter closed 9 years ago
Trivial patch that just adds a simple log:
--- guava/src/com/google/common/util/concurrent/ServiceManager.java
+++ guava/src/com/google/common/util/concurrent/ServiceManager.java
@@ -302,6 +302,9 @@ public final class ServiceManager {
*/
public ServiceManager stopAsync() {
for (Service service : services.keySet()) {
+ if (!(service instanceof NoOpService)) {
+ logger.log(Level.FINE, "Stopping {0}.", service);
+ }
service.stop();
}
return this;
Ideally I'd also want a timer (similar to when starting services) so we get
separate messages for 'Stopping' and 'Stopped in X ms'. This would involve
changing the ServiceListener though. I'm happy to submit a patch if there's
enough interest.
Original comment by diwa...@maginatics.com
on 10 May 2013 at 9:51
Original comment by kevinb@google.com
on 20 Nov 2013 at 10:21
Logging was added for when services become TERMINATED or FAILED but there are
still no timers for service shutdown.
what is your usecase for shutdown timers? would you want to include failed
services in that set of timings?
Original comment by lu...@google.com
on 22 Jan 2014 at 4:33
Use case for timers is to surface services that take unexpectedly long to shut
down. Timing for failed services is probably not that useful, but doesn't hurt
if it simplifies the patch.
Broader use case for logs is consistency with startup and to simply observe
that services are indeed being shut down properly -- this is useful for
debugging.
Original comment by diwakerg...@gmail.com
on 22 Jan 2014 at 5:15
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 1 Nov 2014 at 4:17
Original comment by cgdecker@google.com
on 3 Nov 2014 at 9:08
Original issue reported on code.google.com by
diwa...@maginatics.com
on 9 May 2013 at 11:22