MCPcopy Create free account
hub / github.com/tensorflow/tensorboard / retry_handler

Function retry_handler

tensorboard/util/grpc_util.py:162–181  ·  view source on GitHub ↗
(future, num_attempts)

Source from the content-addressed store, hash-verified

160 # * Otherwise, invoke a new async_call with the same
161 # retry_handler.
162 def retry_handler(future, num_attempts):
163 e = future.exception()
164 if e is None:
165 completion_event.set()
166 return
167 else:
168 logger.info("RPC call %s got error %s", api_method, e)
169 # If unable to retry, proceed to completion.
170 if e.code() not in _GRPC_RETRYABLE_STATUS_CODES:
171 completion_event.set()
172 return
173 if num_attempts >= _GRPC_RETRY_MAX_ATTEMPTS:
174 completion_event.set()
175 return
176 # If able to retry, wait then do so.
177 backoff_secs = _compute_backoff_seconds(num_attempts)
178 clock.sleep(backoff_secs)
179 async_call(
180 functools.partial(retry_handler, num_attempts=num_attempts + 1)
181 )
182
183 async_call(functools.partial(retry_handler, num_attempts=1))
184 return async_future

Callers

nothing calls this directly

Calls 4

_compute_backoff_secondsFunction · 0.85
async_callFunction · 0.85
setMethod · 0.80
sleepMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…