You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tooling.apache.org by sb...@apache.org on 2025/07/08 16:28:40 UTC

(tooling-trusted-release) branch main updated: Improve PubSub logging

This is an automated email from the ASF dual-hosted git repository.

sbp pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/tooling-trusted-release.git


The following commit(s) were added to refs/heads/main by this push:
     new 54fa2ed  Improve PubSub logging
54fa2ed is described below

commit 54fa2ede8e8ce13a3ac26ab01946f1c793099430
Author: Sean B. Palmer <se...@miscoranda.com>
AuthorDate: Tue Jul 8 17:28:22 2025 +0100

    Improve PubSub logging
---
 atr/server.py     | 6 +++---
 atr/svn/pubsub.py | 2 ++
 2 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/atr/server.py b/atr/server.py
index 167db3d..06cb0cd 100644
--- a/atr/server.py
+++ b/atr/server.py
@@ -156,7 +156,7 @@ def app_setup_lifecycle(app: base.QuartApp) -> None:
         pubsub_password = conf.PUBSUB_PASSWORD
 
         if pubsub_url and pubsub_user and pubsub_password:
-            app.logger.info("Starting SVN listener")
+            app.logger.info("Starting PubSub SVN listener")
             listener = pubsub.SVNListener(
                 working_copy_root=conf.SVN_STORAGE_DIR,
                 url=pubsub_url,
@@ -165,10 +165,10 @@ def app_setup_lifecycle(app: base.QuartApp) -> None:
             )
             task = asyncio.create_task(listener.start())
             app.extensions["svn_listener"] = task
-            app.logger.info("SVN listener task created")
+            app.logger.info("PubSub SVN listener task created")
         else:
             app.logger.info(
-                "SVN listener not started: url=%s user=%s password=%s",
+                "PubSub SVN listener not started: pubsub_url=%s pubsub_user=%s pubsub_password=%s",
                 bool(pubsub_url),
                 bool(pubsub_user),
                 # Essential to use bool(...) here to avoid logging the password
diff --git a/atr/svn/pubsub.py b/atr/svn/pubsub.py
index a75d95e..c82e931 100644
--- a/atr/svn/pubsub.py
+++ b/atr/svn/pubsub.py
@@ -55,6 +55,7 @@ class SVNListener:
         """Run forever, processing PubSub payloads as they arrive."""
         # TODO: Add reconnection logic here?
         # Or does asfpy.pubsub.listen() already do this?
+        _LOGGER.info("SVNListener.start() called")
         async for payload in asfpy.pubsub.listen(
             # TODO: Upstream this change to BAT
             urllib.parse.urljoin(self.url, self.topics),
@@ -71,6 +72,7 @@ class SVNListener:
 
             _LOGGER.debug("PubSub payload: %s", payload)
             await self._process_payload(payload)
+        _LOGGER.info("SVNListener.start() finished")
 
     async def _process_payload(self, payload: dict) -> None:
         """


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@tooling.apache.org
For additional commands, e-mail: commits-help@tooling.apache.org