Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tracereport: also catch gaierror for gethostbyaddr() #116

Closed

Conversation

olifre
Copy link
Contributor

@olifre olifre commented Mar 14, 2024

socket.gethostbyaddr() throws a socket.gaierror exception if the address can not be resolved which was not caught before.

Fixes regression introduced by e7d7c6f , after which Pilot yielded stage-in and stage-out errors with backtrace for sites using a non-DNS resolvable PANDA_HOSTNAME (VMs, long-lived containers,...).

socket.gethostbyaddr() throws a socket.gaierror exception
if the address can not be resolved which was not caught before.

Fixes regression introduced by e7d7c6f , after which
Pilot yielded stage-in and stage-out errors with backtrace
for sites using a non-DNS resolvable PANDA_HOSTNAME
(VMs, long-lived containers,...).
@olifre
Copy link
Contributor Author

olifre commented Mar 14, 2024

Example Python script illustrating the problem:

#!/usr/bin/python3

import os
import socket

try:
    socket.gethostbyaddr("does_not_resolve")[0]
except socket.herror as exc:
    print("caught")

This yields:

Traceback (most recent call last):
  File "check_ip_bad.py", line 7, in <module>
    socket.gethostbyaddr("does_not_resolve")[0]
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
socket.gaierror: [Errno -2] Name or service not known

@PalNilsson
Copy link
Collaborator

Thanks but please make the PR to the next branch instead.

@PalNilsson PalNilsson closed this Mar 15, 2024
@olifre
Copy link
Contributor Author

olifre commented Mar 15, 2024

@PalNilsson Sure, done: #117

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants