-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
loader: simplify template cache invalidation #29449
Conversation
df59c14
to
5933359
Compare
/test |
/test |
/test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CODEOWNERS lgtm (did not look at the rest)
@lmb the fix references a downstream issue. Do you mind creating and linking an upstream issue so I can better understand the reason for the PR? |
@danehans We've been wanting to shorten the compiler + loader pipeline for a while now (see #25004, for example), but this particular defect came up during internal chaos testing: The fsnotify documentation states:
The agent doesn't hold open file descriptors to the files in the cache. It also ignores all fsnotify events other than REMOVE. Therefore, if we hold a file descriptor open from another process and then delete the file, the REMOVE event will never be triggered, and the cache won't see the file as deleted. However it will still attempt to read from the file. Also, as mentioned in the commit messages in this PR, inotify handles are a global resource, and global node configuration can interfere with this. As such, to reduce the amount of moving parts and reduce the potential for failures to occur, we're no longer going to rely on inotify. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome, thanks! I'd like a code walk of this once you're back, I don't have enough understanding of the surrounding system, so I can't give an in-depth review off hand aside from the odd nit.
/test |
Good thing we are early in the cycle 😅 |
/test |
/ci-ginkgo |
/ci-ginkgo |
/ci-ginkgo |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
/ci-ginkgo |
Trying to call ELF.Write on a file obtained from NewELF currently fails with EINVAL, since ELF.Write expects ELF.file to be non-nil. Fix the code so that it works with NewELF as well. Signed-off-by: Lorenz Bauer <[email protected]>
There are no external users of the object cache, remove the public constructor. Signed-off-by: Lorenz Bauer <[email protected]>
The loader tries to avoid recompiling endpoint programs if possible by caching them on disk, based on their configuration. To allow reuse it formats the configuration as a header file and hashes that. The hash is then used as a key for the cache. It also tries to be resilient to something or someone deleting a cached program by creating an inotify watcher on the state directory. This has several drawbacks: * inotify watches are a global resource and can therefore run out * Eviction of deleted cache objects is asynchronous. The loader may therefore intermittently try to use a non-existing cached file. Rewrite the cache to just fall back to recompilation if opening the cached object from disk fails. This allows getting rid of all the inotify code and is functionally equivalent. Signed-off-by: Lorenz Bauer <[email protected]>
There are no users left in the code base, remove the package. Signed-off-by: Lorenz Bauer <[email protected]>
/ci-ginkgo |
/test |
elf: fix ELF.Write for files obtained from NewELF
loader: remove NewObjectCache
loader: simplify template cache invalidation
serializer: remove package