aeron icon indicating copy to clipboard operation
aeron copied to clipboard

[C] aeron_properties_load should not fail on non-existing file/resource

Open vyazelenko opened this issue 3 years ago • 4 comments

The Java side uses org.agrona.SystemUtil#loadPropertiesFiles(java.lang.String...) API which ignores non-existing files/resources. However the C implementation of the aeron_properties_file_load fails with error if file cannot be opened. This leads to media driver failing to start if executed from a script that points to some default files (e.g. c-media-driver script from the benchmarks project).

vyazelenko avatar Jan 14 '21 11:01 vyazelenko

Is a silent failure a really good thing for this?

tmontgomery avatar Jan 14 '21 16:01 tmontgomery

@tmontgomery It is a question of compatibility between Java and C versions of the same code. Java ignores non-existing files whereas C fails with an error. Maybe we a new Java method that would fail as well and use that instead.

Paging @mjpt777.

vyazelenko avatar Jan 14 '21 17:01 vyazelenko

The Java version has been doing this for years and @tmontgomery added it in the beginning. We could add a new flag to warn or error if it does not exist if that is a concern. Regardless of approach, I believe it is best for customers if the drivers are fungible.

mjpt777 avatar Jan 14 '21 17:01 mjpt777

Agree on them being compatible. And I am aware how it works. The question is more.... "should it" ignore a non-existent file. In the Java version, it does a try and see approach for various options (HTTP, file, etc.). I've never been totally happy with that. And it has bitten me recently. Hence the question.

tmontgomery avatar Jan 14 '21 18:01 tmontgomery