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

Retry on EADDRINUSE. #102

Merged
merged 2 commits into from
Sep 28, 2022
Merged

Retry on EADDRINUSE. #102

merged 2 commits into from
Sep 28, 2022

Conversation

moodyjon
Copy link
Contributor

Fixes #101

EADDRINUSE may appear in other tests or with other components, but I think this will fix the hub.herald.session one.

started = True
except OSError as e:
if e.errno is errno.EADDRINUSE:
await asyncio.sleep(3)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can this log as a warning? Otherwise LGTM

Copy link
Member

@jackrobison jackrobison Sep 26, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are there other socket errors we might get? Is this needed elsewhere too?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

_start_server() logs at error level already.

run_es_notifier() looks like it would be vulnerable to the same thing. I have not seen it in the test failures, but that could be because tests don't stop/start elastic sync a lot.

I haven't been able to determine whether there are other transient error codes.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed run_es_notifier() in similar way. Added broad logging of Exception types.

@lbry-bot lbry-bot assigned moodyjon and unassigned moodyjon Sep 27, 2022
@lbry-bot lbry-bot assigned moodyjon and unassigned moodyjon Sep 27, 2022
@lbry-bot lbry-bot assigned jackrobison and unassigned moodyjon Sep 27, 2022
@lbry-bot lbry-bot assigned moodyjon and unassigned jackrobison Sep 28, 2022
@jackrobison jackrobison merged commit 9b17822 into lbryio:master Sep 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants