microsoft-authentication-extensions-for-python icon indicating copy to clipboard operation
microsoft-authentication-extensions-for-python copied to clipboard

Make portalocker optional

Open rayluo opened this issue 3 years ago • 0 comments

This is currently an experimental PR. It will not be merged, not until we receive some test feedback. To beta test this PR, you will need to pull it from its feature branch.

Usage: There is no API change. MSAL EX will automatically utilize portalocker when portalocker is available in current environment, and switch to a new portalocker-less implementation otherwise.

Note:

  • A lock mechanism is only used to guard against garbled data due to concurrent read/write. A lock mechanism in itself does not make the higher level application more or less performant. When your app is overloaded, previously (i.e. before this PR) you will see portalocker.exceptions.LockException which means the locking mechanism is doing its job. After this PR, under the same heavy load, you will see LockError instead, which also means the new lock mechanism is functioning.
  • Test automation currently fails, because keyring daemon no longer works. It used to work even in headless test environment. We will look into it at a later time. But this should not affect or block the beta testing of this PR.

CC: @jiasli

rayluo avatar Oct 20 '22 06:10 rayluo