fix find_victim

This commit is contained in:
Alexey Avramov 2019-01-11 01:08:17 +09:00
parent c0c17a2e2d
commit d4fe8dd1f2

50
nohang
View File

@ -577,23 +577,53 @@ def find_victim_and_send_signal(signal):
oom_score_adj = rline1('/proc/' + pid + '/oom_score_adj') oom_score_adj = rline1('/proc/' + pid + '/oom_score_adj')
except FileNotFoundError: except FileNotFoundError:
print('Process not found') print('The victim died in the search process')
# update stat_dict
key = 'The victim died in the search process'
if key not in stat_dict:
stat_dict.update({key: 1})
else:
new_value = stat_dict[key] + 1
stat_dict.update({key: new_value})
return None return None
oom_score = 'unknown'
oom_score_adj = 'unknown'
except ProcessLookupError: except ProcessLookupError:
print('Process not found') print('The victim died in the search process')
# update stat_dict
key = 'The victim died in the search process'
if key not in stat_dict:
stat_dict.update({key: 1})
else:
new_value = stat_dict[key] + 1
stat_dict.update({key: new_value})
return None return None
pass
except IndexError: except IndexError:
print('Process not found') print('The victim died in the search process')
# update stat_dict
key = 'The victim died in the search process'
if key not in stat_dict:
stat_dict.update({key: 1})
else:
new_value = stat_dict[key] + 1
stat_dict.update({key: new_value})
return None return None
cmdline = ''
except ValueError: except ValueError:
print('Process not found') print('The victim died in the search process')
# update stat_dict
key = 'The victim died in the search process'
if key not in stat_dict:
stat_dict.update({key: 1})
else:
new_value = stat_dict[key] + 1
stat_dict.update({key: new_value})
return None return None
pass
len_vm = len(str(vm_size)) len_vm = len(str(vm_size))