Asynchronous task management in an on-demand network code execution environment
First Claim
1. A system to manage blocking of code executions in an on-demand code execution system due to asynchronous operations, wherein the on-demand code execution system comprises a plurality of execution environments on which user-submitted code may execute, the system comprising:
- a non-transitory data store configured to store state information regarding suspended executions of tasks on the on-demand code execution system, wherein individual tasks are associated with code executable to implement functionality corresponding to the individual tasks; and
one or more processors configured with computer-executable instructions to;
obtain instructions to execute a first task associated with first executable code;
begin execution of the first executable code within a first execution environment, wherein execution of the first executable code calls for execution of a first dependency operation;
after detecting that execution of the first executable code has become blocked awaiting completion of the first dependency operation;
determine that a predicted duration of blocking for the execution of the first executable code satisfied a threshold value;
generate state information for the execution of the first executable code;
store the generated state information in the non-transitory data store; and
remove the execution of the first executable code from the first execution environment; and
after detecting that the first dependency operation has completed;
select a second execution environment in which to resume execution of the first executable code; and
utilize the generated state information, as stored in the non-transitory data store, to resume execution of the first executable code in the second execution environment.
1 Assignment
0 Petitions
Accused Products
Abstract
Systems and methods are described for managing asynchronous code executions in an on-demand code execution system or other distributed code execution environment, in which multiple execution environments, such as virtual machine instances, can be used to enable rapid execution of user-submitted code. When asynchronous executions occur, one execution may become blocked while waiting for completion of another execution. Because the on-demand code execution system contains multiple execution environments, the system can efficiently handle a blocked execution by saving a state of the execution, and removing it from its execution environment. When a blocking dependency operation completes, the system can resume the blocked execution using the state information, in the same or different execution environment.
237 Citations
22 Claims
-
1. A system to manage blocking of code executions in an on-demand code execution system due to asynchronous operations, wherein the on-demand code execution system comprises a plurality of execution environments on which user-submitted code may execute, the system comprising:
-
a non-transitory data store configured to store state information regarding suspended executions of tasks on the on-demand code execution system, wherein individual tasks are associated with code executable to implement functionality corresponding to the individual tasks; and one or more processors configured with computer-executable instructions to; obtain instructions to execute a first task associated with first executable code; begin execution of the first executable code within a first execution environment, wherein execution of the first executable code calls for execution of a first dependency operation; after detecting that execution of the first executable code has become blocked awaiting completion of the first dependency operation; determine that a predicted duration of blocking for the execution of the first executable code satisfied a threshold value; generate state information for the execution of the first executable code; store the generated state information in the non-transitory data store; and remove the execution of the first executable code from the first execution environment; and after detecting that the first dependency operation has completed; select a second execution environment in which to resume execution of the first executable code; and utilize the generated state information, as stored in the non-transitory data store, to resume execution of the first executable code in the second execution environment. - View Dependent Claims (2, 3, 4, 5)
-
-
6. A computer-implemented method to manage blocking of code executions in an on-demand code execution system, wherein the on-demand code execution system comprises a plurality of execution environments on which user-submitted code may execute, the computer-implemented method comprising:
-
obtain instructions to execute first executable code within a first execution environment of the on-demand code execution system; after detecting that execution of the first executable code is blocked awaiting completion of a first dependency operation; generating state information for the execution of the first executable code; storing the generated state information in a non-transitory data store distinct from the first execution environment; and removing the execution of the first executable code from the first execution environment; and after detecting that the first dependency operation has completed; selecting a second execution environment in which to resume execution of the first executable code; and utilizing the generated state information, as stored in the non-transitory data store, to resume execution of the first executable code in the second execution environment. - 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 instructions to execute first executable code within a first execution environment of an on-demand code execution system comprising a plurality of execution environments; after detecting that execution of the first executable code has become blocked awaiting completion of a first dependency operation; generate state information for the execution of the first executable code; store the generated state information in a non-transitory data store distinct from the first execution environment; and remove the execution of the first executable code from the first execution environment; and after detecting that the first dependency operation has completed; select a second execution environment in which to resume execution of the first executable code; and utilize the generated state information, as stored in the non-transitory data store, to resume execution of the first executable code in the second execution environment. - View Dependent Claims (16, 17, 18, 19, 20, 21, 22)
-
Specification