Testbed Reload Configurations Mechanism#437
Conversation
…ives user a mechanism to load confiugrations without restarting testbed.
There was a problem hiding this comment.
This file might've been committed accidentally?
There was a problem hiding this comment.
oops! thanks for catching that
| if 'testbed' in new_config and 'simulated' in new_config['testbed']: | ||
| self.is_simulated = new_config['testbed']['simulated'] | ||
|
|
||
| # Check for added/removed services |
There was a problem hiding this comment.
You're just checking new/removed services, but not updating the dependency graph. A correct dependency graph is required for correct shutdown of the testbed.
| } | ||
|
|
||
| // Invalidate cached config so it gets refetched on next access | ||
| m_HasGottenInfo = false; |
There was a problem hiding this comment.
This variable is just for this instance of a TestbedProxy. It won't affect other TestbedProxy objects. I think you're aware of this, but I wanted to make sure.
| dependencies = service_info.get('depends_on', []) | ||
| self.services[service_id] = ServiceReference(service_id, service_type, ServiceState.CLOSED, dependencies, self.message_broker) | ||
|
|
||
| if removed: |
There was a problem hiding this comment.
Maybe we could also have a warning for services that are running of which the config has changed?
There was a problem hiding this comment.
I have been using this mechanism to update flat maps, tip tilt stage position defaults, camera offset_x, offset_y defaults in case we want to start / stop the services and have them come up the the new default without restarting the testbed. Since this is all tracked in the services.yml config file I can track it on git. Generally speaking when I hit reload I want to make sure the new configs are in place. A warning may over alert the user. Maybe info level would be a good way to status what has changed. I could go either way though
There was a problem hiding this comment.
Agreed on INFO. I meant "warning" as in "some kind of log message" rather than "a warning log message". I could've been more clear on that.
Adds a
reload_configmechanism to the testbed so configuration can be updated without restarting the entire testbed process.This does NOT force running services to use the new configuration. However when a service starts for the first time after configuration is reloaded, or individual service is restarted it will obtain the new configuration from the testbed.