Always no-raise try-to-pop registry addrs

dereg_on_oserror
Tyler Goodlet 2023-09-15 14:20:12 -04:00
parent 687852f368
commit 3dc57e384e
1 changed files with 11 additions and 3 deletions

View File

@ -1879,8 +1879,16 @@ class Arbiter(Actor):
sockaddr: tuple[str, int],
) -> tuple[str, str]:
uid: tuple = self._registry.inverse.pop(sockaddr)
uid: tuple | None = self._registry.inverse.pop(
sockaddr,
None,
)
if uid:
log.warning(
f'Deleting registry entry for {sockaddr}@{uid}!'
)
else:
log.warning(
f'No registry entry for {sockaddr}@{uid}!'
)
return uid