Skip to content

Commit

Permalink
fix: Stop using api_core default timeouts in publish since they are
Browse files Browse the repository at this point in the history
broken
  • Loading branch information
mukund-ananthu committed Jan 11, 2025
1 parent f648f65 commit 3125634
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion google/cloud/pubsub_v1/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
from google.protobuf import timestamp_pb2

from google.api_core.protobuf_helpers import get_messages
from google.api_core.timeout import ExponentialTimeout

from google.pubsub_v1.types import pubsub as pubsub_gapic_types

Expand Down Expand Up @@ -191,7 +192,12 @@ class PublisherOptions(NamedTuple):
"an instance of :class:`google.api_core.retry.Retry`."
)

timeout: "OptionalTimeout" = gapic_v1.method.DEFAULT # use api_core default
# Use ExponentialTimeout instead of api_core default because the default
# value results in retries with zero deadline.
# Refer https://github.com/googleapis/python-api-core/issues/654
timeout: "OptionalTimeout" = ExponentialTimeout(
initial=5, maximum=60, multiplier=1.3, deadline=600
)
(
"Timeout settings for message publishing by the client. It should be "
"compatible with :class:`~.pubsub_v1.types.TimeoutType`."
Expand Down

0 comments on commit 3125634

Please sign in to comment.