Skip to content

Commit

Permalink
remove unused logging
Browse files Browse the repository at this point in the history
  • Loading branch information
HaijingFu committed Sep 20, 2024
1 parent e5df65e commit 1649e9d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
1 change: 0 additions & 1 deletion axlearn/cloud/common/bastion.py
Original file line number Diff line number Diff line change
Expand Up @@ -714,7 +714,6 @@ def _append_to_job_history(self, job: Job, *, msg: str, state: JobLifecycleState
with tf_io.gfile.GFile(os.path.join(self._job_history_dir, f"{job.spec.name}"), "a") as f:
curr_time = datetime.now(timezone.utc).strftime("%m%d %H:%M:%S")
f.write(f"{curr_time} {msg}\n")
logging.info("DEBUGG 1")
# Publish event into queue.
if self._event_publisher:
self._event_publisher.publish(
Expand Down
3 changes: 2 additions & 1 deletion axlearn/cloud/common/event_queue.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ def publish(self, event: Event):
while attempt <= self._num_tries:
try:
# Ensure connection is established before publishing.
if not self._channel:
if not self._channel or not self._connection:
logging.error("RabbitMQ publisher channel is closed, reconnecting...")
self.connect()

Expand Down Expand Up @@ -228,6 +228,7 @@ def publish(self, event: Event):
except Exception as e: # pylint: disable=broad-except
# Unknown errors. Don't retry. Log to avoid crashing clients.
logging.error("Failed to publish event: %s. Error: %s.", message, str(e))
return

def _handle_publish_error(self):
"""Handle publish errors with retrying on connection issue."""
Expand Down

0 comments on commit 1649e9d

Please sign in to comment.