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

Dynamic load timeout #78

Merged
merged 9 commits into from
Jun 5, 2021

Conversation

brefra
Copy link
Contributor

@brefra brefra commented May 24, 2021

Based on log supplied at #76

  • Make the discovery timeout dynamically based on the number of modules. So a small setup has has short time out and a large setup with many modules takes long timeout.
  • Added an extra 1 second delay between every module load to allow some time to processing.
  • Add second try to load modules by requesting channel names again if it failed the first time.

PR still draft, as I'm currently still testing the code changes

"Failed to load module "
+ str(self._modules[module].get_module_name())
+ " at address "
+ str(self._modules[module].get_module_address())
Copy link

Choose a reason for hiding this comment

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

line too long (81 > 79 characters)

@thomasdelaet
Copy link
Owner

Thank you! I will try to take a look this weekend and get it in.

@thomasdelaet
Copy link
Owner

Hey @brefra

Thanks for doing this! I was wondering if you have looked at using the existing async_scan method. This has no timeout associated and will get you module as they are discovered. I've adapted the scan.py script in examples dir to demonstrate use.

@brefra
Copy link
Contributor Author

brefra commented Jun 3, 2021

I've seen the async_scan method. As the async_scan method only request to load the module once it will try to retrieve the module names only once too.
Unfortunately the log shows the discovery fails because the 3rd part of a channel name is not getting in. So the module won't finish the loading. The workaround in this PR is to submit new name request at the first timeout to the module to try retrieve the channel names again.

@brefra brefra marked this pull request as ready for review June 3, 2021 18:36
@thomasdelaet thomasdelaet merged commit 99c249d into thomasdelaet:master Jun 5, 2021
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