Skip to content

Commit

Permalink
process: set publisher methods' max retry to 600s (#495)
Browse files Browse the repository at this point in the history
  • Loading branch information
plamut committed Sep 24, 2021
1 parent 76f143c commit 7e623e5
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 9 deletions.
18 changes: 9 additions & 9 deletions google/pubsub_v1/services/publisher/transports/base.py
Expand Up @@ -169,7 +169,7 @@ def _prep_wrapped_messages(self, client_info):
predicate=retries.if_exception_type(
core_exceptions.ServiceUnavailable,
),
deadline=60.0,
deadline=600.0,
),
default_timeout=60.0,
client_info=client_info,
Expand All @@ -183,7 +183,7 @@ def _prep_wrapped_messages(self, client_info):
predicate=retries.if_exception_type(
core_exceptions.ServiceUnavailable,
),
deadline=60.0,
deadline=600.0,
),
default_timeout=60.0,
client_info=client_info,
Expand All @@ -203,7 +203,7 @@ def _prep_wrapped_messages(self, client_info):
core_exceptions.ServiceUnavailable,
core_exceptions.Unknown,
),
deadline=60.0,
deadline=600.0,
),
default_timeout=60.0,
client_info=client_info,
Expand All @@ -219,7 +219,7 @@ def _prep_wrapped_messages(self, client_info):
core_exceptions.ServiceUnavailable,
core_exceptions.Unknown,
),
deadline=60.0,
deadline=600.0,
),
default_timeout=60.0,
client_info=client_info,
Expand All @@ -235,7 +235,7 @@ def _prep_wrapped_messages(self, client_info):
core_exceptions.ServiceUnavailable,
core_exceptions.Unknown,
),
deadline=60.0,
deadline=600.0,
),
default_timeout=60.0,
client_info=client_info,
Expand All @@ -251,7 +251,7 @@ def _prep_wrapped_messages(self, client_info):
core_exceptions.ServiceUnavailable,
core_exceptions.Unknown,
),
deadline=60.0,
deadline=600.0,
),
default_timeout=60.0,
client_info=client_info,
Expand All @@ -267,7 +267,7 @@ def _prep_wrapped_messages(self, client_info):
core_exceptions.ServiceUnavailable,
core_exceptions.Unknown,
),
deadline=60.0,
deadline=600.0,
),
default_timeout=60.0,
client_info=client_info,
Expand All @@ -281,7 +281,7 @@ def _prep_wrapped_messages(self, client_info):
predicate=retries.if_exception_type(
core_exceptions.ServiceUnavailable,
),
deadline=60.0,
deadline=600.0,
),
default_timeout=60.0,
client_info=client_info,
Expand All @@ -295,7 +295,7 @@ def _prep_wrapped_messages(self, client_info):
predicate=retries.if_exception_type(
core_exceptions.ServiceUnavailable,
),
deadline=60.0,
deadline=600.0,
),
default_timeout=60.0,
client_info=client_info,
Expand Down
11 changes: 11 additions & 0 deletions owlbot.py
Expand Up @@ -309,6 +309,17 @@
("\g<1>timeout (TimeoutType):\n" "\g<1> \g<2>\n"),
)

# Override the default max retry deadline for publisher methods.
count = s.replace(
library / f"google/pubsub_{library.name}/services/publisher/transports/base.py",
r"deadline=60\.0",
"deadline=600.0",
)
if count < 9:
raise Exception(
"Default retry deadline not overriden for all publisher methods."
)

# The namespace package declaration in google/cloud/__init__.py should be excluded
# from coverage.
count = s.replace(
Expand Down

0 comments on commit 7e623e5

Please sign in to comment.