Idempotent task execution in on-demand network code execution systems
First Claim
1. A system to handle requests to execute tasks on an on-demand code execution system, the system comprising:
- a non-transitory data store configured to store an execution record of a task, wherein the task is associated with code executable to implement functionality corresponding to the task on the on-demand code execution system, wherein execution of the task is dependent on a data resource external to the on-demand code execution system and on the code associated with the task, and wherein the execution record indicates, for a prior execution of the task, a state of the external data resource during the prior execution and a state of the code during the prior execution; and
one or more processors configured with computer-executable instructions to;
obtain a request to execute the task;
transmit a request to an auxiliary service to obtain a current state of the data resource external to the on-demand code execution system;
conduct a comparison of the current state of the data resource and the state of the external data resource during the prior execution;
obtain a current state of the code associated with the task;
conduct a comparison the current state of the code and the state of the code during the prior execution;
determine, as a result of the comparisons, that a state of at least one of the data resource or the code has changed since the prior execution; and
in response to determining that the state of at least one of the data resource or the code has changed since the prior execution;
generate an execution environment for the task on the on-demand code execution system;
provision the execution environment with the code; and
execute the code within the execution environment.
1 Assignment
0 Petitions
Accused Products
Abstract
Systems and methods are described for handling requests to execute idempotent code in an on-demand code execution system or other distributed code execution environment. Idempotent code can generally include code that produces the same outcome even when executed multiple times, so long as dependencies for the code are in the same state as during a prior execution. Due to this feature, multiple executions of idempotent code may inefficiently use computing resources, particularly in on-demand code execution system (which may require, for example, generation and provisioning of an appropriate execution environment for the code). Aspects of the present disclosure enable the on-demand code execution system to process requests to execute code by verifying whether dependency states associated with the code have changed since a prior execution. If dependency states have not changed, no execution need occur, and the overall computing resource us of the on-demand code execution system is decreased.
-
Citations
20 Claims
-
1. A system to handle requests to execute tasks on an on-demand code execution system, the system comprising:
-
a non-transitory data store configured to store an execution record of a task, wherein the task is associated with code executable to implement functionality corresponding to the task on the on-demand code execution system, wherein execution of the task is dependent on a data resource external to the on-demand code execution system and on the code associated with the task, and wherein the execution record indicates, for a prior execution of the task, a state of the external data resource during the prior execution and a state of the code during the prior execution; and one or more processors configured with computer-executable instructions to; obtain a request to execute the task; transmit a request to an auxiliary service to obtain a current state of the data resource external to the on-demand code execution system; conduct a comparison of the current state of the data resource and the state of the external data resource during the prior execution; obtain a current state of the code associated with the task; conduct a comparison the current state of the code and the state of the code during the prior execution; determine, as a result of the comparisons, that a state of at least one of the data resource or the code has changed since the prior execution; and in response to determining that the state of at least one of the data resource or the code has changed since the prior execution; generate an execution environment for the task on the on-demand code execution system; provision the execution environment with the code; and execute the code within the execution environment. - View Dependent Claims (2, 3, 4, 5)
-
-
6. A computer-implemented method to handle requests to execute tasks an on-demand code execution system, the computer-implemented method comprising:
-
obtaining a request to execute a task, wherein the task is associated with code executable by the on-demand code execution system to implement functionality corresponding to the task, and wherein execution of the task is dependent on a set of resources; obtaining an execution record for the task, wherein the execution record indicates states of respective resources, within the set of resources, associated with a prior execution of the task; for individual resources of the set of resources on which execution of the task is dependent; obtaining current states of the individual resources; and comparing current states of the individual resources and the states in the execution record; determining that the current state of at least one resource, from the set of resources, does not match the state of the at least one resource recorded in the execution record; and in response to determining that the current state of the at least one resource does not match the state of the at least one resource recorded in the execution record; generating an execution environment for the task on the on-demand code execution system, wherein generating the execution environment comprises provisioning the execution environment with the code; and executing the code within the execution environment to implement functionality corresponding to the task. - View Dependent Claims (7, 8, 9, 10, 11, 12, 13, 14)
-
-
15. Non-transitory computer-readable storage media including computer-executable instructions that, when executed by a computing system, cause the computing system to:
-
obtain a request to execute a task, wherein the task is associated with code executable by the on-demand code execution system to implement functionality corresponding to the task, and wherein execution of the task is dependent on a set of resources; obtain an execution record for a task, wherein the execution record indicates states of respective resources, within the set of resources, associated with a prior execution of the task; for individual resources of the set of resources on which execution of the task is dependent, compare current states of the individual resources and the corresponding states in the execution record; determine that the current state of at least one resource, from the set of resources, does not match the state of the at least one resource in the execution record; and in response to a determination that the current state of the at least one resource does not match the state of the at least one resource recorded in the execution record; generate an execution environment for the task on the on-demand code execution system at least partly by provisioning the execution environment with the code; and execute the code within the execution environment on-demand code execution system to implement functionality corresponding to the task. - View Dependent Claims (16, 17, 18, 19, 20)
-
Specification