@@ -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