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
Loading
Please register or sign in to comment