Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make delay between call status check configurable #1292

Closed
tomwhite opened this issue Mar 28, 2024 · 2 comments
Closed

Make delay between call status check configurable #1292

tomwhite opened this issue Mar 28, 2024 · 2 comments

Comments

@tomwhite
Copy link
Contributor

tomwhite commented Mar 28, 2024

The time between calls to internal_storage.get_call_status is hardcoded to 1 second (GET_RESULT_SLEEP_SECS):

lithops/lithops/future.py

Lines 201 to 203 in b199505

while self._call_status is None:
time.sleep(self.GET_RESULT_SLEEP_SECS)
self._call_status = internal_storage.get_call_status(self.executor_id, self.job_id, self.call_id)

It would be useful to be able to control this so that it is the same as either

The use case is running tests with local storage where it would be good to set it to a small value such as 0.1s so the tests run faster.

@JosepSampe
Copy link
Member

In #1338 I exposed wait_dur_sec and retries of the future methods, this can be useful in the case you manually call future.wait() or future.get_result().

However, note that in a normal lithops execution where you use the fexec.wait() method, the while loop you pointed out is never reached, since the internal monitoring system is responsible to track the available files, and only calls future.status() or future.get_result() when the status/result file is already in the storage backend.

I see that you've already discovered this in your project, but for the record in this issue: to reduce the time between checks, utilize the monitoring_interval configuration parameter, and adjust the wait_dur_sec in the fexec.wait() method.

We can discuss whether it's appropriate to automatically set the wait_dur_sec of the fexec.wait() to match or closely resemble the monitoring_interval config parameter. This way, users wouldn't need to set two different parameters for the same purpose.

We can also discuss if it s appropriate to default the monitoring_interval config parameter to 0.1 (or similar) in case of the localhost storage backend (only if it is not set by the user in the config)

@JosepSampe
Copy link
Member

Closing as the root issue is addressed by multiple PRs. WE can open a separate PR if there is a new issue or alternative requirement

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants