frankliee commented on code in PR #701: URL: https://github.com/apache/iceberg-python/pull/701#discussion_r1591970151
########## pyiceberg/catalog/hive.py: ########## @@ -356,6 +378,28 @@ def _create_lock_request(self, database_name: str, table_name: str) -> LockReque return lock_request + def _wait_for_lock(self, database_name: str, table_name: str, lockid: int, open_client: Client) -> LockResponse: + @retry( + retry=retry_if_exception_type(WaitingForLockException), + wait=wait_exponential( + multiplier=self._lock_check_multiplier, min=self._lock_check_min_wait_time, max=self._lock_check_max_wait_time + ), + stop=stop_after_attempt(self._lock_check_retries), + reraise=True, + ) + def _do_wait_for_lock() -> LockResponse: + response: LockResponse = open_client.check_lock(CheckLockRequest(lockid=lockid)) + if response.state == LockState.ACQUIRED: + return response + elif response.state == LockState.WAITING: + msg = f"Wait on lock for {database_name}:{table_name}" Review Comment: updated -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org For additional commands, e-mail: issues-h...@iceberg.apache.org