Skip to content
This repository was archived by the owner on Feb 23, 2026. It is now read-only.

Commit 53bf6ff

Browse files
author
boris
committed
temp
1 parent 322a2d2 commit 53bf6ff

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

google/api_core/retry.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ def check_if_exists():
6161
import logging
6262
import random
6363
import time
64+
import threading
6465

6566
import requests.exceptions
6667

@@ -145,8 +146,7 @@ def exponential_sleep_generator(initial, maximum, multiplier=_DEFAULT_DELAY_MULT
145146
# to average out to the delay time.
146147
res = min(random.uniform(0.0, delay * 2.0), maximum)
147148
_LOGGER.debug(
148-
"exponential_sleep_generator initial: {:.1f}s, maximum: {:.1f}s, multipier: {:1f}s, res:{:1f}s".format(initial, maximum,
149-
multiplier, res)
149+
f"xxxxx: {threading.current_thread().name} exponential_sleep_generator initial: {initial}s, maximum: {maximum}s, multipier: {multiplier}s, res:{res}s"
150150
)
151151
yield res
152152
delay = delay * multiplier
@@ -192,7 +192,10 @@ def retry_target(target, predicate, sleep_generator, deadline, on_error=None):
192192

193193
for sleep in sleep_generator:
194194
try:
195-
return target()
195+
_LOGGER.debug(f"xxxxx: {threading.current_thread().name} before target sleep: {sleep}")
196+
res = target()
197+
_LOGGER.debug(f"xxxxx: {threading.current_thread().name} res: {res}")
198+
return res
196199

197200
# pylint: disable=broad-except
198201
# This function explicitly must deal with broad exceptions.

0 commit comments

Comments
 (0)