Try to patch inotify#4672
Open
iliasu-zinc wants to merge 2 commits intolima-vm:masterfrom
Open
Conversation
This was referenced Mar 7, 2026
AkihiroSuda
reviewed
Mar 8, 2026
| type agent struct { | ||
| // Ticker is like time.Ticker. | ||
| // We can't use inotify for /proc/net/tcp, so we need this ticker to | ||
| // reload /proc/net/tcp. |
AkihiroSuda
reviewed
Mar 8, 2026
Member
There was a problem hiding this comment.
- Squash the commits
- Add Signed-off-by line to the commit message to sign the DCO
- Make the PR title descriptive, please
AkihiroSuda
reviewed
Mar 8, 2026
| socketLister *sockets.Lister | ||
| kubernetesServiceWatcher *kubernetesservice.ServiceWatcher | ||
| runtimeDir string | ||
| recentChtimes map[string]time.Time |
Member
There was a problem hiding this comment.
Needs a comment line to explain the key
AkihiroSuda
reviewed
Mar 8, 2026
| a.recentChtimes[location] = now | ||
|
|
||
| // Prevent unbounded growth during bulk operations | ||
| if len(a.recentChtimes) > 10000 { |
Member
There was a problem hiding this comment.
10000 should be defined as a const
AkihiroSuda
reviewed
Mar 8, 2026
| } | ||
| a.recentChtimes[location] = now | ||
|
|
||
| // Prevent unbounded growth during bulk operations |
Member
There was a problem hiding this comment.
Can we use LRU algorithm or something?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
When using virtiofs and inotify it seems that you can intermittently hit permission denied errors for example when running yarn install in a decently sized repository. These errors don't actually seem to be a problem with virtiofs.
virtiofs = works fine but no hot reload inside containers
virtiofs + mount inotify = hot reload inside container works but yarn install will crash with a permission denied issue
With this change hopefully we see the following;
virtiofs + mount inotify = yarn install works + hot reload works
This PR seemingly achieves this aim, but I haven't worked on Go in a long time so I'm not an expert this fix is only me debugging with strace and trying to patch what I see.
Testing Done