-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
libfetchers: Don't have a single shared tarball cache #14620
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
Conversation
|
Root cause triaged with @roberth |
|
The It does still perform:
This has some overhead that would be nice to avoid somehow, but we have some added constraints
More sharing is probably best achieved within the libgit2 codebase. |
roberth
left a comment
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.
Maybe leave a comment that GitRepo is not thread safe
1f33929 to
55bc46d
Compare
|
Added a comment. Hopefully we won't step on this landmine any more in the future. |
|
I don't get how making it a global again prevents multi-threaded access? Also what's ODB corruption? My Google search did not answer that question. |
It's not a global. openRepo returns a fresh GitRepo object. The only global there is the path to the tarball cache. |
|
@Ericson2314 has convinced me that rather than a full revert we can do a smaller diff change by just making |
55bc46d to
849a222
Compare
This partially reverts commit bc6b9ce. This transformation is unsound and thread unsafe. Internal libgit2 structures must *never* be shared between threads. This causes internal odb corruption with e.g.: nix flake prefetch-inputs: error: … while fetching the input 'github:nixos/nixpkgs/89c2b2330e733d6cdb5eae7b899326930c2c0648?narHash=sha256-Stk9ZYRkGrnnpyJ4eqt9eQtdFWRRIvMxpNRf4sIegnw%3D' error: adding a file to a tree builder: failed to insert entry: invalid object specified - upload-image.sh error: … while fetching the input 'github:NixOS/nixpkgs/a8d610af3f1a5fb71e23e08434d8d61a466fc942?narHash=sha256-v5afmLjn/uyD9EQuPBn7nZuaZVV9r%2BJerayK/4wvdWA%3D' error: adding a file to a tree builder: failed to insert entry: invalid object specified - outline.nix double free or corruption (!prev) Thread 21 "nix" received signal SIGABRT, Aborted.
849a222 to
385d7e7
Compare
Motivation
This partially reverts commit bc6b9ce.
This transformation is unsound and thread unsafe. Internal libgit2
structures must never be shared between threads. This causes
internal odb corruption with e.g.:
nix flake prefetch-inputs:
Context
Add 👍 to pull requests you find important.
The Nix maintainer team uses a GitHub project board to schedule and track reviews.