Skip to content

Commit

Permalink
Add temporary logging to see if that's useful
Browse files Browse the repository at this point in the history
  • Loading branch information
benjyw committed Apr 3, 2023
1 parent 898c216 commit b3774de
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/python/pants/pantsd/process_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@

from __future__ import annotations

import datetime
import logging
import os
import signal
import subprocess
import sys
import time
import traceback
Expand Down Expand Up @@ -381,6 +383,18 @@ def is_alive(self, extended_check=None):
"""
try:
process = self._as_process()
if process:
print(
f"{str(datetime.datetime.now())} 111111111111 "
f"Process state: id={process.pid}, status={process.status()}, "
f"process_name={self.process_name}, "
f"computed process_name={self._get_process_name(process)}"
)
if process.status() == psutil.STATUS_SLEEPING:
cp = subprocess.run(["strace", "-p", f"{process.pid}"], capture_output=True)
print(f"XXXXXXX {cp.returncode} {cp.stdout}")
else:
print(f"{str(datetime.datetime.now())} 22222222222 Process is None, somehow")
return not (
# Can happen if we don't find our pid.
(not process)
Expand Down

0 comments on commit b3774de

Please sign in to comment.