Skip to content

Commit

Permalink
asnbl-helper.py: Catch BlockingIOError while resolving ASNs for good …
Browse files Browse the repository at this point in the history
…measure

Signed-off-by: twesterhever <40121680+twesterhever@users.noreply.github.com>
  • Loading branch information
twesterhever committed Jan 7, 2023
1 parent d046525 commit c10ccaa
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion asnbl-helper.py
Expand Up @@ -181,7 +181,12 @@ def resolve_asn(ipaddr: str, asndb):

# libloc cannot handle ipaddress objects here, so casting into a string is necessary
# for good measure, to avoid exceptions here...
result = asndb.lookup(str(ipaddr))
try:
result = asndb.lookup(str(ipaddr))
except BlockingIOError:
# XXX: Prevent likely libloc bug from causing this helper to crash
# (see upstream bug https://bugzilla.ipfire.org/show_bug.cgi?id=13023)
pass

# In case nothing was returned above, satisfy result expectation to this function...
try:
Expand Down

0 comments on commit c10ccaa

Please sign in to comment.