We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 78d2cb0 + c9a379e commit c7dc71fCopy full SHA for c7dc71f
src/bindings/python/flux/uri/resolvers/pid.py
@@ -37,9 +37,15 @@ def _get_broker_child_fallback(broker_pid):
37
# of a TOU-TOC race here, so just ignore all errors
38
pass
39
else:
40
- ppid = int(data.split()[3])
41
- if ppid == broker_pid:
42
- return pid
+ match = re.match(r"^[0-9]+ \(.*\) \w+ ([0-9]+)", data)
+ # Attempt to convert match to integer. On regex match failure,
+ # or integer conversion failure, just skip this entry
43
+ try:
44
+ ppid = int(match.group(1))
45
+ if ppid == broker_pid:
46
+ return pid
47
+ except (IndexError, ValueError):
48
+ pass
49
raise ValueError(f"PID {broker_pid} is a flux-broker and no child found")
50
51
0 commit comments