Skip to content

Testbed Reload Configurations Mechanism#437

Open
lanemeier7 wants to merge 1 commit into
developfrom
feature/reloading-service-configurations
Open

Testbed Reload Configurations Mechanism#437
lanemeier7 wants to merge 1 commit into
developfrom
feature/reloading-service-configurations

Conversation

@lanemeier7

Copy link
Copy Markdown
Collaborator

Adds a reload_config mechanism 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.

…ives user a mechanism to load confiugrations without restarting testbed.
@lanemeier7 lanemeier7 requested review from ehpor and steigersg May 4, 2026 23:24
@lanemeier7 lanemeier7 linked an issue May 4, 2026 that may be closed by this pull request
@lanemeier7 lanemeier7 requested a review from ivalaginja May 18, 2026 23:54
Comment thread proto/service.proto

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This file might've been committed accidentally?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

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

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

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;

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

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:

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Maybe we could also have a warning for services that are running of which the config has changed?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

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

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

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.

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.

Reloading Service Configurations

2 participants