je_load_density.utils.reliability.process_supervisor
Process supervisor.
ProcessSupervisorwalks the OS process table for stuck Locust / gevent workers and kills stragglers (never the current process).with_watchdog()wraps a long callable with a hard wall-clock raise so a hung user template doesn’t pin a CI job forever.
Functions
|
|
|
Run |
Classes
|
- class je_load_density.utils.reliability.process_supervisor.ProcessSupervisor(name_substrings: tuple = ('locust', 'gevent'), grace_seconds: float = 2.0, killed: List[int] = <factory>)
Bases:
object- grace_seconds: float = 2.0
- kill_orphans() List[int]
- killed: List[int]
- name_substrings: tuple = ('locust', 'gevent')
- je_load_density.utils.reliability.process_supervisor.kill_pid(pid: int, sig: int = Signals.SIGTERM) bool
- je_load_density.utils.reliability.process_supervisor.with_watchdog(callable_: Callable[[...], Any], *args: Any, timeout_seconds: float = 300.0, on_timeout: Callable[[], None] | None = None, **kwargs: Any) Any
Run
callable_and raiseTimeoutErrorif it exceedstimeout_seconds. The callable continues running in its daemon thread until the process exits.