-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Remove deepcopy of client._http #3954
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
Conversation
http = copy.deepcopy(client._http) | ||
self.client = client.__class__( | ||
client.project, client._credentials, http) | ||
self.client = client |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Side note: CODEOWNERS does not seem to work quite right. :-( |
On the merits of this actual PR -- this does look sane to me, but hoping @tseaver or @jonparrott will make sure I am not missing something obvious. |
The original deepcopy was a race condition for the async long handler, but it's covered in the system test, being a race condition it didn't always appear but it did frequently enough that if there's any problem with the PR you'd probably know soon. LGTM if jon think it look right. |
Thanks @waprin! I have run the system tests for several times locally and it works fine. Though the race condition does not always appear as Bill said. If thread-safety is the only reason for deepcopy, sounds like we can safely remove it. Can we go ahead and merge this? |
The system test |
@liyanhui1228 Go ahead and fix that here. Happy to merge once tests pass. |
Ready for merging, system tests passed locally.
|
Fixes #3931.
When GOOGLE_CLOUD_DISABLE_GRPC=true, the logging will have
'AuthorizedSession' object has no attribute 'credentials'
exception.The line
http = copy.deepcopy(client._http)
is a relic when httplib2 was used. Removing it and directly use theclient
passed in instead of re-initialize with the deepcopied http object solved the problem.