ptop icon indicating copy to clipboard operation
ptop copied to clipboard

Kill ptop properly

Open darxtrix opened this issue 8 years ago • 4 comments

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.

darxtrix avatar Jul 15 '17 11:07 darxtrix

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.

vinusankarsiitgn avatar Oct 23 '18 15:10 vinusankarsiitgn

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.

darxtrix avatar Oct 24 '18 19:10 darxtrix

@vinusankarsiitgn I checked the pr, let me be affirmative on that. Thanks !

darxtrix avatar Oct 30 '18 18:10 darxtrix

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.

darxtrix avatar Nov 13 '18 16:11 darxtrix