question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cleanup all threads (e.g. AsyncTimeout.Watchdog) on explicit shutdown

See original GitHub issue

Currently i use this

    OkHttpClient client0 = ???
    client0.dispatcher.executorService.shutdown
    client0.connectionPool.evictAll
    client0.cache.close

but this is not enough since okhttp3.ConnectionPool#executor remains running this is an issue because it prevents garbage collection of classloader which loaded okhttp it would be nice to have a single close method which closes all connections and stops all threads started by okhttp tested on 3.11.0

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:3
  • Comments:11

github_iconTop GitHub Comments

1reaction
yschimkecommented, Jan 5, 2020

@OlegYch fair point.

BTW this it isn’t a high priority at the moment, but if you follow the steps above, we should try to shutdown threads etc so we are good citizens in containers (build systems or web servers etc)

0reactions
OlegYchcommented, Mar 29, 2020

fair enough

Read more comments on GitHub >

github_iconTop Results From Across the Web

Java Poller Thread cleanup before JVM shutdown
For example if the application is based on a JFrame then add a windowClosing() hook to gracefully stop the running Thread s and...
Read more >
How to use the SAPControl Web Service Interface
Shutdown triggers a soft shutdown via SIGQUIT. RestartInstance triggers an instance restart. All functions work asynchronously, which means they trigger the ...
Read more >
IBM Spectrum Scale 5.1.0: Problem Determination Guide
Example mmpmon scenarios and how to analyze and interpret their results. ... gpfs_wt_count_all : Count of all threads with waiting time greater than...
Read more >
Graceful Shutdown and Cleanup - The Rust Programming ...
Let's start with implementing Drop on our thread pool. When the pool is dropped, our threads should all join to make sure they...
Read more >
4913 – org.apache.log4j.helpers.FileWatchdog should allow ...
So I added a method, that shutdown all FileWatchDog threads, callable from: PropertyConfigurator.shutdown(). For me this works, ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found