aspnet / Configuration

[Archived] Interfaces and providers for accessing configuration files. Project moved to https://github.com/aspnet/Extensions

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ConfigurationBuild.Build with non-existent Json file and reloadOnChange hangs on Ubuntu

pakrym opened this issue · comments

After instrumenting app from issue aspnet/AzureIntegration#171 with a bunch of Console.WriteLine() calls:
image

I got the following output:
image

That means that configurationBuilder.Build() hangs.

The other things to consider is that in this case, json file doesn't exist and reloadOnChange is set to true.

I also wasn't able to repro this issue outside CI test run, maybe it requires a lot of file IO to repro.

Moved from: dotnet/aspnetcore#3055

Can you try hooking the OnLoadError in case there's exceptions blowing things up?

https://github.com/aspnet/Configuration/blob/dev/src/Config.FileExtensions/FileConfigurationProvider.cs#L78

No, but why would it hang?

That's really the only line that would get called that's interesting in Load for a non existing file, so it almost certainly is the Watch call

Yeah, that's why the first time I filed this issue I filed it on FileSystem.

Can you try just running that in your scenario instead of config.Build, just call .Watch() on the json file and seeing if that also hangs?

Hopefully its just an easy bug where .Watch on Ubuntu with a non existent file hangs. At least I would hope a bug like that is a easy fix in FileSystem :)

No, it's not as easy as that, running the same app on the same machine outside CI run works just fine.
I can but it would require merging to src to even try. I would prefer to create a standalone repo now that we know it's in Configuration/FileSystem.