We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 8576f96 commit 23d3992Copy full SHA for 23d3992
compiler_gym/service/connection_pool.py
@@ -174,11 +174,18 @@ def close(self) -> None:
174
if self.closed:
175
return
176
177
- logger.debug(
178
- "Closing the service connection pool with %d cached and %d live connections",
179
- self.size,
180
- len(self.allocated),
181
- )
+ try:
+ logger.debug(
+ "Closing the service connection pool with %d cached and %d live connections",
+ self.size,
+ len(self.allocated),
182
+ )
183
+ except ValueError:
184
+ # As this method is invoked by the atexit callback, the logger
185
+ # may already have closed its streams, in which case a
186
+ # ValueError is raised.
187
+ pass
188
+
189
for connections in self.pool.values():
190
for connection in connections:
191
connection.shutdown()
0 commit comments