You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Traceback (most recent call last):
File "pubsub_error.py", line 21, in <module>
main()
File "pubsub_error.py", line 16, in main
publisher.publish(topic_path, data=b'valid')
File "/Users/camerondavison/Library/Python/3.7/lib/python/site-packages/google/cloud/pubsub_v1/publisher/client.py", line 364, in publish
future = sequencer.publish(message)
File "/Users/camerondavison/Library/Python/3.7/lib/python/site-packages/google/cloud/pubsub_v1/publisher/_sequencer/unordered_sequencer.py", line 113, in publish
future = batch.publish(message)
File "/Users/camerondavison/Library/Python/3.7/lib/python/site-packages/google/cloud/pubsub_v1/publisher/_batch/thread.py", line 334, in publish
), "Publish after stop() or publish error."
AssertionError: Publish after stop() or publish error.
As I mentioned just now in #26 (comment) it looks like there is an assert that was added that can now trigger for an errored out batch.
batch errors could happen any time so it seems like it would be better to move the assert below the check to see if the batch is still accepting new messages so that a new batch can be created if it errored out.
I validated the same code does not throw an exception on publish in 1.2.0
Environment details
python --version: Python 3.7.6pip --version: pip 19.3.1google-cloud-pubsubversion:pip show google-cloud-pubsub1.3.1Code example
Stack trace
As I mentioned just now in #26 (comment) it looks like there is an assert that was added that can now trigger for an errored out batch.
batch errors could happen any time so it seems like it would be better to move the assert below the check to see if the batch is still accepting new messages so that a new batch can be created if it errored out.
I validated the same code does not throw an exception on publish in
1.2.0