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.

Thread join may block forever

See original GitHub issue

Calling join on a thread may block the call forever when remaining_time is negative. And this can prevent cheroot from stopping properly.

https://github.com/cherrypy/cheroot/blob/cb9d3f46aa755d63e85d539a2efb7d1fa8f53935/cheroot/workers/threadpool.py#L285

One fix would be to change this line to be:

remaining_time = timeout and min(0, endtime - time.time())

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
scyclopscommented, Sep 18, 2020

I don’t have any more time to commit to this but I’ve applied the fix I recommended above in my fork and it’s working well for me.

0reactions
webknjazcommented, Sep 17, 2020

Ah, I missed that it’s in a loop and only checked how it’s set at the beginning of the module. @scyclops do you think you could come up with a pytest-based reproducer?

Read more comments on GitHub >

github_iconTop Results From Across the Web

std::thread::join blocks indefinitely out of main - Stack Overflow
It is a global variable. If A::join is called from the destructor, std::thread::join blocks forever.
Read more >
Thread.Join Method (System.Threading) - Microsoft Learn
Use this method to ensure that a thread has been terminated. The caller will block indefinitely if the thread does not terminate. In...
Read more >
The Thread.join() Method in Java - Baeldung
join () Methods with Timeout. The join() method will keep waiting if the referenced thread is blocked or takes too long to process....
Read more >
What is the Thread.join() method in Java? - Educative.io
The Thread.join() method is a blocking call. This means that it will cause the thread that calls it to stop executing until the...
Read more >
Java Thread Join Example | DigitalOcean
Java Thread join method can be used to pause the current thread execution until unless the specified thread is dead.
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