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

Add server command to merge config by file name #817

Merged
merged 8 commits into from
Aug 30, 2022
Merged

Add server command to merge config by file name #817

merged 8 commits into from
Aug 30, 2022

Conversation

karoliineh
Copy link
Member

Related to goblint/GobPie#32

Currently on Goblint conf file modification, GobPie kills the existing Goblint server and starts a new one:
...
This is quite undesirable since the incremental state of the server is lost. Instead GobPie should ask the Goblint server to just reload the conf file in the same process. A new Goblint server command needs to be added to merge a config by file name, instead of directly passing a JSON object to the server.

@sim642
Copy link
Member

sim642 commented Aug 8, 2022

The config merging has a caveat that only becomes relevant in server mode. For example, consider the following:

  1. Initially, by default, ana.int.interval is disabled.
  2. The initial config from the --conf argument doesn't specify a value for ana.int.interval, so that's still disabled.
  3. Then you change the config file to now enable ana.int.interval and load it, so it's now enabled.
  4. But then you undo your change to the config file (remove ana.int.interval from it) and load it again. Even though you undid your change to the config, ana.int.interval still remains enabled!

This is because merging a config, that doesn't specify the option, doesn't change or reset it either (hence the merge). It could be surprising/confusing that the config you get isn't determined by the config files you have right now, but also the entire history of them.

Having another command for resetting options to their defaults is trivial, but that also means that server.enabled and server.reparse (or any other options initially specified on the command line) get disabled in the middle of server mode. So the reasonable consistent behavior is not that simple to achieve.

src/goblint.ml Outdated Show resolved Hide resolved
src/maingoblint.ml Outdated Show resolved Hide resolved
src/util/server.ml Outdated Show resolved Hide resolved
src/goblint.ml Outdated Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants