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

catch gaierror and improve startup speed #1498

Merged
merged 1 commit into from
Aug 28, 2023
Merged

catch gaierror and improve startup speed #1498

merged 1 commit into from
Aug 28, 2023

Conversation

rodja
Copy link
Member

@rodja rodja commented Aug 27, 2023

This pull request fixes #1178 by catching gaierror. the error can be reproduced by deactivating all sharing features on in the MacOS settings, restarting the laptop and deinstalling netifaces.

While using this setup I noticed a significant delay of five seconds before NiceGUI really starts. This is caused by the default dns timeout on the hostname which seems not to be added to the /etc/hosts file if no sharing features are activated on MacOS (see https://apple.stackexchange.com/a/253834/26268). Making netifaces or psutils a dependency is not an option because it would require c++ and python-dev dependencies for building on some architectures. Thus I made the message printing async and hence independent of the startup.

@rodja rodja added the enhancement New feature or request label Aug 27, 2023
@rodja rodja added this to the 1.3.13 milestone Aug 27, 2023
@falkoschindler falkoschindler merged commit 507314f into main Aug 28, 2023
5 checks passed
@falkoschindler falkoschindler deleted the ip_addresses branch August 28, 2023 08:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

run on macos report socket.gaierror: [Errno 8] nodename nor servname provided, or not known
2 participants