Skip to content
Commit 11d76b6e authored by Arun Babu Neelicattu's avatar Arun Babu Neelicattu Committed by Randy Döring
Browse files

fix(keyring): make keyring unlock thread safe

When using `poetry install`, Poetry executor prefers to execute
operations using a `concurrent.futures.ThreadPoolExecutor`. This can
lead to multiple credential store unlock requests to be dispatched
simultaneously.

If the credential store is locked, and a user either intentionally or
unintentionally dismisses the prompt to provide the store password; or
the dbus messages fail to launch the prompter the Poetry user can
experience, what can appear as a "hang". This in fact can be several
threads competing with each other waiting for a dbus event indefinitely;
this is a consequence of how Poetry uses keyring.

This change introduces the following:

- pre-flight check for installer commands that ensures keyring unlocks
  only once for the duration of the command
- improved logging of keyring unlock event and/or failure
- thread safe caching of `PasswordManager.<use_keyring|keyring>`

This change does not address the following:

- handling cases where dbus message fails or prompter is blocked
- authentication of a locked keyring in a non-tty session
parent 1ac829f5
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment