flower icon indicating copy to clipboard operation
flower copied to clipboard

Augment `Driver` class with error handling via `RetryInvoker`

Open panh99 opened this issue 2 years ago • 0 comments

  • Added a sync lock for Driver API calls in the Driver class to prevent potential thread conflicts
  • Wrapped all Driver API calls within RetryInvoker.
  • Added new unit tests in driver/driver_test.py

The default RetryInvoker for the Driver class is configured as follows.

err_codes = (StatusCode.UNAVAILABLE,)
RetryInvoker(
    exponential,
    RpcError,
    max_tries=10,
    max_time=300,
    should_giveup=lambda e: e.code() not in err_codes,
)

panh99 avatar Oct 31 '23 20:10 panh99