You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Docker version 18.09.6-dev, build 95c7371304f9cef494efe93f0a8ffd53a75eac21
.NET Core 2.2
Unix system (based on Yocto OS)
We measured the number of notify instances with: for foo in /proc/*/fd/*; do readlink -f $foo; done | grep inotify | sort | uniq -c | sort -nr
Once we hit the configured number of inotify instances we see the following errors:
Unhandled Exception: System.IO.IOException: The configured user limit (128) on the number of inotify instances has been reached.
at System.IO.FileSystemWatcher.StartRaisingEvents()
at System.IO.FileSystemWatcher.StartRaisingEventsIfNotDisposed()
at System.IO.FileSystemWatcher.set_EnableRaisingEvents(Boolean value)
at Microsoft.Extensions.FileProviders.Physical.PhysicalFilesWatcher.TryEnableFileSystemWatcher()
at Microsoft.Extensions.FileProviders.Physical.PhysicalFilesWatcher.CreateFileChangeToken(String filter)
at Microsoft.Extensions.FileProviders.PhysicalFileProvider.Watch(String filter)
at Microsoft.Extensions.Configuration.FileConfigurationProvider.<.ctor>b__0_0()
at Microsoft.Extensions.Primitives.ChangeToken.OnChange(Func`1 changeTokenProducer, Action changeTokenConsumer)
at Microsoft.Extensions.Configuration.FileConfigurationProvider..ctor(FileConfigurationSource source)
at Microsoft.Extensions.Configuration.Json.JsonConfigurationSource.Build(IConfigurationBuilder builder)
grabbing logs: error opening journald follow descriptor: "Too many open files"
grabbing logs: error opening journald follow descriptor: "Too many open files"
Temporary we fixed the error by configuring a larger number: sysctl -w fs.inotify.max_user_instances=512.
But this is not ok having into account that containers can be restarted multiple times and we will still hit this limit after 10 restarts.
What we tried:
Disable reloadOnChange by using custom WebHostBuilder
This didn’t help. The number of inotify instances still increased after container restart.
Configure ENV DOTNET_USE_POLLING_FILE_WATCHER=true in dockerfile.
This didn’t help either. The number of inotify objects increased after container restart.
We don't need any file watching, the file handle should be closed properly after the file has been read. How can we accomplish this? Updating to asp .netcore 3.0 isn't an option, a fix should be provided.
Any info and update is welcome, we can provide more info if needed.
Hi,
We have the following setup:
We measured the number of notify instances with:
for foo in /proc/*/fd/*; do readlink -f $foo; done | grep inotify | sort | uniq -c | sort -nr
Once we hit the configured number of inotify instances we see the following errors:
Temporary we fixed the error by configuring a larger number:
sysctl -w fs.inotify.max_user_instances=512
.But this is not ok having into account that containers can be restarted multiple times and we will still hit this limit after 10 restarts.
What we tried:
This didn’t help. The number of inotify instances still increased after container restart.
This didn’t help either. The number of inotify objects increased after container restart.
We don't need any file watching, the file handle should be closed properly after the file has been read. How can we accomplish this? Updating to asp .netcore 3.0 isn't an option, a fix should be provided.
Any info and update is welcome, we can provide more info if needed.
This is related to: https://github.com/dotnet/corefx/issues/32024 however this was closed without a proper fix to turn off the file watching.
The text was updated successfully, but these errors were encountered: