Skip to content

Commit

Permalink
Exit if process is a zombie process
Browse files Browse the repository at this point in the history
  • Loading branch information
astrofrog committed Jan 23, 2014
1 parent bd741b9 commit f0edc6c
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions psrecord/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,10 @@ def monitor(pid, logfile=None, plot=None, duration=None, interval=None, include_
# Start main event loop
while True:

# Check if process status indicates we should exit
if pr.status in [psutil.STATUS_ZOMBIE, psutil.STATUS_DEAD]:
break

# Find current time
current_time = time.time()

Expand Down

0 comments on commit f0edc6c

Please sign in to comment.