Bugfix: avoid race condition when refreshing google token #2100
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hello,
I have been having an issue with the refresh token when launching multiple Gemini agents concurrently.
Here is a minimal reproducible code:
Class handling agent
This class is called and used from a coroutine
and this coroutine is called concurrently in a Semaphore
I would randomly get this error, not consistently, even though all the instances have the service_account_file configured to
shared/config/gemini.json
, seems like a race condition:with the help of Mert Sırakaya, here is a patch for this error, I have tried running the test many times after the patch, I don't have any errors, and then tried again without the patch and I occasionally got the error again.
For the typing lint I have put
ignore[reportUnknownMemberType]
comments because I didn't know what else to do, I'm open to better suggestions