TennyZhuang opened a new issue, #587:
URL: https://github.com/apache/iceberg-python/issues/587

   ### Feature Request / Improvement
   
   In the rest catalog client, we implemented the OAuth token refresh based on 
retry mechanism.
   
   
https://github.com/apache/iceberg-python/blob/4148edb5e28ae88024a55e0b112238e65b873957/pyiceberg/catalog/rest.py#L126-L128
   
   If there are concurrent calls to the rest client API, they may failed at the 
same time, then thousands of `_refresh_token` may be called. The behavior is 
likely acceptable with no exceptions, but it appears wasteful and not as 
expected.
   
   A potential solution is introducing a `threading.Lock` to protect the 
fetching process. Every call to `_refresh_token` should acquire the `Lock` 
first, and check whether the token is same as the expired token.


-- 
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.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

Reply via email to