Skip to content

Removing usage of the gRPC beta subpackage. - #2149

Merged
dhermes merged 3 commits into
googleapis:masterfrom
dhermes:remove-beta-grpc
Aug 22, 2016
Merged

Removing usage of the gRPC beta subpackage.#2149
dhermes merged 3 commits into
googleapis:masterfrom
dhermes:remove-beta-grpc

Conversation

@dhermes

@dhermesdhermes commented Aug 19, 2016

Copy link
Copy Markdown
Contributor

Fixes#2130.

Most noteworthy is that the "stable" gRPC doesn't have __exit__ and __enter__ and that the stubs are actual classes (instead of some instance of a private and esoteric class).

When scanning for the case-insenstive string grpc I also found some things to change in other parts of the codebase I came across (e.g. a virtualenv root path falling back to protoc)


@nathanielmanistaatgoogle PTAL

In particular we went from the public exception type grpc.framework.interfaces.face.face.AbortionError to the private grpc._channel._Rendezvous.

How are we or users supposed to build in error handling? Should we catch grpc.Error (which _Rendezvous inherits from)?

BIG WORRY: Every system tests finishes with

E0819 12:40:27.346506119 22315 network_status_tracker.c:48] Memory leaked as all network endpoints were not shut down

@dhermesdhermes added api: datastore Issues related to the Datastore API. api: pubsub Issues related to the Pub/Sub API. api: bigtable Issues related to the Bigtable API. api: logging Issues related to the Cloud Logging API. grpc labels Aug 19, 2016
@googlebotgooglebot added the cla: yes This human has signed the Contributor License Agreement. label Aug 19, 2016
@dhermes

Copy link
Copy Markdown
ContributorAuthor

@dhermes

Copy link
Copy Markdown
ContributorAuthor

@nathanielmanistaatgoogle It's also worth noting that GAX is still using the beta API /cc @bjwatson

I realized that and had to modify google.gax.grpc.exc_to_code to allow for _Rendezvous exceptions

@bjwatson

Copy link
Copy Markdown

I created googleapis/gax-python#126 to track this.

Comment threadgcloud/_helpers.py
from grpc.beta import implementations
from google.gax.grpc import exc_to_code as beta_exc_to_code
import grpc
from grpc._channel import _Rendezvous

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.


def __exit__(self, exc_type, exc_val, exc_t):
"""Stops the client as a context manager."""
self.stop()

This comment was marked as spam.

@tseaver

Copy link
Copy Markdown
Contributor

Did we ditch the timeouts because the GA API no longer supports them? I like the simplicity on our side, but worry that users might still need them.

@tseaver

Copy link
Copy Markdown
Contributor

LGTM

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api: bigtableIssues related to the Bigtable API.api: datastoreIssues related to the Datastore API.api: loggingIssues related to the Cloud Logging API.api: pubsubIssues related to the Pub/Sub API.cla: yesThis human has signed the Contributor License Agreement.grpc

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants

@dhermes@bjwatson@tseaver@nathanielmanistaatgoogle@googlebot