From 436a64f9aee759260b1d9cb32bf4bac42e253cb3 Mon Sep 17 00:00:00 2001 From: Chris Cummins Date: Mon, 7 Mar 2022 17:57:13 +0000 Subject: [PATCH] [service] Tweak logging messages. --- compiler_gym/service/connection_pool.py | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/compiler_gym/service/connection_pool.py b/compiler_gym/service/connection_pool.py index 6630f191d5..37d9ce4030 100644 --- a/compiler_gym/service/connection_pool.py +++ b/compiler_gym/service/connection_pool.py @@ -131,10 +131,7 @@ def release(self, service: CompilerGymServiceConnection) -> None: return if service not in self.allocated: - logger.debug( - "Ignoring attempt to release connection " - "that does not belong to pool" - ) + logger.debug("Discarding service that does not belong to pool") return self.allocated.remove(service) @@ -143,11 +140,11 @@ def release(self, service: CompilerGymServiceConnection) -> None: if hasattr(service.connection, "process"): # A dead service cannot be reused, discard it. if service.closed or service.connection.process.poll() is not None: - logger.debug("Ignoring attempt to release dead connection") + logger.debug("Discarding service with dead process") return # A service that has been shutdown cannot be reused, discard it. if not service.connection: - logger.debug("Ignoring attempt to service without connection") + logger.debug("Discarding service that has no connection") return self.pool[key].append(service) @@ -209,7 +206,7 @@ def get() -> "ServiceConnectionPool": return _SERVICE_CONNECTION_POOL def __repr__(self) -> str: - return f"ServiceConnectionPool(size={self.size})" + return f"{type(self).__name__}(size={self.size})" _SERVICE_CONNECTION_POOL = ServiceConnectionPool()