GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GAX API hangs during (second) 'publish' · Issue #1869 · googleapis/google-cloud-python

GAX API hangs during (second) 'publish' #1869

New issue
Copy link
New issue
Copy link
Closed
Closed
GAX API hangs during (second) 'publish'#1869
Copy link
Assignees
yoshi-automation
Labels
api: pubsubIssues related to the Pub/Sub API.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.

Description

@tseaver
tseaver
opened on Jun 20, 2016
Issue body actions

/cc @bjwatson

======================================================================
ERROR: test_message_pull_mode_e2e (pubsub.TestPubsub)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/tseaver/projects/agendaless/Google/src/gcloud-python/system_tests/pubsub.py", line 157, in test_message_pull_mode_e2e
    topic.publish(MESSAGE_1, extra=EXTRA_1)
  File "/home/tseaver/projects/agendaless/Google/src/gcloud-python/gcloud/pubsub/topic.py", line 246, in publish
    message_ids = api.topic_publish(self.full_name, [message_data])
  File "/home/tseaver/projects/agendaless/Google/src/gcloud-python/gcloud/pubsub/_gax.py", line 171, in topic_publish
    event.wait()
AttributeError: 'exceptions.AttributeError' object has no attribute 'message_ids'

Activity

  1. tseaver
    added
    type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.
    api: pubsubIssues related to the Pub/Sub API.
    on Jun 20, 2016
  2. tseaver commented on Jun 20, 2016

    @tseaver
    tseaver
    on Jun 20, 2016
    ContributorAuthor
    More actions

    To reproduce:

    $ git clone [email protected]:tseaver/gcloud
    $ cd gcloud
    $ git checkout 1855-moar_gax_paging_fixes
    $ tox -e system-tests --notest
    $ PYTHONPATH= .tox/system-tests/bin/python system_tests/run_system_test.py --package=pubsub
  3. bjwatson commented on Jun 20, 2016

    @bjwatson
    bjwatson
    on Jun 20, 2016
    More actions

    Seems like the PublishResponse object is being returned without message_ids nor an exception.

    Have you gotten the API publish(...) call working in any context? IOW, is this a problem is general, or a problem in this specific context?

  4. tseaver commented on Jun 20, 2016

    @tseaver
    tseaver
    on Jun 20, 2016
    ContributorAuthor
    More actions

    @bjwatson I had an earlier error in my system test masking this problem, so I have never actually seen publish() succeed with GAX.

  5. tseaver commented on Jun 20, 2016

    @tseaver
    tseaver
    on Jun 20, 2016
    ContributorAuthor
    More actions

    @bjwatson One thing different from the other Pubsub APIs (which are working AFAICS, except pull() which is masked by this one) is that push() gets bundled: the AttributeError gets set by the code which unpacks the response during event.wait().

  6. tseaver commented on Jun 20, 2016

    @tseaver
    tseaver
    on Jun 20, 2016
    ContributorAuthor
    More actions

    @bjwatson could it be an issue that the event unpacking code isn't handling repeated elements (e.g., PublishResponse.message_ids) properly?

  7. daspecster
    closed this as completedin #1854on Jun 20, 2016
  8. tseaver
    reopened this on Jun 20, 2016
  9. tseaver commented on Jun 20, 2016

    @tseaver
    tseaver
    on Jun 20, 2016
    ContributorAuthor
    More actions

    @bjwatson To reproduce (updated):

    $ git clone [email protected]:GoogleCloudPlatform/gcloud
    $ cd gcloud
    $ tox -e system-tests --notest
    $ GCLOUD_ENABLE_GAX=1 PYTHONPATH= .tox/system-tests/bin/python system_tests/run_system_test.py --package=pubsub
  10. tseaver commented on Jun 20, 2016

    @tseaver
    tseaver
    on Jun 20, 2016
    ContributorAuthor
    More actions

    cc @tbetbetbe

  11. bjwatson commented on Jun 20, 2016

    @bjwatson
    bjwatson
    on Jun 20, 2016
    More actions

    Hi @tseaver. Sorry for the delay; I was looking into a few other things. I'll try what you suggested and let you know what I find.

  12. bjwatson commented on Jun 20, 2016

    @bjwatson
    bjwatson
    on Jun 20, 2016
    More actions

    I have successfully reproduced this issue on my workstation and am looking into it.

  13. bjwatson commented on Jun 21, 2016

    @bjwatson
    bjwatson
    on Jun 21, 2016
    More actions

    So what I've discovered so far is that event.result is assigned to AttributeError: Assignment not allowed to repeated field "message_ids" in protocol message object.

    Based on code analysis, I believe this is being thrown by https://github.com/googleapis/gax-python/blob/master/google/gax/bundling.py#L193. I'm not sure why we haven't discovered this before. Is this the first time the bundle_descriptor.subresponse_field is a repeated field, or should that always be the case? (I don't understand bundling that well, yet)

    The bundling configuration for the publish(...) call is:

        bundling:
          thresholds:
            element_count_threshold: 10
            element_count_limit: 1000 # TO BE REMOVED LATER
            request_byte_threshold: 1024 # 1 Kb
            request_byte_limit: 10485760 # TO BE REMOVED LATER
            delay_threshold_millis: 10
          bundle_descriptor:
            bundled_field: messages
            discriminator_fields:
            - topic
            subresponse_field: message_ids
    

    I'm about to sign off for the night. @tbetbetbe Do you have some time to look into this during your morning shift?

  14. bjwatson commented on Jun 21, 2016

    @bjwatson
    bjwatson
    on Jun 21, 2016
    More actions

    @tseaver This is a bug in gax-python. I created issue googleapis/gax-python#110 to track it, and plan to fix it today.

  15. tseaver commented on Jun 21, 2016

    @tseaver
    tseaver
    on Jun 21, 2016
    ContributorAuthor
    More actions

    @bjwatson Thanks very much!

  16. bjwatson commented on Jun 22, 2016

    @bjwatson
    bjwatson
    on Jun 22, 2016
    More actions

    @tseaver No problem. I have a fix in code review now: googleapis/gax-python#111

    Once this is merged, I will publish new versions of gax-python, pubsub, and logging. And then I will verify that this issue is closed. This should be finished tomorrow.

    Reacted by Thomas Schultz
  17. bjwatson commented on Jun 23, 2016

    @bjwatson
    bjwatson
    on Jun 23, 2016
    More actions

    @tseaver I have fixed this issue with https://pypi.python.org/pypi/google-gax/0.12.1 and https://pypi.python.org/pypi/gax-google-pubsub-v1/0.7.10.

    Now the behavior I'm seeing is that the test_message_pull_mode_e2e test hangs indefinitely on the second call to publish(...). I'm not sure where in the stack the problem is occurring.

    I'm about to wrap up for the day. Can you take a look and see what you think?

  18. bjwatson commented on Jun 23, 2016

    @bjwatson
    bjwatson
    on Jun 23, 2016
    More actions

    I also updated logging, although I have not yet looked into #1889

  19. bjwatson commented on Jun 23, 2016

    @bjwatson
    bjwatson
    on Jun 23, 2016
    More actions

    @tseaver I got caught up in some other things today. Can you or @daspecster look into the indefinite hang on the second call to publish(...), and let me know whether you think it's at the gcloud, gapic, or service layer?

  20. bjwatson commented on Jun 25, 2016

    @bjwatson
    bjwatson
    on Jun 25, 2016
    More actions

    This seems to be a [gax-python](https://github.com/googleapis/gax-python issue). The hang is happening at https://github.com/GoogleCloudPlatform/gcloud-python/blob/master/gcloud/pubsub/_gax.py#L170, but only happens for the second call.

    I'll look at it some more on Monday, unless @tbetbetbe or @geigerj get to it first.

  21. geigerj commented on Jun 25, 2016

    @geigerj
    geigerj
    on Jun 25, 2016
    Contributor
    More actions
    • This is indeed a gax-python issue. The problem is that the delay threshold for bundling is handled using a timer object, but we forget to reset the timer object after it fires the first time... Therefore, this condition will only ever succeed once. I've filed Bundling: timer doesn't reset gax-python#113 for this.
    • https://github.com/GoogleCloudPlatform/gcloud-python/blob/master/gcloud/pubsub/_gax.py#L170 is somewhat roundabout... The intended way of achieving the same effect in GAX is just
    try:
      result = self._gax_api.publish(topic_path, message_pbs,
          options=CallOptions(is_bundling=False))
      return result.message_ids
    except:
      ...
    
  22. tseaver
    changed the title [-]GAX API raises AttributeError during 'publish'[/-] [+]GAX API hangs during (second) 'publish'[/+] on Jun 26, 2016
  23. tseaver commented on Jun 26, 2016

    @tseaver
    tseaver
    on Jun 26, 2016
    ContributorAuthor
    More actions

    @geigerj Thanks for the pointer! #1910 disables bundling as you suggest. We can think about re-enabling it after a fix for googleapis/gax-python#113 is released.

  24. tseaver
    closed this as completedin #1910on Jun 27, 2016
  25. JustinBeckwith
    assigned
    yoshi-automation
    on Feb 1, 2021
  26. parthea
    added a commit that references this issue on Nov 26, 2025

    test: create and delete temp folder in scripts (#1869)

    55e599d
  27. parthea
    added a commit that references this issue on Mar 6, 2026

    fix: use an allowlist instead of denylist to determine when `query_an…

    0dc8f8b
  28. parthea
    added a commit that references this issue on Apr 1, 2026

    upload logo to repo (#1869)

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

Metadata

Metadata

Assignees

  • @yoshi-automation
    yoshi-automation

Labels

api: pubsubIssues related to the Pub/Sub API.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402775 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.