Skip to content

Commit

Permalink
Be explicit about use of repr()
Browse files Browse the repository at this point in the history
As with a recent commit (7ec9c67) tell the format string what we're
specifically after.
  • Loading branch information
khk-globus committed Dec 12, 2023
1 parent 6938d1d commit efba939
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions compute_sdk/globus_compute_sdk/sdk/executor.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ def __init__(
self._shutdown_lock = threading.RLock()
self._result_watcher: _ResultWatcher | None = None

log.debug("%s: initiated on thread: %s", self, threading.get_ident())
log.debug("%r: initiated on thread: %s", self, threading.get_ident())
self._task_submitter = threading.Thread(
target=self._task_submitter_impl, name="TaskSubmitter"
)
Expand Down Expand Up @@ -661,10 +661,10 @@ def reload_tasks(

def shutdown(self, wait=True, *, cancel_futures=False):
thread_id = threading.get_ident()
log.debug("%s: initiating shutdown (thread: %s)", self, thread_id)
log.debug("%r: initiating shutdown (thread: %s)", self, thread_id)
if self._task_submitter.is_alive():
log.debug(
"%s: %s still alive; sending poison pill",
"%r: %s still alive; sending poison pill",
self,
self._task_submitter.name,
)
Expand All @@ -686,7 +686,7 @@ def shutdown(self, wait=True, *, cancel_futures=False):
# that scenario by adding a slight delay on the *main* thread.
time.sleep(0.1)
_REGISTERED_FXEXECUTORS.pop(id(self), None)
log.debug("%s: shutdown complete (thread: %s)", self, thread_id)
log.debug("%r: shutdown finished (thread: %s)", self, thread_id)

def _task_submitter_impl(self) -> None:
"""
Expand All @@ -701,7 +701,7 @@ def _task_submitter_impl(self) -> None:
in the queue. (See ``shutdown()``.)
"""
log.debug(
"%s: task submission thread started (%s)", self, threading.get_ident()
"%r: task submission thread started (%s)", self, threading.get_ident()
)
to_send = self._tasks_to_send # cache lookup

Expand Down Expand Up @@ -815,7 +815,7 @@ def __hash__(self):
self._stopped = True
self._stopped_in_error = True
log.debug(
"%s: task submission thread encountered error ([%s] %s)",
"%r: task submission thread encountered error ([%s] %s)",
self,
exc.__class__.__name__,
exc,
Expand All @@ -825,7 +825,7 @@ def __hash__(self):
self.shutdown(wait=False, cancel_futures=True)
self._shutdown_lock.release()

log.debug("%s: task submission thread dies", self)
log.debug("%r: task submission thread dies", self)
raise
finally:
if sys.exc_info() != (None, None, None):
Expand All @@ -840,7 +840,7 @@ def __hash__(self):
self._tasks_to_send.task_done()
except ValueError:
pass
log.debug("%s: task submission thread complete", self)
log.debug("%r: task submission thread complete", self)

def _submit_tasks(
self,
Expand Down

0 comments on commit efba939

Please sign in to comment.