Skip to content
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

New version online #15

Open
niccokunzmann opened this issue Dec 24, 2016 · 20 comments
Open

New version online #15

niccokunzmann opened this issue Dec 24, 2016 · 20 comments

Comments

@niccokunzmann
Copy link
Owner

There is a new version online: 1.0.0
What should be in the next version?

@coffenbacher
Copy link

It would be cool to be able to specify certain threads as OK to hang, I have some threads that intentionally block for a while

@artemrizhov
Copy link
Collaborator

artemrizhov commented Jan 19, 2017 via email

@niccokunzmann
Copy link
Owner Author

niccokunzmann commented Jan 19, 2017 via email

@coffenbacher
Copy link

coffenbacher commented Jan 19, 2017 via email

@artemrizhov
Copy link
Collaborator

artemrizhov commented Jan 19, 2017 via email

@niccokunzmann
Copy link
Owner Author

niccokunzmann commented Jan 19, 2017

Without looking into how it should be implemented: How would you like to use it?

import module
hanging_threads.stop_monitoring(module)

How to use it is the first step: Specification first. If you can write an empty function with a good documentation, we can find a way to (test and) implement.

Threads are started by functions. They have code objects. There is a lot of information available. The question is: What behavior/interface would you like assuming all is possible. - I like to divide what and how.

@artemrizhov
Copy link
Collaborator

artemrizhov commented Jan 19, 2017 via email

@coffenbacher
Copy link

coffenbacher commented Jan 19, 2017 via email

@artemrizhov
Copy link
Collaborator

artemrizhov commented Jan 19, 2017

However, those threads use libraries that spawn other threads that intentionally hang on time.sleep

Ok, so let them hang. This is not real problem because this is expected behaviour. What is the real problem with these sleeping threads? I mean, we should think why we are bothering about this at all.

@coffenbacher
Copy link

coffenbacher commented Jan 19, 2017 via email

@niccokunzmann
Copy link
Owner Author

niccokunzmann commented Jan 19, 2017 via email

@coffenbacher
Copy link

coffenbacher commented Jan 19, 2017 via email

@artemrizhov
Copy link
Collaborator

artemrizhov commented Jan 19, 2017

the error messages from the sleeping threads swamp any information from the other ones.

So, this is the real problem, I guess. Maybe we can just get rid of this swamping messages?

My propositions:

  1. Rewrite the logging algorithm so that it reports once when a thread hangs, and then reports once again when the thread awakes. This is done already in my branch, I just have to cleanup things and create a PR.
  2. Add an option to ignore repeating hangs, so if a thread hangs on certain line and then awakes, then hanging on this line will not be considered as hangs anymore.

@coffenbacher
Copy link

coffenbacher commented Jan 19, 2017 via email

@artemrizhov
Copy link
Collaborator

Ok, I'll prepare PR for the first part (which seems reasonable in any case), and then we will be able to implement the second one, if everybody agree. @niccokunzmann what do you think about this?

@artemrizhov
Copy link
Collaborator

artemrizhov commented Jan 19, 2017

@coffenbacher It also may be useful to add an option to ignore threads that hangs on time.sleep because this is a common case for the threads that we want to ignore. Not sure if this is a good idea to suppress any messages as soon as they are not annoying, so maybe this option is not really useful. Any suggestions?

@niccokunzmann
Copy link
Owner Author

Sure, please go ahead.

@niccokunzmann
Copy link
Owner Author

@coffenbacher Would you like to create a pull-request with the documentation for the functionality which you would like to use?

@artemrizhov
Copy link
Collaborator

I've added #21 and #31, but still not sure if it makes sense to ignore time.sleep. One may get hanging threads because of sleep forgotten after debugging, or because of too large sleep time. So this function also may be a cause of hanging threads.

@niccokunzmann
Copy link
Owner Author

If there are a lot of prints, it could be good to have an option to ignore time.sleep in the future.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants