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

SIGINT (sent with CTRL+c) doesn't always stop the test. #14

Closed
jettisonjoe opened this issue Sep 1, 2015 · 12 comments
Closed

SIGINT (sent with CTRL+c) doesn't always stop the test. #14

jettisonjoe opened this issue Sep 1, 2015 · 12 comments
Labels

Comments

@jettisonjoe
Copy link
Contributor

Usually it does, but not always. I haven't identified the specific conditions that cause SIGINT handling to break yet.

@jettisonjoe jettisonjoe added the bug label Sep 1, 2015
@fahhem
Copy link
Collaborator

fahhem commented Sep 1, 2015

This is usually a threading problem, they don't always like to die on their own. You can either set them to daemon mode or explicitly pass some "die now" data into them

@jettisonjoe
Copy link
Contributor Author

Yeah, I suspect the threads that aren't dying are in the Rocket instance in the HttpHandler. Once we flatten multi-cell support in the framework, there will be fewer places to look for the cause of this behavior.

@jettisonjoe
Copy link
Contributor Author

More info on this. It actually still happens with the bare-bones frontend API server we now have, so it wasn't specific to Rocket. SIGINT handling consistently fails if SIGINT happens while execution is inside one of the HTTP handlers.

@wallacbe
Copy link
Collaborator

Provide a DUT ID in order to start the test.

^CReceived SIGINT. Stopping everything.

Exception happened during processing of request from ('127.0.0.1', 57906)
Traceback (most recent call last):
File "/usr/lib/python2.7/SocketServer.py", line 295, in _handle_request_noblock
self.process_request(request, client_address)
File "/usr/lib/python2.7/SocketServer.py", line 321, in process_request
self.finish_request(request, client_address)
File "/usr/lib/python2.7/SocketServer.py", line 334, in finish_request
self.RequestHandlerClass(request, client_address, self)
File "/usr/lib/python2.7/SocketServer.py", line 647, in init
self.setup()
File "/usr/lib/python2.7/SocketServer.py", line 699, in setup
self.rfile = self.connection.makefile('rb', self.rbufsize)
File "/usr/lib/python2.7/socket.py", line 217, in makefile
return _fileobject(self._sock, mode, bufsize)
ThreadTerminationError

@wallacbe
Copy link
Collaborator

Observing this also with the bazel build environment

@wallacbe
Copy link
Collaborator

Found that SIGQUIT ( Ctrl+) will kill the process.

@fahhem
Copy link
Collaborator

fahhem commented Mar 19, 2016

Does this only happen when the frontend is being accessed or can it be any time?

@wallacbe
Copy link
Collaborator

My test cases about were without the front end running.

Also SIGQUIT may not be best method since tear down methods would be skipped.

@wallacbe
Copy link
Collaborator

Additional observation from head:

If I start the tester like this then do CTRL+C it hangs
test.Execute(test_start=triggers.PromptForTestStart())

If I disable http and execute CTRL+C stops execution immediately:
test.Configure(http_port=None)
test.Execute(test_start=triggers.PromptForTestStart())

Does this point to http server being the issue?

@jettisonjoe
Copy link
Contributor Author

Yes, I believe the issue is in the http server. @grybmadsci and I have some changes planned for the HTTP API that will give us a good opportunity to investigate and resolve this.

@jettisonjoe
Copy link
Contributor Author

Is anyone still seeing issues with CTRL+c in the current PyPI version?

@jettisonjoe
Copy link
Contributor Author

I believe this is fixed now.

marcovannoord pushed a commit to marcovannoord/openhtf that referenced this issue Mar 30, 2023
marcovannoord pushed a commit to marcovannoord/openhtf that referenced this issue Mar 30, 2023
Relese 0.6.3: Misc UI fixes, adds spintop integration.

Closes google#17, google#14, google#10, and google#24

See merge request tackv/spintop-openhtf!8
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants