guava icon indicating copy to clipboard operation
guava copied to clipboard

Provide ServiceManager.stopTimes() to enable debugging slow ServiceManager shutdowns

Open Kurru opened this issue 3 years ago • 3 comments

Consider providing ServiceManager.stopTimes() to enable debugging slow ServiceManager shutdowns.

There currently exists serviceManager.startupTimes() for startup time, this would be the equivalent for the shutdown process.

Kurru avatar Dec 22 '21 02:12 Kurru

@Kurru I have raised the pull request for the requested support. Please refer https://github.com/google/guava/pull/5873

ayushjais2654 avatar Jan 17 '22 17:01 ayushjais2654

Do you actually have a use case for this feature? What will you use it for? Or are you proposing it simply for completeness?

netdpb avatar Feb 07 '22 21:02 netdpb

When I start my server I print out the time taken to start all services, which is easy given the current supported API. This lets me see which service was responsible for slow server start performance.

I want the same ability for server shutdown. Currently, when I stop my server, it waits for all services to stop running, however I have no easy visibility into the shutdown delay which is frustrating.

Slow shutdown services have occurred within my server on several occasions. When this happens, it is very hard to attribute this back to the appropriate service, as I don't know which service is still 'running'. This API would give me an easy retrospective view into 'oh service x took 23 seconds to stop, let me investigate how that could happen'.

Typically this has been due to a slow, blocking rpc call within a scheduled service, or a blocking retry within the run block.

Kurru avatar Feb 08 '22 00:02 Kurru