-
Couldn't load subscription status.
- Fork 3.4k
Fix handling key keyboard interrupt in parallel testsuite #11299
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
Conversation
This avoids the seemingly infinite backtraces that get generated when interrupting the parallel testsuite.
|
Finally figured it out. |
|
|
||
|
|
||
| def g_testing_thread(work_queue, result_queue, temp_dir): | ||
| signal.signal(signal.SIGINT, signal.SIG_IGN) |
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.
maybe a comment here? I'm not sure what this does or how it helps.
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.
Yeah I don't speak signal
| self.init_processes(test_queue) | ||
| results = self.collect_results() | ||
| try: | ||
| self.init_processes(test_queue) |
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.
does this line need to be inside the try?
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.
Presumably if init-ing fails we might need to clean up... forget what it does and if/how it can fail though.
| self.init_processes(test_queue) | ||
| results = self.collect_results() | ||
| finally: | ||
| for p in self.processes: |
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.
maybe a comment here too, why this is needed?
| for p in self.processes: | ||
| p.terminate() | ||
| p.join() | ||
| self.processes.clear() |
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.
what does .clear() do that is different from self.processes = []? (is it not a normal array somehow?)
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.
I assume the latter allocates a new array object/id?
Which could potentially cause problems if other objects are holding references to self.processes specifically.
If so: that's comment-worthy, cause it's a nonlocal concern.
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.
Not entirely sure how this works but seems ok to me
| for p in self.processes: | ||
| p.terminate() | ||
| p.join() | ||
| self.processes.clear() |
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.
I assume the latter allocates a new array object/id?
Which could potentially cause problems if other objects are holding references to self.processes specifically.
If so: that's comment-worthy, cause it's a nonlocal concern.
| self.init_processes(test_queue) | ||
| results = self.collect_results() | ||
| try: | ||
| self.init_processes(test_queue) |
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.
Presumably if init-ing fails we might need to clean up... forget what it does and if/how it can fail though.
|
|
||
|
|
||
| def g_testing_thread(work_queue, result_queue, temp_dir): | ||
| signal.signal(signal.SIGINT, signal.SIG_IGN) |
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.
Yeah I don't speak signal
|
This issue has been automatically marked as stale because there has been no activity in the past year. It will be closed automatically if no further activity occurs in the next 30 days. Feel free to re-open at any time if this issue is still relevant. |
This avoids the seemingly infinite backtraces that get generated
when interrupting the parallel testsuite.