Skip to content

empty-catch: sdks/python/pmxt/server_manager.py:315 — except Exception: pass silently ignores server kill failure #816

@realfishsam

Description

@realfishsam

Violation

try:
    os.kill(pid, signal.SIGTERM)
    time.sleep(0.5)
except Exception:
    pass

Location

sdks/python/pmxt/server_manager.py:315 (inside _kill_old_server)

Why It Matters

If SIGTERM delivery fails (e.g. permission error, unexpected PID state), the exception is silently ignored. The code then proceeds as if the server was killed. This can leave the old server running while a new one starts, causing port conflicts or split-brain state with no diagnostic output.

Suggested Fix

except Exception as e:
    logger.warning("server_manager: failed to SIGTERM pid %d: %s", pid, e)

Found by automated code hygiene audit

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions