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

hazelcast.config is ignored if given file does not have file extension "xml", "yaml" or "yml" #14924

Closed
olukas opened this issue Apr 23, 2019 · 0 comments · Fixed by #14953
Closed
Assignees
Milestone

Comments

@olukas
Copy link
Contributor

olukas commented Apr 23, 2019

When HZ configuration is set by hazelcast.config and given file does not have extension "xml", "yaml" or "yml" then locator of configuration file silently ignore hazelcast.config and continue in lookup to another step A file named hazelcast.xml located in the application's working directory.

It can be confusing for users since configuration file in hazelcast.config is set deliberately but Hazelcast can be started with different configuration without throwing any exception.

In HZ version older than 3.12 every file passed to Hazelcast by hazelcast.config was considered as xml file and tried to be parsed. It means that valid xml file with name hazelcast-config.whatever passed by hazelcast.config property was correctly used as HZ configuration file. It is regression in 3.12 since in current implementation file hazelcast-config.whatever is silently ignored and different file is used as Hazelcast configuration.

@olukas olukas added this to the 3.12.1 milestone Apr 23, 2019
@blazember blazember self-assigned this Apr 23, 2019
blazember added a commit to blazember/hazelcast that referenced this issue Apr 26, 2019
3.12 introduced a regression that configuration files with suffixes not
in [xml,yaml,yml] passed in system property are ignored silently and
the config resolution continues following the resolution priority, most
likely resolving the default XML configuration shipped with the jar. The
expected behavior is:
- if the system property is set we fail fast if we can't load the config
from the referenced resource/file
- if the file in the system property has a suffix [yaml,yml], we treat it
as YAML config
- if the file in the system property has any other suffix (or don't have
suffix), we treat it as XML config

Note that in 4.0 the fix will be different, we enforce the config files
to have suffix from the [xml,yaml,yml] list.

This commit fixes this behavior in member, client and client-failover
config resolution, with additional tests verifying the resolution logic.

Fixes hazelcast#14924
blazember added a commit to blazember/hazelcast that referenced this issue Apr 28, 2019
3.12 introduced a regression that configuration files with suffixes not
in [xml,yaml,yml] passed in system property are ignored silently and
the config resolution continues following the resolution priority, most
likely resolving the default XML configuration shipped with the jar. The
expected behavior is:
- if the system property is set we fail fast if we can't load the config
from the referenced resource/file
- if the file in the system property has a suffix [yaml,yml], we treat it
as YAML config
- if the file in the system property has any other suffix (or don't have
suffix), we fail fast enforcing to use suffixes from the [xml,yaml,yml]
list.

This commit fixes this behavior in member, client and client-failover
config resolution, with additional tests verifying the resolution logic.

Fixes hazelcast#14924
blazember added a commit to blazember/hazelcast that referenced this issue Apr 29, 2019
3.12 introduced a regression that configuration files with suffixes not
in [xml,yaml,yml] passed in system property are ignored silently and
the config resolution continues following the resolution priority, most
likely resolving the default XML configuration shipped with the jar. The
expected behavior is:
- if the system property is set we fail fast if we can't load the config
from the referenced resource/file
- if the file in the system property has a suffix [yaml,yml], we treat it
as YAML config
- if the file in the system property has any other suffix (or don't have
suffix), we fail fast enforcing to use suffixes from the [xml,yaml,yml]
list.

This commit fixes this behavior in member, client and client-failover
config resolution, with additional tests verifying the resolution logic.

Fixes hazelcast#14924
blazember added a commit that referenced this issue May 6, 2019
3.12 introduced a regression that configuration files with suffixes not
in [xml,yaml,yml] passed in system property are ignored silently and
the config resolution continues following the resolution priority, most
likely resolving the default XML configuration shipped with the jar. The
expected behavior is:
- if the system property is set we fail fast if we can't load the config
from the referenced resource/file
- if the file in the system property has a suffix [yaml,yml], we treat it
as YAML config
- if the file in the system property has any other suffix (or don't have
suffix), we treat it as XML config

Note that in 4.0 the fix will be different, we enforce the config files
to have suffix from the [xml,yaml,yml] list.

This commit fixes this behavior in member, client and client-failover
config resolution, with additional tests verifying the resolution logic.

Fixes #14924
@mmedenjak mmedenjak added the Source: Internal PR or issue was opened by an employee label Jan 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants