robotframework / PythonRemoteServer

Robot Framework remote server implemented with Python
Apache License 2.0
152 stars 83 forks source link

`Ctrl-C` or `SIGINT/SIGHUP` signals don't shut down the server immediately #10

Closed pekkaklarck closed 10 years ago

pekkaklarck commented 10 years ago

When SIGINT or SIGHUP signals are sent to the remote server or Ctrl-C pressed, the server reports that it is shutting down but the process doesn't actually end. The reason is that it is still waiting in handle_request method and exits only after next request comes and that method returns.

This can be fixed by sending an exception from the signal handler to exit handle_request. This exception needs to be caught and silenced to make the exit clean.