Skip to content

Avoid race condition in maintain_leases by copying leased_messages#5035

Merged
theacodes merged 1 commit into
googleapis:masterfrom
theacodes:fix-pubsub-race-condition
Mar 14, 2018
Merged

Avoid race condition in maintain_leases by copying leased_messages#5035
theacodes merged 1 commit into
googleapis:masterfrom
theacodes:fix-pubsub-race-condition

Conversation

@theacodes
Copy link
Copy Markdown
Contributor

No description provided.

@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Mar 14, 2018
@theacodes theacodes merged commit 5d3c566 into googleapis:master Mar 14, 2018
@theacodes theacodes deleted the fix-pubsub-race-condition branch March 14, 2018 18:08
@tseaver
Copy link
Copy Markdown
Contributor

tseaver commented Mar 14, 2018

@jonparrott This change is causing unit test failures for me:

_____________________ test_maintain_leases_outdated_items ______________________
Traceback (most recent call last):
  File "/home/tseaver/projects/agendaless/Google/src/google-cloud-python/pubsub/tests/unit/pubsub_v1/subscriber/test_policy_base.py", line 327, in test_maintain_leases_outdated_items
    modify_deadline_seconds=[10],
  File "/home/tseaver/projects/agendaless/Google/src/google-cloud-python/pubsub/.nox/unit-3-6/lib/python3.6/site-packages/mock/mock.py", line 948, in assert_called_once_with
    return self.assert_called_with(*args, **kwargs)
  File "/home/tseaver/projects/agendaless/Google/src/google-cloud-python/pubsub/.nox/unit-3-6/lib/python3.6/site-packages/mock/mock.py", line 937, in assert_called_with
    six.raise_from(AssertionError(_error_message(cause)), cause)
  File "<string>", line 3, in raise_from
AssertionError: Expected call: send_request(modify_deadline_seconds: 10
modify_deadline_ack_ids: "ack2"
)
Actual call: send_request(modify_deadline_seconds: 10
modify_deadline_seconds: 10
modify_deadline_ack_ids: "ack1"
modify_deadline_ack_ids: "ack2"
)
------------------------------ Captured log call -------------------------------
base.py                    382 WARNING  Dropping 1 items because they were leased too long.

@theacodes
Copy link
Copy Markdown
Contributor Author

@tseaver if it's blocking you feel free to roll it back until I can take a closer look.,

@tseaver
Copy link
Copy Markdown
Contributor

tseaver commented Mar 15, 2018

I'm not blocked except from helping on pubsub issues.

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.

4 participants