Using a default HTTP timeout in db module - #395
Closed
hiranya911 wants to merge 3 commits into
Closed
Conversation
Contributor
Author
|
Closing in favor of #397 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
The
google-authpackage now sets a default timeout of 120 seconds for all outgoing requests (see googleapis/google-auth-library-python#435). This is causing a couple of test failures in our codebase: https://github.com/firebase/firebase-admin-python/actions/runs/32412728But more importantly this change leads to unpredictable default behavior in applications that use
firebase_admin. Specifically, developers who are on older versions ofgoogle-authwon't get any timeout (timeout=None), while developers on new versions will get a 2 minutes timeout (timeout=120).This PR addresses the above discrepancy by setting a default timeout in our own code. This has the following advantages:
firebase_adminwill see consistent behavior regardless of theirgoogle-authversion.google-auth.Note that
httpTimeoutoption is currently only respected by a subset of our modules. Other modules (e.g. auth), will get their default timeout fromgoogle-authfor now. I'm using the same default value of 120 seconds to mitigate this, but we should properly address this for all modules in a subsequent PR.