-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
cargo-credential-libsecret: load libsecret only once #15295
base: master
Are you sure you want to change the base?
Conversation
Previously, libsecret was loaded and unloaded multiple times, leading to issues where calls could run indefinitely due to glib not properly cleaning up. Now, libsecret is stored in a OnceLock, ensuring it is only loaded once, preventing unnecessary unload/reload cycles.
The main thing I'm wondering is if this is the right layer of caching. Alternatively, we could lazy load these fields in A potential way to side step any of that is for us to not load the library multiple times. It looks like during |
Thanks for your feedback.
I will check
This would be a good optimization, but it wouldn't fully resolve the issue. I discovered that libsecret is also loaded multiple times when multiple registries are present. By the way, should i open a issue too? |
Let's keep things simple for the first pass and put the |
@rustbot author Let us know if you have any question! |
Reminder, once the PR becomes ready for a review, use |
Previously, libsecret was repeatedly loaded and unloaded—at least twice during cargo login (once for action get and once for action login). This caused issues where calls could hang indefinitely due to glib failing to clean up properly (some threads still running after unloading) and generating numerous error messages:
Now, libsecret is stored in a OnceLock, ensuring it is only loaded once, preventing unnecessary unload/reload cycles.