Skip to content

Commit 1d02cd7

Browse files
author
Alexander Stefanov
committed
add monitor_stalled.py script to prevent issues on aarch64 build hosts for riscv64 targets. from time to time ldd stucks on %install stage
1 parent 8e7b8cc commit 1d02cd7

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

monitor_stalled.py

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
#!/usr/bin/env python
2+
# -*- coding: utf-8 -*-
3+
4+
import psutil
5+
import time
6+
7+
def get_ldd_pid():
8+
for proc in psutil.process_iter(['pid', 'name']):
9+
if proc.info['name'] == 'ldd':
10+
print(proc.info['pid'])
11+
return proc.info['pid']
12+
return None
13+
14+
def monitor_ldd():
15+
ldd_pid = get_ldd_pid()
16+
while True:
17+
time.sleep(60)
18+
new_ldd_pid = get_ldd_pid()
19+
if new_ldd_pid == ldd_pid:
20+
if ldd_pid is not None:
21+
p = psutil.Process(ldd_pid)
22+
print("killed: {}".format(ldd_pid))
23+
p.kill()
24+
else:
25+
ldd_pid = new_ldd_pid
26+
27+
if __name__ == '__main__':
28+
monitor_ldd()

0 commit comments

Comments
 (0)