Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit a2e8567

Browse files
committedFeb 18, 2025··
Add exception logging for NRTM4 server
1 parent 44276ad commit a2e8567

File tree

1 file changed

+14
-4
lines changed

1 file changed

+14
-4
lines changed
 

‎irrd/mirroring/nrtm4/nrtm4_server.py

+14-4
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,15 @@ def __init__(self, source: str):
5252

5353
def run(self) -> None:
5454
database_handler = DatabaseHandler()
55-
NRTM4ServerWriter(self.source, database_handler).run()
56-
database_handler.close()
55+
try:
56+
NRTM4ServerWriter(self.source, database_handler).run()
57+
except Exception as exc: # pragma: no cover
58+
logger.error(
59+
f"{self.source}: An exception occurred during an NRTMv4 server update: {exc}", exc_info=exc
60+
)
61+
raise
62+
finally:
63+
database_handler.close()
5764

5865

5966
class NRTM4ServerWriter:
@@ -102,15 +109,18 @@ def _update_status(self):
102109
def run(self):
103110
status_lockfile = get_lockfile(self.status_lockfile_path, blocking=False)
104111
if not status_lockfile: # pragma: no cover - covered in integration
105-
logger.debug(f"{self.source}: NRTMv4 server not running, status changes locked by other server")
112+
logger.debug(
113+
f"{self.source}: NRTMv4 server update cancelled, status changes locked by other server"
114+
)
106115
return
107116

108117
self._update_status()
109118
if not self.status:
110119
return
111120
if self.force_reload:
112121
logger.debug(
113-
f"{self.source}: NRTMv4 server not running, as force_reload is set - waiting on new import"
122+
f"{self.source}: NRTMv4 server update cancelled, as force_reload is set - waiting on new"
123+
" import"
114124
)
115125
return
116126

0 commit comments

Comments
 (0)
Please sign in to comment.