daphne-project / daphne-project/daphne

Config.json values are always overwritten by default cli arguments

Open
#765 0 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
C++
Stars
81
Forks
83
PR merge metrics
No merged PRs in 30d

Description

Users can configure daphne either via cli arguments or providing a .json configuration file:
`./bin/daphne --config=UserConfig.json ...`

In [daphne.cpp](https://github.com/daphne-eu/daphne/blob/main/src/api/internal/daphne_internal.cpp) we setup the configuration object with values from the `config.json` file (if provided) and then we replace them in case the user provides command line arguments. However for a lot of cases we overwrite the values from the `.json` file with the default cli values, that have not been actually provided as CLI arguments by the user.
E.g.:

```C++
// Initialize user_config object with values from the .json file.
...
...
static opt queueSetupScheme("queue_layout",
cat(schedulingOptions), desc("Choose queue setup scheme:"),
values(
clEnumVal(CENTRALIZED, "One queue (default)"),
clEnumVal(PERGROUP, "One queue per CPU group"),
clEnumVal(PERCPU, "One queue per CPU core")
),
init(CENTRALIZED)
);
... // Default queueSetupScheme is CENTRALIZED
...
user_config.queueSetupScheme = queueSetupScheme;
```
We always replace the existing queueSetupScheme which at this point could be a parsed value from the configuration file.

Contributor guide

Open the contributing guide

Research direction

Read src/api/internal/daphne_internal.cpp, starting where the configuration object is initialized from the JSON file and where queueSetupScheme is assigned from the CLI option. Run Daphne with a config file that sets queue_layout and no corresponding CLI argument. Done means omitted CLI options preserve JSON values while explicitly provided arguments still override them.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
cli
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.