MCPcopy Create free account
hub / github.com/MaterializeInc/materialize / _handle_lingering_services

Function _handle_lingering_services

misc/python/materialize/cli/run.py:600–617  ·  view source on GitHub ↗
(kill: bool = False)

Source from the content-addressed store, hash-verified

598
599
600def _handle_lingering_services(kill: bool = False) -> None:
601 uid = os.getuid()
602 for proc in psutil.process_iter():
603 try:
604 if proc.name() in REQUIRED_SERVICES:
605 if proc.uids().real != uid:
606 print(
607 f"Ignoring {proc.name()} process with different UID (PID {proc.pid}, likely running in Docker)"
608 )
609 elif kill:
610 print(f"Killing orphaned {proc.name()} process (PID {proc.pid})")
611 proc.kill()
612 else:
613 ui.warn(
614 f"Existing {proc.name()} process (PID {proc.pid}) will be reused"
615 )
616 except psutil.NoSuchProcess:
617 continue
618
619
620if __name__ == "__main__":

Callers 1

mainFunction · 0.85

Calls 2

killMethod · 0.80
nameMethod · 0.45

Tested by

no test coverage detected