Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
fix RestartModule #4114
fix RestartModule #4114
Changes from all commits
9111a0f
868692f
08feac6
2159304
fdb69f2
5e1c677
e87906d
450353a
783631b
e9c63f5
b58e891
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To make sure I understand the fuller lifecycle of a real viam-server here. If this test were to continue from here with:
cfg, err := config.Read(ctx, cfgPath, logger)
r.Reconfigure(cfg)
I expect that
cfg.Modules[0].LocalVersion
value to be the default value/empty string. And the robot would consider this a diff and restart the module? Presumably unpackaging it back into the "0.0.0" directory (or whatever gets used for the default scenario).There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the state is stored in the localRobot, not in the config
so in your example, if
r
is reused, the freshconfig.Read
won't overwrite the version state; it will be restored by ther.applyLocalModuleVersions(newConfig)
callin
reconfigure
at L1168 hereThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This makes sense -- thanks for pointing me to the important missing link here!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fwiw it would be very nice if we could store it in config; would make it way easier to understand the state for reloading + local tarball
I often start these PRs by mutating the Config struct and then am confused for an hour bc it is getting overwritten or I am mutating a copy
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed, I'd like to have a better story here as well.