Skip to content

Commit

Permalink
Remove tasks dict from Lithops map_unordered as input is now stor…
Browse files Browse the repository at this point in the history
…ed on `RetryingFuture`
  • Loading branch information
tomwhite committed Jul 13, 2023
1 parent 01f8eb9 commit fcf4a69
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions cubed/runtime/executors/lithops.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ def map_unordered(
return_when = ALWAYS if use_backups else ANY_COMPLETED

inputs = list(map_iterdata)
tasks = {}
start_times = {}
end_times = {}
backups: Dict[RetryingFuture, RetryingFuture] = {}
Expand All @@ -85,7 +84,6 @@ def map_unordered(
include_modules=include_modules,
retries=retries,
)
tasks.update({k: v for (k, v) in zip(futures, inputs)})
start_times.update({k: time.monotonic() for k in futures})
pending.extend(futures)

Expand Down Expand Up @@ -127,7 +125,7 @@ def map_unordered(
if future not in backups and should_launch_backup(
future, now, start_times, end_times
):
input = tasks[future]
input = future.input
logger.info("Running backup task for %s", input)
futures = map_with_retries(
lithops_function_executor,
Expand All @@ -137,7 +135,6 @@ def map_unordered(
include_modules=include_modules,
retries=0, # don't retry backup tasks
)
tasks.update({k: v for (k, v) in zip(futures, [input])})
start_times.update({k: time.monotonic() for k in futures})
pending.extend(futures)
backup = futures[0]
Expand Down

0 comments on commit fcf4a69

Please sign in to comment.