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

The carbon.properties file are loaded before the toml configuration applied #2555

Open
senthalan opened this issue Jan 27, 2020 · 1 comment

Comments

@senthalan
Copy link
Contributor

Description:
Currently, in the Bootstrap[1] carbon.properties are loaded to the system. But the deployment.toml configurations are applied in the Main[2] which will be executed after system properties are added in [1].

We allow updating the carbon.properties file through the deployment.toml. But due to the above behaviour, those properties defined through deployment.toml will not be applied in the first server startup. It will be applied only after the next restart.

It seems like a bug. To fix this, we can bring the config-mapper invocation to the Bootstrap. This will guarantee that any change we do to configuration files are available to the server.

[1] - https://github.com/wso2-support/carbon4-kernel/blob/support-4.5.1/core/org.wso2.carbon.bootstrap/src/main/java/org/wso2/carbon/bootstrap/Bootstrap.java#L56
[2] - https://github.com/wso2-support/carbon4-kernel/blob/support-4.5.1/core/org.wso2.carbon.server/src/main/java/org/wso2/carbon/server/Main.java#L103

@senthalan
Copy link
Contributor Author

we have a concern in this approach because in the config-mapping we can have $sys() do load the system properties. So we can't move the config-mapper invocation before loading the system properties from the carbon.properties.

we need to check the possibility of having the system properties in the deployment.toml and config-mapper have to load those properties to the system and then we can remove the carbon.properties file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant