-
Notifications
You must be signed in to change notification settings - Fork 214
Closed
Labels
api: pubsubIssues related to the googleapis/python-pubsub API.Issues related to the googleapis/python-pubsub API.type: feature request‘Nice-to-have’ improvement, new feature or different behavior or design.‘Nice-to-have’ improvement, new feature or different behavior or design.
Description
Environment details
- OS type and version: Linux
- Python version:
Python 3.7.7 - pip version:
pip 21.0.1 google-cloud-pubsubversion:
Version: 2.3.0
Summary: Google Cloud Pub/Sub API client library
Home-page: https://github.com/googleapis/python-pubsub
Author: Google LLC
Author-email: googleapis-packages@google.com
License: Apache 2.0
Location: /Users/mike/.pyenv/versions/3.8.6/envs/detection-processor/lib/python3.8/site-packages
Requires: grpc-google-iam-v1, proto-plus, google-api-core, libcst
Required-by:
Steps to reproduce
- Create multiple publish futures with
publisher.publish() - Use
in concurrent.futures.as_completed()as a generator to trigger on completion.
Code example
future_list = []
for msg in messages:
future_list.append(publisher.publish(topic_path, msg))
for _ in concurrent.futures.as_completed(
fs=future_list,
):
# Do something
continueStack trace
'Future' object has no attribute '_condition'
I understand that the publish future is not REALLY a concurrent future object. This attribute error does not happen with all messages, it's a minority of messages. I'm not sure what causes some publish futures to work with as_completed and some do not.
Metadata
Metadata
Assignees
Labels
api: pubsubIssues related to the googleapis/python-pubsub API.Issues related to the googleapis/python-pubsub API.type: feature request‘Nice-to-have’ improvement, new feature or different behavior or design.‘Nice-to-have’ improvement, new feature or different behavior or design.