Skip to content

Commit dafc7dd

Browse files
committed
DAT-4673: update default hive commit configuration
1 parent d86b9a0 commit dafc7dd

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

pyiceberg/catalog/hive.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252
)
5353
from hive_metastore.ttypes import Database as HiveDatabase
5454
from hive_metastore.ttypes import Table as HiveTable
55-
from tenacity import RetryCallState, retry, retry_if_exception_type, stop_after_attempt, wait_exponential
55+
from tenacity import RetryCallState, retry, retry_if_exception_type, stop_after_attempt, wait_random_exponential
5656
from thrift.protocol import TBinaryProtocol
5757
from thrift.transport import TSocket, TTransport
5858

@@ -132,9 +132,9 @@
132132
LOCK_CHECK_MIN_WAIT_TIME = "lock-check-min-wait-time"
133133
LOCK_CHECK_MAX_WAIT_TIME = "lock-check-max-wait-time"
134134
LOCK_CHECK_RETRIES = "lock-check-retries"
135-
DEFAULT_LOCK_CHECK_MIN_WAIT_TIME = 0.1 # 100 milliseconds
136-
DEFAULT_LOCK_CHECK_MAX_WAIT_TIME = 60 # 1 min
137-
DEFAULT_LOCK_CHECK_RETRIES = 4
135+
DEFAULT_LOCK_CHECK_MIN_WAIT_TIME = 1 # 1 second
136+
DEFAULT_LOCK_CHECK_MAX_WAIT_TIME = 5 # 5 seconds
137+
DEFAULT_LOCK_CHECK_RETRIES = 32
138138

139139

140140
logger = get_logger(__name__)
@@ -471,7 +471,7 @@ def _on_wait_for_lock_fail(state: RetryCallState) -> None:
471471

472472
@retry(
473473
retry=retry_if_exception_type(WaitingForLockException),
474-
wait=wait_exponential(multiplier=2, min=self._lock_check_min_wait_time, max=self._lock_check_max_wait_time),
474+
wait=wait_random_exponential(multiplier=2, min=self._lock_check_min_wait_time, max=self._lock_check_max_wait_time),
475475
stop=stop_after_attempt(self._lock_check_retries),
476476
before=lambda state: logger.debug(f"({state.attempt_number}) Waiting on lock for `{database_name}.{table_name}`..."),
477477
retry_error_callback=_on_wait_for_lock_fail,

0 commit comments

Comments
 (0)