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
Document thread-safety of librpm #1483
Comments
Are there problems due to concurrent calls to To me, it seems safer to only invoke the RPM transaction APIs when only one thread is running. @pmatilai thoughts? |
Well yes, most people will find the going along a running transaction a bit too much when not just the current directory but also the root can change and whatnot. |
The reason I am asking is that I am working on (not yet published) Rust bindings to a small part of the RPM API. Rust requires that safe code not be able to invoke undefined behavior. Is it safe to |
FWIW in rpm-ostree we reimplement most of the RPM install path for multiple reasons (among them we "snapshot" multiple RPM versions into ostree commits as part of implementing transactional updates, we want to sandbox scripts etc.) but another big reason is that we simply cannot have librpm call (Also on this topic btw rpm-ostree is oxidizing fast now, see e.g. coreos/rpm-ostree#2502 which I just submitted - so if there's RPM+Rust topics it might come up there too) |
@cgwalters Nice! I’m working on Rust bindings to a small part of the RPM API. |
It depends on so many factors I can't possibly answer such a question. |
Does librpm use |
RPM depends on SQLite which cannot safely used in a child process after |
@DemiMarie Note that there are already RPM Rust bindings that you can contribute to: https://github.com/rpm-software-management/librpm.rs |
I have not been able to determine if librpm is thread-safe. From looking at the code, it appears not to be, for several reasons:
This is merely a request for documentation of the status quo. The best way to use librpm in a multithreaded process is most likely to spawn the rpm binary. Parts of librpm, such as signature verification, are probably thread-safe, but running transactions probably isn’t.
The text was updated successfully, but these errors were encountered: