Florentino Sainz
02/20/2024, 10:49 AMIdan Novogroder
02/20/2024, 11:05 AMimport_status
of an import ID depends on several factors, including the size of the import, system load, and the specifics of the lakeFS setup.
There isn't a one-size-fits-all answer, as it can vary widely. However, import operations are typically logged and tracked within the system for an extended period, so you should be able to query the status for as long as the import task remains in the system's active or recent history.
Instead of using a fixed sleep interval or a very short sleep duration like sleep(0.1)
, consider implementing an exponential backoff strategy.
Start with a longer sleep interval (e.g., 0.5 seconds) and double the interval with each retry to a certain maximum.
This approach helps to balance the load on the system and increases the likelihood of a successful status query as the operation progresses.
For example:
• Initial sleep: 0.5 seconds
• If "not found" or other retryable error occurs, double the sleep interval: 1 second, 2 seconds, up to a maximum (e.g., 4 seconds)
I would also define a maximum number of retries to avoid endless loops.Florentino Sainz
02/20/2024, 11:09 AMIdan Novogroder
02/20/2024, 11:18 AMNiro
02/20/2024, 12:37 PMFlorentino Sainz
02/20/2024, 12:46 PM