Including psutil & setproctitle (#7031)

This commit is contained in:
ijrsvt
2020-02-05 14:16:58 -08:00
committed by GitHub
parent 93ed86f175
commit 0826f95e1c
17 changed files with 171 additions and 80 deletions
+3 -7
View File
@@ -3,10 +3,9 @@ import os
import sys
import time
try:
import psutil
except ImportError:
psutil = None
# Import ray before psutil will make sure we use psutil's bundled version
import ray # noqa F401
import psutil # noqa E402
logger = logging.getLogger(__name__)
@@ -105,9 +104,6 @@ class MemoryMonitor:
self.worker_name = worker_name
def raise_if_low_memory(self):
if psutil is None:
return # nothing we can do
if time.time() - self.last_checked > self.check_interval:
if "RAY_DEBUG_DISABLE_MEMORY_MONITOR" in os.environ:
return # escape hatch, not intended for user use