Skip to content
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

fix: Update pubsub_context to correctly modify proto map fields. #38

Merged
merged 1 commit into from Oct 7, 2020

Conversation

dpcollins-google
Copy link
Collaborator

fix: Update pubsub_context to correctly modify proto map fields.

@dpcollins-google dpcollins-google requested a review from a team as a code owner October 6, 2020 23:58
@google-cla google-cla bot added the cla: yes This human has signed the Contributor License Agreement. label Oct 6, 2020
@anguillanneuf
Copy link
Collaborator

anguillanneuf commented Oct 7, 2020

This still has some issues for publisher_client = make_publisher(topic_path):

Traceback (most recent call last):
  File "publisher_example.py", line 66, in <module>
    publish(
  File "publisher_example.py", line 41, in publish
    publisher_client = make_publisher(topic_path_object)
  File "/Users/tianzi/Projects/python-pubsublite/google/cloud/pubsublite/cloudpubsub/make_publisher.py", line 73, in make_publisher
    make_async_publisher(
  File "/Users/tianzi/Projects/python-pubsublite/google/cloud/pubsublite/cloudpubsub/make_publisher.py", line 43, in make_async_publisher
    underlying = make_wire_publisher(
  File "/Users/tianzi/Projects/python-pubsublite/google/cloud/pubsublite/internal/wire/make_publisher.py", line 53, in make_publisher
    region=topic.location.region,
AttributeError: 'str' object has no attribute 'location'

@dpcollins-google
Copy link
Collaborator Author

dpcollins-google commented Oct 7, 2020

This still has some issues for publisher_client = make_publisher(topic_path_object)

This is a separate issue, I'll fix it in a separate PR.

@anguillanneuf
Copy link
Collaborator

Sg. The above error was caused by a TopicPath str, when a TopicPath object is used, this is the error:

Traceback (most recent call last):
  File "/Users/tianzi/.virtualenvs/py38/lib/python3.8/site-packages/google/api_core/grpc_helpers.py", line 57, in error_remapped_callable
    return callable_(*args, **kwargs)
  File "/Users/tianzi/.virtualenvs/py38/lib/python3.8/site-packages/grpc/_channel.py", line 826, in __call__
    return _end_unary_response_blocking(state, call, False, None)
  File "/Users/tianzi/.virtualenvs/py38/lib/python3.8/site-packages/grpc/_channel.py", line 729, in _end_unary_response_blocking
    raise _InactiveRpcError(state)
grpc._channel._InactiveRpcError: <_InactiveRpcError of RPC that terminated with:
        status = StatusCode.INTERNAL
        details = "Received http2 header with status: 400"
        debug_error_string = "{"created":"@1602091143.963493000","description":"Received http2 :status header with non-200 OK status","file":"src/core/ext/filters/http/client/http_client_filter.cc","file_line":130,"grpc_message":"Received http2 header with status: 400","grpc_status":13,"value":"400"}"
>

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "publisher_example.py", line 66, in <module>
    publish(
  File "publisher_example.py", line 41, in publish
    publisher_client = make_publisher(topic_path_object)
  File "/Users/tianzi/Projects/python-pubsublite/google/cloud/pubsublite/cloudpubsub/make_publisher.py", line 73, in make_publisher
    make_async_publisher(
  File "/Users/tianzi/Projects/python-pubsublite/google/cloud/pubsublite/cloudpubsub/make_publisher.py", line 43, in make_async_publisher
    underlying = make_wire_publisher(
  File "/Users/tianzi/Projects/python-pubsublite/google/cloud/pubsublite/internal/wire/make_publisher.py", line 67, in make_publisher
    partition_count = admin_client.get_topic_partition_count(topic)
  File "/Users/tianzi/Projects/python-pubsublite/google/cloud/pubsublite/internal/wire/admin_client_impl.py", line 37, in get_topic_partition_count
    partitions: TopicPartitions = self._underlying.get_topic_partitions(
  File "/Users/tianzi/Projects/python-pubsublite/google/cloud/pubsublite_v1/services/admin_service/client.py", line 475, in get_topic_partitions
    response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,)
  File "/Users/tianzi/.virtualenvs/py38/lib/python3.8/site-packages/google/api_core/gapic_v1/method.py", line 145, in __call__
    return wrapped_func(*args, **kwargs)
  File "/Users/tianzi/.virtualenvs/py38/lib/python3.8/site-packages/google/api_core/grpc_helpers.py", line 59, in error_remapped_callable
    six.raise_from(exceptions.from_grpc_error(exc), exc)
  File "<string>", line 3, in raise_from
google.api_core.exceptions.InternalServerError: 500 Received http2 header with status: 400

Copy link
Collaborator

@anguillanneuf anguillanneuf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR doesn't fix make_publisher(), but approving in preparation for more fixes coming soon.

@anguillanneuf anguillanneuf merged commit 860c443 into master Oct 7, 2020
@anguillanneuf anguillanneuf deleted the dpcollins-google-patch-2 branch October 7, 2020 17:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes This human has signed the Contributor License Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants