-
Notifications
You must be signed in to change notification settings - Fork 61
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
InMemoryAccountInfo is not threadsafe #175
Comments
|
Hmmm that makes sense, except this b2 api instance was previously authorized. |
I see. It might be a bug then. Could you please turn on the logs and share them so that we can see what is going on? |
Debug logging is enabled. Will report back when this error re-occurs. |
Unfortunately, the logs don't seem too helpful...
and then
|
It's a bug. |
This commit is added due to the exposure of Backblaze/b2-sdk-python#175 which is an issue in the thread-safety of InMemoryAccountInfo
@ehossack : After looking at the logs in more detail, it seems you're using a different B2Api object (and InMemoryAccount info) for each thread, so it's probably not thread safety issue but uninitialized object in one of threads after all. We'll fix InMemoryAccountInfo to be thread safe but it's not likely to fix your issue. |
To follow up, I updated my code to use the sqlite3 account info and no longer see any errors :) |
We are planning to rewrite |
Okay, so an update to this issue -> I switched to a database-backed storage system and still have this issue. It's plausible that there is a concurrency issue; however, the greater problem here I would argue is that the I'm wondering if perhaps session should just treat this exception as b2-sdk-python/b2sdk/session.py Line 460 in ce5e86e
Really the only course of action here is to clear the account data (in case it's partially stored) and do a full re-auth, so why not handle that in the SDK? |
I don't think the SDK should help automatically recover from situation that is never supposed to happen. Making |
How did you pass this as an argument to |
I believe |
Hi,
My application has thrown this exception and the cause or mitigation is unclear. This did not occur at application startup. Nothing has changed with regards to access for that key.
I have used the
InMemoryAccountInfo
class, so my guess is that this is the result of a stale entry?But am unsure how to diagnose. The documentation is sparse on this respect.
Any insight on what this could mean is appreciated :-)
The text was updated successfully, but these errors were encountered: