open FSharp.Configuration
type Config = YamlConfig<YamlText=@"SampleConfig:",ReadOnly=true>
// loops indefinitely
Config().Load("./some/nonexistent/config.yml")
Expected behavior
tryReadNonEmptyTextFile eventually stops trying to load the file.
Actual behavior
Sample fsi output:
Attempt 1 of 5: cannot read ./some/nonexistent/config.yml. Sleep for 1 sec, then retry...
Attempt 2 of 5: cannot read ./some/nonexistent/config.yml. Sleep for 1 sec, then retry...
Attempt 3 of 5: cannot read ./some/nonexistent/config.yml. Sleep for 1 sec, then retry...
Attempt 4 of 5: cannot read ./some/nonexistent/config.yml. Sleep for 1 sec, then retry...
Attempt 5 of 5: cannot read ./some/nonexistent/config.yml. Sleep for 1 sec, then retry...
Attempt 6 of 5: cannot read ./some/nonexistent/config.yml. Sleep for 1 sec, then retry...
Attempt 7 of 5: cannot read ./some/nonexistent/config.yml. Sleep for 1 sec, then retry...
Attempt 8 of 5: cannot read ./some/nonexistent/config.yml. Sleep for 1 sec, then retry...
Description
FSharp.Configuration.Helper.File.tryReadNonEmptyTextFile
loops indefinitely if file is not found.https://github.com/fsprojects/FSharp.Configuration/blob/46d6db2b88b7445497314aa4d6a33772223c88c5/src/FSharp.Configuration/TypeProviders.Helper.fs#L218-L233
Repro steps
Expected behavior
tryReadNonEmptyTextFile
eventually stops trying to load the file.Actual behavior
Sample fsi output: