-
Notifications
You must be signed in to change notification settings - Fork 248
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
move thread caller stack and rescue+log to a common place #487
Comments
@jonathanhefner Are you good with the changes I suggested here? If so, I'll make a PR.
And we're not passing |
@ColinDKelley I'm not actually affiliated with the Listen project, so I may not be the right person to ask. (I was fixing #476 to address some downstream issues in Rails.)
It might be good to ellaborate more about how this would be useful. From a cursory search, it looks like there are three places where
But perhaps these don't provide all the information you want when debugging? Or is this more about refactoring?
I think you're correct! |
@jonathanhefner Ah, you're correct that each Sorry I wasn't clear about the debugging information. One of the 3 And related, I believe the re- I'll make a PR with these suggestions. And I'll drop the combinations of |
PR: #496 |
Fix merged into master for v3.3 milestone. |
I was happy to see this PR remove the "ThreadPool": #483 . It was a nice improvement to track the threads inside the listeners rather than globally.
All the threads should have a rescue-and-log at the top. And it's very handing to remember the original caller who created the thread to help identify it. That's done here:
https://github.com/guard/listen/blob/master/lib/listen/adapter/base.rb#L72-L85
Let's put that in a general place and use it everywhere that threads are created. (And not
raise
from the top of the thread. That falls into some odd behavior in Ruby, where that exception can later be raised by code that callsjoin
.)Also: I don't believe the
.kill
is necessary here, since once aThread#join
returns, that means the thread has exited, right?https://github.com/guard/listen/blob/master/lib/listen/event/loop.rb#L64
The text was updated successfully, but these errors were encountered: