Breakend / experiment-impact-tracker

MIT License
266 stars 31 forks source link

i index variable used out of its loop #56

Closed paulgay closed 3 years ago

paulgay commented 3 years ago

in the file

https://github.com/Breakend/experiment-impact-tracker/blob/master/experiment_impact_tracker/cpu/intel.py

the function :

def get_rapl_power(pid_list, logger=None, **kwargs):

at line 370 shoudn't it be:

for i, p in enumerate(process_list):

instead of

for p in process_list:

The way it is currently, it seems the i variable will get set to the last value from the previous loop and as a consequence, in the except block, the process added to the zombies list will also be the last process in the list process_list instead of being the process which generated the exception.

Breakend commented 3 years ago

Thanks for catching this! Should be fixed in #59 . please re-open if it's still an issue