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

feat: update to plugin reconnect mechanics #372

Merged
merged 3 commits into from
Mar 9, 2020

Conversation

edaniszewski
Copy link
Contributor

This PR:

  • updates the approach for refreshing plugin active/inactive state by starting a task once a plugin is marked inactive in order to exponentially backoff retrying to re-establish connection with the plugin.
  • separates a notion of "active/inactive" vs "disabled". They are closely related so the distinction may be a bit confusing
    • "active/inactive": whether the plugin can be connected to (assumes that the plugin is detected as present via config/discovery)
    • "disabled": whether the plugin is showing up on refresh (e.g. discovery)
  • adds tests
  • updates dependencies

fixes #371

Copy link
Contributor

@MatthewHink MatthewHink left a comment

Choose a reason for hiding this comment

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

Just questions - LGTM

# Disable all removed plugins and stop any active tasks they may be running.
for plugin in removed:
logger.info(
'registered plugin not found during refresh, marking as disabled',
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this a logger.warn/error? (Maybe/Maybe not?)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

updated in latest commit

# is nothing to do here.
for plugin in existing:
if plugin.disabled:
logger.info(
Copy link
Contributor

Choose a reason for hiding this comment

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

+1 (disable should be disabled in the log statement)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

good catch - thanks!

@MatthewHink
Copy link
Contributor

This is probably a typo causing the build error: ModuleNotFoundError: No module named 'importlib_metadata'

Copy link
Contributor

@hoanhan101 hoanhan101 left a comment

Choose a reason for hiding this comment

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

LGTM!

@edaniszewski
Copy link
Contributor Author

updated per the reviews, but I'm still cycling a bit on this one since it looks like there is some weird python dependency stuff going on between different versions (3.6 vs 3.8) which is causing weirdness in CI

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.

None yet

4 participants