Open darxtrix opened 7 years ago
Just add the following code to quit() my_pid = os.getpid() target = psutil.Process(int(my_pid)) try: target.terminate() except: self._logger.info("Operation failed", exc_info=True)
The issue was because quit only raised a keyboard interrupt, but not killed the process itself.
Thanks for the suggestions. I primarily made the issues for keeping a track of things and get some contributions going. A bit busy nowadays, will start on things when i will get some bandwidth.
@vinusankarsiitgn I checked the pr, let me be affirmative on that. Thanks !
The real problem is that the exceptions in child thread are not getting caught in the main thread of the application. We need to either set the global threading.Event at all the places where exceptions can occur in threads or we need to use some kind of message passing.
Observation 1:
In case any exception occurs, an exception should be logged properly and ptop should be killed properly will all of the threads ( gui and sensor threads ) killed properly. For eg. in case, the GUI cannot be drawn properly exception occurs and ptop hangs.
Observation 2:
While killing ptop, catch the kill signals properly and kill all the threads.