-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Avoid WMISampler inheriting from Thread #4051
Conversation
self.start() | ||
thread = Thread(target=self._query_sample_loop, name=class_name) | ||
thread.daemon = True | ||
thread.start() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
setDaemon is an old API: https://docs.python.org/2/library/threading.html#threading.Thread.setDaemon
self.start() | ||
thread = Thread(target=self._query_sample_loop, name=class_name) | ||
thread.daemon = True | ||
thread.start() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Starting a thread in the __init__
feels not great. Let me know if you know a better way.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Start it in sample the first time is called?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would make the code a bit more complex though, one more flag to manage.
What does this PR do?
Avoid WMISampler inheriting from Thread.
Improvement to this PR: https://github.com/DataDog/integrations-core/pull/3987/files
Revert this PR: #4043
Motivation
No need to inherit Thread.
See also: #3987 (comment)
Additional Notes
/
Review checklist (to be filled by reviewers)
changelog/
andintegration/
labels attached