8000 Add older names support for pids · postgrespro/testgres@1bd538f · GitHub
[go: up one dir, main page]

Skip to content

Commit 1bd538f

Browse files
committed
Add older names support for pids
1 parent 3a24554 commit 1bd538f

File tree

1 file changed

+25
-1
lines changed

1 file changed

+25
-1
lines changed

testgres/node.py

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -458,6 +458,21 @@ def get_child_processes(self):
458458
def get_auxiliary_pids(self):
459459
''' Returns dict with pids of auxiliary processes '''
460460

461+
alternative_names = {
462+
ProcessType.LogicalReplicationLauncher: [
463+
'postgres: bgworker: logical replication launcher'
464+
],
465+
ProcessType.BackgroundWriter: [
466+
'postgres: writer',
467+
],
468+
ProcessType.WalWriter: [
469+
'postgres: wal writer',
470+
],
471+
ProcessType.WalReceiver: [
472+
'postgres: wal receiver',
473+
],
474+
}
475+
461476
children = self.get_child_processes()
462477
if children is None:
463478
return None
@@ -467,11 +482,20 @@ def get_auxiliary_pids(self):
467482
line = child.cmdline()[0]
468483
for ptype in ProcessType:
469484
if ptype == ProcessType.WalSender \
470-
and line.startswith(ptype.value):
485+
and (line.startswith(ptype.value) or
486+
line.startswith('postgres: wal sender')):
471487
result.setdefault(ptype, [])
472488
result[ptype].append(child.pid)
489+
break
473490
elif line.startswith(ptype.value):
474491
result[ptype] = child.pid
492+
break
493+
elif ptype in alternative_names:
494+
names = alternative_names[ptype]
495+
for name in names:
496+
if line.startswith(name):
497+
result[ptype] = child.pid
498+
break
475499

476500
return result
477501

0 commit comments

Comments
 (0)
0