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

Plugin allows adding adapters after unloadComponents #2837

Closed
relu91 opened this issue Jun 7, 2021 · 0 comments · Fixed by #2841
Closed

Plugin allows adding adapters after unloadComponents #2837

relu91 opened this issue Jun 7, 2021 · 0 comments · Fixed by #2841

Comments

@relu91
Copy link
Collaborator

relu91 commented Jun 7, 2021

This issue rises from the quest into detecting why some PRs are failing to pass CI test. Starting from my comment:

I tried to dig a little bit about why on node 10 we go a timeout in the tests. Locally, I can sometimes reproduce the issue. It seems that the virtual-things-adapter once installed it causes problems in the clean-up procedures. In particular, AFIK the addonManger.unistall is called before calling addonManager.unloadAddons. Since in the unistall we kill the process when virtual-things-adapter is unloaded, it also attempts to kill the process, but I think that there are everything blocks.

It seems that the system sometimes it is in a weird state where the addonManager tries to unload something that is already gone. Digging more into the issue I found out that in addon-manager.unistallAddon addon-manager.unloadAddon is called. That method tries to unload all the components before killing the process using the method plugin.unloadComponents. Now here all the adapters. notifiers and apiHandlers are gracefully shut down and than the plugin unloaded using plugin.unload. The problem is that sometimes in the tests the adapter exposed in the plugin is added after this clean up procedure resulting in the problem described in the comment above.

As a solution, I was wondering if it makes sense to disallow adapter addition after the unload method is called. I don't have a clear full understanding of the whole plunging management side so any input/alternative solutions is welcomed 😃

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 a pull request may close this issue.

1 participant