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

Unregistering service results in ValueError when application stops #251

Closed
JCorson opened this issue Dec 19, 2019 · 0 comments · Fixed by #345
Closed

Unregistering service results in ValueError when application stops #251

JCorson opened this issue Dec 19, 2019 · 0 comments · Fixed by #345
Assignees

Comments

@JCorson
Copy link

JCorson commented Dec 19, 2019

I am getting a ValueError when stopping my application after unregistering a service provided by a ServiceOffer in another plugin.

After some digging, it looks like the CorePlugin._service_ids contains a list of service IDs that were provided to the 'envisage.service_offers' extension point. Then when the plugin stops, it attempts to unregister those services. However, if one of those services was unregistered with Application.unregister_service(<id>), the id is not also removed from CorePlugin._service_ids and stopping the plugin results in the following:

  File "/Users/jcorson/.edm/envs/foo/lib/python3.6/site-packages/envisage/application.py", line 338, in stop
    self.plugin_manager.stop()
  File "/Users/jcorson/.edm/envs/foo/lib/python3.6/site-packages/envisage/composite_plugin_manager.py", line 167, in stop
    self.stop_plugin(plugin)
  File "/Users/jcorson/.edm/envs/foo/lib/python3.6/site-packages/envisage/composite_plugin_manager.py", line 177, in stop_plugin
    plugin.activator.stop_plugin(plugin)
  File "/Users/jcorson/.edm/envs/foo/lib/python3.6/site-packages/envisage/plugin_activator.py", line 49, in stop_plugin
    plugin.unregister_services()
  File "/Users/jcorson/.edm/envs/foo/lib/python3.6/site-packages/envisage/plugin.py", line 285, in unregister_services
    for service_id in service_ids:
  File "/Users/jcorson/.edm/envs/foo/lib/python3.6/site-packages/envisage/application.py", line 422, in unregister_service
    self.service_registry.unregister_service(service_id)
  File "/Users/jcorson/.edm/envs/foo/lib/python3.6/site-packages/envisage/service_registry.py", line 191, in unregister_service
    raise ValueError('no service with id <%d>' % service_id)
ValueError: no service with id <13>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants