Title:
PERSISTENT APPLICATION ACTIVATION AND TIMER NOTIFICATIONS
Kind Code:
A1


Abstract:
The present invention extends to methods, systems, and computer program products for persistent application activation and timer notifications. A durable instance manager, instance execution hosts, and an instance store interoperate to transition instances between executing and persisted states. System properties are associated with an instance. System properties can define re-activation conditions, that when satisfied, indicate that an instance is to be re-activated for execution. System properties can define timers as well as indications that instances are in a persisted but ready to run state.



Inventors:
Taylor, John A. (Bellevue, WA, US)
Allen, Nicholas A. (Redmond, WA, US)
Langley, Stuart J. (Redmond, WA, US)
Sedukhin, Igor (Issaquah, WA, US)
Brown, Justin D. (Seattle, WA, US)
Paramasivam, Kartik (Redmond, WA, US)
Application Number:
12/688628
Publication Date:
07/21/2011
Filing Date:
01/15/2010
Assignee:
Microsoft Corporation (Redmond, WA, US)
Primary Class:
Other Classes:
714/E11.073, 709/203
International Classes:
G06F11/20; G06F11/00; G06F11/16; G06F15/16
View Patent Images:
Related US Applications:
20080270438MEDICAL LABORATORY REPORT MESSAGE GATEWAYOctober, 2008Aronson et al.
20080195912METHOD OF COMMUNICATOINAugust, 2008Mende et al.
20060117387Propagation protection of email within a networkJune, 2006Gunsalus et al.
20060218125SQL query problem determination toolSeptember, 2006Kandil et al.
20100077269REDUCED SIGNALING INTERFACE METHOD AND APPARATUSMarch, 2010Whetsel
20060053476Data structure for policy-based remediation selectionMarch, 2006Bezilla et al.
20090276666SYSTEM, METHOD, AND ADAPTER FOR CREATING FAULT-TOLERANT COMMUNICATION BUSSES FROM STANDARD COMPONENTSNovember, 2009Haley et al.
20030110476Source code debugger, debugging method and debugging programJune, 2003Aihara
20090089619AUTOMATIC DETECTION OF FUNCTIONAL DEFECTS AND PERFORMANCE BOTTLENECKS IN NETWORK DEVICESApril, 2009Huang et al.
20090132867MEDIA FOR USING PARALLEL PROCESSING CONSTRUCTSMay, 2009Stefansson et al.
20040193853Program-controlled unitSeptember, 2004Maier et al.



Primary Examiner:
TRUONG, LOAN
Attorney, Agent or Firm:
MERCHANT & GOULD (MICROSOFT) (P.O. BOX 2903 MINNEAPOLIS MN 55402-0903)
Claims:
What is claimed:

1. In a computer architecture including one or more processors and system memory, the computer architecture also including one or more instance execution hosts, a durable instance manager, and an instance store, the one or more instance execution hosts configured to execute application instances in system memory, wherein application instances include a unit of application state and associated execution logic representing a portion of an application, the instance store configured to durably persist application instances, the durable instance manager configured to receive load and save operations received from instance execution hosts and forward load and save operations to the instance store for implementation, the durable instance manager configured to track whether instances are executing in memory or are persisted, a method for re-activating an instance, the method comprising: an act of a first instance execution host, from among the one or more instance execution hosts, executing an application instance representing a portion of an application; an act of determining that the application instance is to be dormant for some amount of time before further processing of the application instance occurs; an act of assigning a system property to the instance, the system property containing information indicating that the application instance is to be subsequently re-activated for execution; an act of a second instance execution host, from among the one or more instance execution hosts, registering with the durable instance manager an interest in receiving event notifications regarding application instances to re-activate; an act of the second instance execution host receiving an event notification to re-activate the application instance, the event notification responsive to the information contained in the system property persisted in the instance store and the registration with the durable instance manager; and an act of loading the application instance at the second instance execution host in response to receiving the event notification to further process the application instance.

2. The method as recited in claim 1, wherein the system property is a time, the time indicating when the application instance is to be re-activated.

3. The method as recited in claim 2, wherein the act of determining that the application instance is to be dormant for some amount of time before further processing of the application instance occurs comprises an act of the first instance execution host determining that the application instance is not scheduled to receive a next event for a specified timer interval; and wherein the act of the first instance execution host assigning a system property the instance comprises an act of the instance execution host assigning a timer to the application instance, the timer indicating a time when the application instance is to be re-activated to receive the next event.

4. The method as recited in claim 1, wherein the system property is a ready to run property, the ready to run property indicating that the application instance may be re-activated at another instance execution host.

5. The method as recited in claim 4, wherein the act of determining that the application instance is to be dormant for some amount of time before further processing of the application instance occurs comprises an act of the first instance execution host determining that it has received a command to shutdown; and wherein the act of the first instance execution host assigning a system property to the instance comprises an act of the instance execution host assigning a ready to run state to the application instance in response to the shutdown command, the ready to run state indicating to the durable instance manager that the application instance is ready to be re-activated.

6. The method as recited in claim 1, wherein the first instance execution host and the second instance execution host are the same instance execution host.

7. The method as recited in claim 1, wherein the act of registering with the durable instance manager an interest in receiving event notifications comprises an act of the second instance execution host polling the durable instance manager for instances to re-activate; and wherein the act of the second instance execution host receiving an event notification to re-activate the application instance comprises an act of the second instance execution host receiving the event notification in response to the poll request.

8. The method as recited in claim 1, wherein the act of registering with the durable instance manager an interest in receiving event notifications comprises an act of the second instance execution host providing the durable instance manager with an address at which the second instance execution host is waiting to receive messages; and wherein the act of the second instance execution host receiving an event notification to re-activate the application instance comprises an act of the second instance execution host receiving a message containing the event notification at the provided address.

9. The method as recited in claim 1, further comprising: an act of assigning the second instance execution host to a durable instance manager, the durable instance manager configured to receive event notifications on behalf of one or more instance execution hosts during periods when the one or more instance execution hosts are not running; an act of assigning the second instance execution host an instance type, the instance type indicating the type of instances the instance execution host is able to process; an act of assigning an instance type to the instance, the instance type indicating the instance type of the instance execution host that created the instance; an act of the instance execution host manager registering with the durable instance manager an interest in receiving event notifications regarding application instances to re-activate; an act of the instance execution host manager receiving an event notification to re-activate the application instance, the event notification responsive to the information contained in the system property persisted in the instance store and the registration with the durable instance manager, the event notification containing the instance type of the application instance; an act of the instance execution host manager selecting the second instance execution host to process the instance, the selection of the second instance execution host based on the instance type of the second instance execution host matching the instance type of the instance; and an act of the instance execution host manager initiating running of the second instance execution host.

10. The method as recited in claim 9, wherein the act of the instance execution host manager initiating running of the second instance execution host comprises an act of the instance execution host manager sending a message to a server process that activates the second instance execution host.

11. In a computer architecture including one or more processors and system memory, the computer architecture also including one or more instance execution hosts, a durable instance manager, and an instance store, the one or more instance execution hosts configured to execute application instances in system memory, wherein application instances include a unit of application state and associated execution logic representing a portion of an application, the instance store configured to durably persist application instances, the durable instance manager configured to receive load and save operations received from instance execution hosts and forward load and save operations to the instance store for implementation, the durable instance manager configured to track whether instances are executing in memory or are persisted, a method for re-activating an instance, the method comprising: an act of the durable instance manager monitoring execution of an application instance at an instance execution host; an act of the durable instance manager receiving an indication that the application instance is to be subsequently re-activated at an instance execution host at a future time; an act of the durable instance manager persisting a system property corresponding to the application instance at the instance store, the system property containing information defining a re-activation condition that, when satisfied, is an indication that the application instance is to be re-activated for an act of the durable instance manager detecting an event that satisfies the re-activation condition subsequent to persisting the system property corresponding to the application instance; an act of the durable instance manager receiving registration requests from one or more instance execution hosts for interest in receiving event notifications regarding application instances to re-activate; and an act of the durable instance manager sending an event notification to a further instance execution host to re-activate the application instance for execution, the event notification responsive to detection of the event that satisfies the re-activation condition and the registration from the instance execution host.

12. The method as recited in claim 11, wherein the act of the durable instance manager receiving an indication that the application instance is to be subsequently re-activated at an instance execution host at a future time comprises an act of durable instance manager receiving a command from the instance execution host, the command for updating the state of the application instance.

13. The method as recited in claim 12, wherein the command for updating the state of the application instance indicates one of: that the instance is ready to run now or that there is a time in the future at which the instance will be ready to run; and wherein the act of the durable instance manager persisting a system property at the instance store comprises an act of the durable instance manager changing the state of the application instance to ready to run at the time specified by the command.

14. The method as recited in claim 11, wherein the act of the durable instance manager receiving an indication that the application instance is to be subsequently re-activated at an instance execution host at a future time comprises an act of the durable instance manager determining that the instance execution host has failed.

15. The method as recited in claim 14, wherein the act of the durable instance manager persisting a system property at the instance store comprises an act of the durable instance manager changing the state of the application instance to ready to run in response to detecting the failure.

16. The method as recited in claim 11, wherein the act of the durable instance manager detecting an event that satisfies the re-activation condition comprises an act of the durable instance manager detecting that the application instance is in a ready to run state.

17. The method as recited in claim 11, wherein the act of the durable instance manager receiving registration requests from one or more instance execution hosts for interest in receiving event notifications comprises an act of the durable instance manager receiving from an instance execution host an address for sending notifications for instances to re-activate; and wherein the act of the durable instance manager sending an event notification to a further instance execution host to re-activate the application instance for execution comprises an act of the durable instance manager sending an event notification to the address received from the instance execution host.

18. The method as recited in claim 11, wherein the act of the durable instance manager receiving registration requests from one or more instance execution hosts for interest in receiving event notifications comprises an act of the durable instance manager waiting for an instance execution host to poll the durable instance manager for instances to re-activate; and wherein the act of the durable instance manager sending an event notification to a further instance execution host to re-activate the application instance for execution comprises an act of the durable instance manager returning the event notification in response to the poll request.

19. The method as recited in claim 11, further comprising: an act of the durable instance manager persisting an instance type corresponding to the application instance at the instance store, the instance type indicating the type of instance execution host that created the instance; an act of the durable instance manager receiving registration requests from one or more instance execution host managers for interest in receiving event notifications regarding application instances to re-activate; and an act of the durable instance manager sending an event notification to one of the one or more instance execution host managers to re-activate the application instance for execution, the event notification responsive to detection of the event that satisfies the re-activation condition and the registrations from the instance execution host managers, the event notification containing the instance type of the application instance.

20. In a computer architecture including one or more processors and system memory, a method for re-activating an application instance, the method comprising: executing, at a first instance execution host, the application instance; determining, at the first instance execution host, that the application instance is to be saved; saving the application instance, wherein the saving of the application instance persists the state of the application instance to a durable store; providing, at a second instance execution host, an infrastructural endpoint for receiving requests to administer application instances; transmitting, to a durable instance manager, the address of the infrastructural endpoint for the second instance execution host; receiving at the second instance execution host, a request to run the application instance; and restoring the application instance to the second instance execution host to re-activate the application instance and return the application instance to an executing state.

21. The method as recited in claim 20, wherein the determination that the application instance is to be saved comprises a determination that the application instance has been idle for a predetermined duration of time.

22. The method as recited in claim 21, wherein the predetermined duration of time of inactivity prior to saving the application instance is user configured.

Description:

CROSS-REFERENCE TO RELATED APPLICATIONS

Not Applicable.

BACKGROUND

1. Background and Relevant Art

Computer systems and related technology affect many aspects of society. Indeed, the computer system's ability to process information has transformed the way we live and work. Computer systems now commonly perform a host of tasks (e.g., word processing, scheduling, accounting, etc.) that prior to the advent of the computer system were performed manually. More recently, computer systems have been coupled to one another and to other electronic devices to form both wired and wireless computer networks over which the computer systems and other electronic devices can transfer electronic data. Accordingly, the performance of many computing tasks are distributed across a number of different computer systems and/or a number of different computing environments.

Long-running (e.g., hours, days, or even months) applications, such as, for example, workflow applications, often benefit from periodically persisting their work to allow for the application to recover after errors, crashes, or machine failures. Persisting work can include moving work from system memory to secondary (or other) more durable storage. Persisting work permits applications to temporarily go idle and have their resources (e.g., system memory) reassigned. To persist work, an application host coordinates the persisted state with runtime state to ensure that a consistent checkpoint is created. For example, the persisted state may need to coordinate with application transactions, message notifications, locks, local state caches, etc.

However, long-running applications may also need to be restarted at a later time. That is, a long-running application may need to be moved from more durable storage back into system memory. For example, an application may anticipate receipt of a message at a designated time after being persisted to durable storage. For the application to appropriately receive the message, the application may need to be loaded into system memory prior to the message arriving. Alternately, a host execution environment can fail, resulting in the need to restart an application in another execution environment.

BRIEF SUMMARY

The present invention extends to methods, systems, and computer program products for persistent application activation and timer notifications. Embodiments of the invention include restarting an application instance, such as, for example, due to a timer firing or due to an execution host for the application instance being shut down or failing. In some embodiments, a first instance execution host, from among the one or more instance execution hosts, executes an application instance representing a portion of an application. It is determined that the application instance is to be dormant for some amount of time before further processing of the application instance occurs.

A system property is persisted in an instance store for the application instance. The system property contains information indicating that the application instance is to be subsequently re-activated for execution. A second instance execution host, from among the one or more instance execution hosts, registers with the durable instance manager an interest in receiving event notifications regarding application instances to re-activate. The second instance execution host receives an event notification to re-activate the application instance. The event notification is responsive to the information contained in the system property persisted in the instance store and registration with the durable instance manager. The application instance is loaded at the second instance execution host in response to receiving the event notification to further process the application instance.

In other embodiments, a durable instance manager monitors execution of an application instance at an instance execution host. The durable instance manager receives an indication that the application instance is to be subsequently re-activated at an instance execution host at a future time. The durable instance manager persists a system property corresponding to the application instance at the instance store. The system property contains information defining a re-activation condition that, when satisfied, is an indication that the application instance is to be re-activated for execution

The durable instance manager detects an event that satisfies the re-activation condition subsequent to persisting the system property corresponding to the application instance. The durable instance manager receives registration requests from one or more instance execution hosts for interest in receiving event notifications regarding application instances to re-activate. The durable instance manager sends an event notification to a further instance execution host to re-activate the application instance for execution. The event notification is responsive to detection of the event that satisfies the re-activation condition and the registration from the instance execution host.

This summary is provided to introduce a selection of concepts in a simplified form that are further described below in the Detailed Description. This Summary is not intended to identify key features or essential features of the claimed subject matter, nor is it intended to be used as an aid in determining the scope of the claimed subject matter.

Additional features and advantages of the invention will be set forth in the description which follows, and in part will be obvious from the description, or may be learned by the practice of the invention. The features and advantages of the invention may be realized and obtained by means of the instruments and combinations particularly pointed out in the appended claims. These and other features of the present invention will become more fully apparent from the following description and appended claims, or may be learned by the practice of the invention as set forth hereinafter.

BRIEF DESCRIPTION OF THE DRAWINGS

In order to describe the manner in which the above-recited and other advantages and features of the invention can be obtained, a more particular description of the invention briefly described above will be rendered by reference to specific embodiments thereof which are illustrated in the appended drawings. Understanding that these drawings depict only typical embodiments of the invention and are not therefore to be considered to be limiting of its scope, the invention will be described and explained with additional specificity and detail through the use of the accompanying drawings in which:

FIG. 1A illustrates an example computer architecture that facilitates restarting an instance.

FIG. 1B illustrates another view of the example computer architecture of FIG. 1A.

FIG. 1C illustrates another view of the example computer architecture of FIG. 1A.

FIG. 2 illustrates a sequence diagram of instance activation.

FIG. 3 illustrates a flow chart of an example method for re-activating an instance.

FIG. 4 illustrates a flow chart of an example method for re-activating an instance.

DETAILED DESCRIPTION

The present invention extends to methods, systems, and computer program products for persistent application activation and timer notifications Embodiments of the invention include restarting an application instance, such as, for example, due to a timer firing or due to an execution host for the application instance being shut down or failing. In some embodiments, a first instance execution host, from among the one or more instance execution hosts, executes an application instance representing a portion of an application. It is determined that the application instance is to be dormant for some amount of time before further processing of the application instance occurs.

A system property is persisted in an instance store for the application instance. The system property contains information indicating that the application instance is to be subsequently re-activated for execution. A second instance execution host, from among the one or more instance execution hosts, registers with the durable instance manager an interest in receiving event notifications regarding application instances to re-activate. The second instance execution host receives an event notification to re-activate the application instance. The event notification is responsive to the information contained in the system property persisted in the instance store and registration with the durable instance manager. The application instance is loaded at the second instance execution host in response to receiving the event notification to further process the application instance.

In other embodiments, a durable instance manager monitors execution of an application instance at an instance execution host. The durable instance manager receives an indication that the application instance is to be subsequently re-activated at an instance execution host at a future time. The durable instance manager persists a system property corresponding to the application instance at the instance store. The system property contains information defining a re-activation condition that, when satisfied, is an indication that the application instance is to be re-activated for execution

The durable instance manager detects an event that satisfies the re-activation condition subsequent to persisting the system property corresponding to the application instance. The durable instance manager receives registration requests from one or more instance execution hosts for interest in receiving event notifications regarding application instances to re-activate. The durable instance manager sends an event notification to a further instance execution host to re-activate the application instance for execution. The event notification is responsive to detection of the event that satisfies the re-activation condition and the registration from the instance execution host.

Embodiments of the present invention may comprise or utilize a special purpose or general-purpose computer including computer hardware, such as, for example, one or more processors and system memory, as discussed in greater detail below. Embodiments within the scope of the present invention also include physical and other computer-readable media for carrying or storing computer-executable instructions and/or data structures. Such computer-readable media can be any available media that can be accessed by a general purpose or special purpose computer system. Computer-readable media that store computer-executable instructions are physical storage media. Computer-readable media that carry computer-executable instructions are transmission media. Thus, by way of example, and not limitation, embodiments of the invention can comprise at least two distinctly different kinds of computer-readable media: computer storage media and transmission media.

Computer storage media includes RAM, ROM, EEPROM, CD-ROM or other optical disk storage, magnetic disk storage or other magnetic storage devices, or any other medium which can be used to store desired program code means in the form of computer-executable instructions or data structures and which can be accessed by a general purpose or special purpose computer.

A “network” is defined as one or more data links that enable the transport of electronic data between computer systems and/or modules and/or other electronic devices. When information is transferred or provided over a network or another communications connection (either hardwired, wireless, or a combination of hardwired or wireless) to a computer, the computer properly views the connection as a transmission medium. Transmissions media can include a network and/or data links which can be used to carry or desired program code means in the form of computer-executable instructions or data structures and which can be accessed by a general purpose or special purpose computer. Combinations of the above should also be included within the scope of computer-readable media.

Further, upon reaching various computer system components, program code means in the form of computer-executable instructions or data structures can be transferred automatically from transmission media to computer storage media (or vice versa). For example, computer-executable instructions or data structures received over a network or data link can be buffered in RAM within a network interface module (e.g., a “NIC”), and then eventually transferred to computer system RAM and/or to less volatile computer storage media at a computer system. Thus, it should be understood that computer storage media can be included in computer system components that also (or even primarily) utilize transmission media.

Computer-executable instructions comprise, for example, instructions and data which, when executed at a processor, cause a general purpose computer, special purpose computer, or special purpose processing device to perform a certain function or group of functions. The computer executable instructions may be, for example, binaries, intermediate format instructions such as assembly language, or even source code. Although the subject matter has been described in language specific to structural features and/or methodological acts, it is to be understood that the subject matter defined in the appended claims is not necessarily limited to the described features or acts described above. Rather, the described features and acts are disclosed as example forms of implementing the claims.

Those skilled in the art will appreciate that the invention may be practiced in network computing environments with many types of computer system configurations, including, personal computers, desktop computers, laptop computers, message processors, hand-held devices, multi-processor systems, microprocessor-based or programmable consumer electronics, network PCs, minicomputers, mainframe computers, mobile telephones, PDAs, pagers, routers, switches, and the like. The invention may also be practiced in distributed system environments where local and remote computer systems, which are linked (either by hardwired data links, wireless data links, or by a combination of hardwired and wireless data links) through a network, both perform tasks. In a distributed computing environment, program modules may be located in both local and remote memory storage devices.

FIG. 1A illustrates an example computer architecture 100 that facilitates restarting instances. Accordingly, computer architecture 100 can represent a distributed computing environment where a common application pattern takes the overall state of a system and breaks the overall state into discrete instances. Each instance represents a meaningful and, at least partially, autonomous unit of state and associated application logic. Computer architecture 100 also provides infrastructural support for managing instances in both an executing state and a persisted state.

An instance in an executing state is in system memory and using processor resources. An instance in a persisted state is dormant and moved (e.g., temporarily) to more durable (secondary) storage, such as, for example, to disk. Thus, within computer architecture 100, instances can move from a persisted state to an executing state as a result of an external stimulus (e.g., external events 108), such as the arrival of an application message from another system or as a result of internal events. Workflow is one example of a program execution technology that can be hosted and managed using both executing and persisted states.

As depicted, computer architecture 100 includes durable instance manager 101, instance execution host 102, and instance store 103. Each of the components is connected to one another over (or is part of) a network, such as, for example, a Local Area Network (“LAN”), a Wide Area Network (“WAN”), and even the Internet. Accordingly, each of the depicted computer systems as well as any other connected computer systems and their components, can create message related data and exchange message related data (e.g., Internet Protocol (“IP”) datagrams and other higher layer protocols that utilize IP datagrams, such as, Transmission Control Protocol (“TCP”), Hypertext Transfer Protocol (“HTTP”), Simple Mail Transfer Protocol (“SMTP”), etc.) over the network.

Generally, instance execution host 102 contains the logic necessary for the in-memory runtime execution of the instance. Instance store 103 is configured to physically hold the data for instances that are in a persisted state. Durable instance manager 101 is situated logically between the instance execution host 102 and instance storage 103 and coordinates their interaction. Durable instance manager 101 receives load and save operation requests (load/save operations 104) from instance execution hosts 102 and forwards these (load/save operations 106) to instance store 103. Durable instance manager 101 is also configured to send internal activation events (e.g., activation events 107) to activate instance execution hosts to process specified instances.

Generally, if an event occurs and the applicable instance happens to be in memory in the executing state, then that event is directed to the instance by the instance execution host 102 and handled appropriately by the associated application code. However, if the event occurs and the instance is in a persisted state in instance store 103, instance execution host 102 sends a request to instance store 103 to load the applicable instance.

Durable instance manager 101 is configured to be aware of the state of instances in the system at any time, including whether an instance is executing in an instance execution host or is persisted in instance store 103. Durable instance manager 101 is also configured to be aware of which instance execution host an instance is executing at. Durable instance manager 101 is also configured to track the availability and state (as to what instance types are available) of the set of instance execution hosts.

As previously described, there are different sources for events, including internal and external. An example of an external event is the arrival of an application message at an instance execution host. For an external event, an instance execution host loads the instance and then gives it the message. The instance may then handle the event by updating its state and then starting to wait on another application event. In such a case the instance “goes idle”. In response, the instance execution host attempts to unload or save idle instances. In order to avoid thrashing, an instance execution host may also wait for a time interval prior to unloading the instance.

Internal events include activation events. For example, based on monitoring, durable instance manager 101 can determines that a particular instance is to be running in an instance execution host. Durable instance manager 101 can then send activation events (e.g., activation events 107) to one of the instance execution hosts (e.g., instance execution host 102) it knows about.

Activation events may occur at one or more of two levels, at an instance type level and at the instance level. Generally, an instance type is the definition of the particular program code for the instance. On the other hand, an instance is the actual data for a particular instance. Type level activation can be integrated with hosting infrastructure in a different way than instance level activation. Durable instance manager 101 can send a type level event to make the instance type available. Then, once the type is available, durable instance manager 101 can send an instance level event to activate an instance.

FIG. 2 illustrates a sequence diagram 200 of instance activation. As depicted, durable instance manager 201 sends activate instance Type A to instance execution host 202. Instance execution host 202, returns an indication of readiness to accept instance events for instance Type A. Durable instance manager 201 then sends activate Instance 123 of Type A to instance execution host 202. Instance execution host 202 returns a load operation to durable instance manager 201. The load operation indicates that Instance 123 is to be loaded at instance execution host 202. Durable instance manager 201 can then load Instance 123 from durable storage to instance execution host 202, transitioning instance 123 to an executing state.

In some environments, there may be multiple instances of the same type. Thus, it may be beneficial for an instance execution host to be informed of activation in a normalized manner with two distinct event types. Two levels of activation may be appropriate when an instance execution host implements an optimization whereby types are only loaded on-demand. First, the instance-type is made available by executing the type level activation. After that type is available, the instance execution host indicates this availability to the distributed instance manager and instance level activation events are sent to that particular host.

A durable instance manager can also keep track of the state of instance execution hosts. When the durable instance manager is aware of an instance execution host that has the appropriate type available, the durable instance manager can bypass the type level event and send the instance activation event directly to that host.

Embodiments of the invention can send activation events to an instance execution host in response to a variety of different re-activation conditions, including expiration of a timer, graceful shutdown of an instance execution host, and detected failure of an instance execution host. To facilitate appropriate re-activation of an instance, a system property can be stored along with the instance in instance store 103. The system property can define one or more conditions, which when satisfied, provide an indication of when the instance is to be re-activated for execution (i.e., transitioned to an executing state).

In some embodiments, an instance execution host associates a system property with an instance. For example, an instance execution host can determine that an instance is to be idle until a specified wake up time. In response, the instance execution host can associate the instance with a system property representing a timer. The instance execution host can then save the instance to durable storage. The timer can indicate the specified wake up time, the next time the instance is to be transitioned back to an executing state. A durable instance manager can monitor the system property and re-activate the instance at the specified wake up time (e.g., prior to receiving a next message). An instance execution host may define many timers, however a durable instance manager can appropriately re-activate an instance with knowledge of the next time.

Alternately, when an instance execution host is gracefully shutdown, the instance execution host unloads its currently executing instances. Instances are unloaded by interrupting execution and saving the instances to durable storage. The instance execution host can associate interrupted instances with a system property indicating that the instances are in a “Ready To Run” state. A durable instance manager can detect the property and attempt to re-activate “Ready To Run” instances (potentially in a load balanced way) across other instance execution hosts. Thus, a “Ready To Run” property can indicate that an application instance is to be re-activated either at the same execution host or at another different execution host.

FIG. 1B illustrates another view of computer architecture 100, wherein an instance execution host associates a system property with an instance that is to be re-activated.

As depicted in FIG. 1B, application instance 112 is executing at instance execution host 102. In response to detecting a period of dormancy for instance 112 or to a graceful shutdown of instance execution host 102, instance execution host 102 stores system property 113 (e.g., a timer or “Ready To Run” indication) in application instance 112. Instance execution host then sends save operation 131 to durable instance manager 101. Durable instance manager 101 in turn sends save operation 131 to instance store 103 to persist application instance 112 at instance store 103 (transitioning application instance 112 to a persisted state).

From time to time, durable instance manager 101 scans instance store 103 for instances that are to be re-activated based on a system property. Durable instance manager 101 can detect, based on system property 113, that application instance 112 is to be re-activated (e.g., when a wake up time is reached or application instance 112 is “Ready To Run”). Alternately, agent 111 can scan instance store 103 for instances that are to be re-activated based on a system property. Agent 111 can detect, based on system property 113, that application instance 112 is to be re-activated. In response, agent 111 can send notification 116 to durable instance manager 101. Notification 116 can indicate that application instance 112 is to be re-activated.

Durable instance manager 101 can then send load command 132 to re-activate application instance 112 at instance execution host 102. Instance execution host 102 can load application instance 112, transitioning application instance 112 to an executing state. Application instance 112 then continues to execute, such as, for example, processing message 133.

Alternately, durable instance manager 101 can re-activate application instance 112 at a different instance execution host, such as, for example, when instance execution host 102 was gracefully shutdown. To facilitate activation, durable instance manager 101 can initiate one or more of the levels of activation described in sequence diagram 200 with the different instance execution host.

In other embodiments, a durable instance manager associates a system property with an instance. A durable instance manager can be configured to monitor the connection between an instance execution host and the durable instance manager and configured to track the instances contained by (being executed at) an instance execution host. Generally, when the durable instance manager detects that a connection to an instance execution host has been dropped, the durable instance manager changes the state of all instances contained by the instance execution host to “Ready To Run”. The durable instance manager can detect the property and attempt to re-activate “Ready To Run” instances (potentially in a load balanced way) across other instance execution hosts.

FIG. 1C illustrates another view of computer architecture 100, wherein a durable instance manager associates a system property with an instance that is to be re-activated.

As depicted in FIG. 1C, application instance 121 is executing at instance execution host 102. Durable instance manager 101 monitors a connection between instance execution host 102 and durable instance manager 101. Durable instance manager 101 also tracks the instances contained by (being executed at) instance execution host 102. In response to detecting a dropped connection to instance execution host 102, durable instance manager 101 changes the state of all the instances contained by instance execution host 102 to a “Ready To Run” state.

For example, durable instance manager 101 can set system property 122 in application instance 121 persisted in instance store 103. System property 122 indicates that application instance 121 is in a “Ready To Run” state.

From time to time, durable instance manager 101 scans instance store 103 for instances that are to be re-activated based on a system property. Durable instance manager 101 can detect, based on system property 122 indicating a “Ready To Run” state, that application instance 121 is to be re-activated. Alternately, agent 111 can scan instance store 103 for instances that are to be re-activated based on a system property. Agent 111 can detect, based on system property 122, that application instance 121 is to be re-activated. In response, agent 111 can send notification 136 to durable instance manager 101. Notification 136 can indicate that application instance 112 is to be re-activated.

Durable instance manager 101 can then attempt to activate a instance execution host to load application instance 121. To facilitate activation, durable instance manager 101 can initiate one or more of the levels of activation described in sequence diagram 200 for instance execution. For example, if a connection between instance execution host 102 and durable instance manager 101 is again detected, durable instance manager 101 can send activation events 152 to instance execution host 102. Alternately, durable instance manager 101 can send activation events 153 to instance execution host 141 (or to some other instance execution host).

Durable instance manager 101 can then send load command 134 to re-activate application instance 112 at the appropriate instance execution host (e.g., either 102 or 141). The appropriate instance execution host can then load application instance 121, transitioning application instance 121 to an executing state. Application instance 121 then continues to execute, such as, for example, processing further messages.

FIG. 3 illustrates a flow chart of an example method 300 for re-activating an instance. Method 300 will be described with respect to the components and data of computer architecture 100.

Method 300 includes an act of a first instance execution host, from among the one or more instance execution hosts, executing an application instance representing a portion of an application (act 301). For example in FIG. 1B, instance execution host 102 can be executing application instance 112. Alternately in FIG. 1C, instance execution host 102 can be executing application instance 121.

Method 300 includes an act of determining that the application instance is to be dormant for some amount of time before further processing of the application instance occurs (act 302). For example in FIG. 1B, instance execution host 102 can detect that application instance 112 is to be idle for some amount of time or that instance execution host 102 is being gracefully shutdown. Alternately in FIG. 1C, durable instance manager 101 can detect a connection between instance execution host 102 and durable instance manager 101 is dropped.

Method 300 includes an act of persisting a system property in an instance store for the application instance, the system property containing information indicating that the application instance is to be subsequently re-activated for execution (act 303). For example in FIG. 1B, instance execution host 102 can assign system property 113 to application instance 112 representing a timer or representing that application instance 112 is in a “Ready To Run” state. Alternately in FIG. 1C, durable instance manager 101 can assign system property 122 to application instance 121 representing that application instance 121 is in a “Ready To Run” state. In either embodiment, durable instance manager 101 can persist the system property (either 113 or 122 respectively) in instance store 103.

When setting a timer or detecting a graceful shutdown, an instance execution host can send a save command to the durable instance manager to persist the application instance along with the system property at the instance store. For example in FIG. 1B, instance execution host 102 can send save 131 to durable instance manager 101 (which subsequently persists application instance 121 and system property 113 in instance store 103, thereby transitioning application instance 112 to a persisted state).

When setting a timer or detecting a graceful shutdown, an instance execution host can remove the application instance from system memory subsequent to persisting the application instance along with the system property at the instance store. For example in FIG. 1B, instance execution host 102 can remove application instance 112 from system memory.

On the other hand, when detecting a dropped connection, a durable instance manager may not receive a save command nor be aware if an application instance is or is not still in system memory at an instance execution host. For example in FIG. 1C, upon detecting a dropped connection to instance application host 102, durable instance manager may not receive a save command from instance execution host 102 nor be aware if application instance 121 is still contained by instance application host 102.

Method 300 includes an act of a second instance execution host, from among the one or more instance execution hosts, registering with the durable instance manager an interest in receiving event notifications regarding application instances to re-activate (act 304). For example in FIG. 1B, a second instance execution host, which may be instance execution host 102 or some other instance execution host, can register with durable instance manager 101 an interest in receiving event notifications regarding application instances (e.g., application instance 112) to re-activate. Alternately in FIG. 1C, instance execution host 102 or instance execution host 141 can register durable instance manager 101 an interest in receiving event notifications regarding application instances (e.g., application instance 121) to re-activate.

Method 300 includes an act of the second instance execution host receiving an event notification to re-activate the application instance, the event notification responsive to the information contained in the system property persisted in the instance store and registration with the durable instance manager (act 305). For example in FIG. 1B, a second instance execution host, which may be instance execution host 102 or some other instance execution host, can receive activation events in preparation for loading application instance 112. The activation events are responsive to information contained in system property 113 and the second execution host having registered for event notifications.

Alternately in FIG. 1C, instance execution host 102 can receive activation events 152 or instance execution host 141 can receive activation events 153 in preparation for loading application instance 121. Activation events 152 or 153 are responsive to information contained in system property 122 and instance execution host 102 or 141 having registered for event notifications. Activation events can represent one or more levels of activation as depicted in sequence diagram 200.

Method 300 includes an act of loading the application instance at the second instance execution host in response to receiving the event notification to further process the application instance (act 306). For example in FIG. 1B, instance execution host 102 or some other instance execution host can receive load 132 to load application instance 112 in response to being activated to receive application instance 112. Alternately in FIG. 1C, instance execution host 102 or instance execution host 141 can receive load 134 to load application instance 121 in response to being activated to receive application instance 121.

FIG. 4 illustrates a flow chart of an example method 400 for re-activating an instance. Method 400 will be described with respect to the components and data of computer architecture 100.

Method 400 includes an act of durable instance manager monitoring execution of an application instance at an instance execution host (act 401). For example in FIG. 1B, durable instance manager 101 can monitor execution of application instance 112 at instance execution host 102. Alternately in FIG. 1C, durable instance manager 101 can monitor execution of application instance 121 at instance execution host 102.

Method 400 includes an act of the durable instance manager receiving an indication that the application instance is to be subsequently re-activated at an instance execution host at a future time (act 402). For example in FIG. 1B, durable instance manager 101 can receive save 131 including application instance 112 and system property 113. System property 113 can represent a timer or that application instance 112 is in a “Ready To Run” state. Alternately in FIG. 1C, durable instance manager 101 can detect that a connection between instance execution host 102 and durable instance manage 101 is dropped.

Method 400 includes an act of the durable instance manager persisting a system property corresponding to the application instance at the instance store, the system property containing information defining a re-activation condition that, when satisfied, is an indication that the application instance is to be re-activated for execution (act 403). For example in FIG. 1B, durable instance manager 101 can persist system property 113 in instance store 103. Property 113 can define a wake up time that when reached satisfies the re-activation condition. Alternately, property 113 can define that the re-activation condition is detecting that application instance 112 is in a persistent but “Ready To Run” state.

Alternately in FIG. 1C, durable instance manager 101 can persist system property 122 in instance store 103. Property 122 can define that the re-activation condition is detecting that application instance 121 is in a persistent but “Ready To Run” state.

Method 400 includes an act of the durable instance manager detecting an event that satisfies the re-activation condition subsequent to persisting the system property corresponding to the application instance (act 404). For example in FIG. 1B, durable instance manager 101 can detect a defined wake up time or that instance 112 is in a persisted but “Ready To Run” state subsequent to persisting system property 113. Alternately in FIG. 1C, durable instance manager 101 can detect instance 121 is in a persisted but “Ready To Run” state subsequent to persisting system property 122.

Method 400 includes an act of the durable instance manager receiving registration requests from one or more instance execution hosts for interest in receiving event notifications regarding application instances to re-activate (act 405). For example in FIG. 1B, durable instance manager 101 can receive a registration request from instance execution host 102 and/or from other instance execution hosts for interest in receiving event notifications regarding application instances (e.g., application instance 112) to re-activate. Alternately in FIG. 1C, durable instance manager 101 can receive a registration request from instance execution host 101 and/or instance execution host 141 for interest in receiving event notifications regarding application instances (e.g., application instance 121) to re-activate.

Method 400 includes an act of the durable instance manager sending an event notification to a further instance execution host to re-activate the application instance for execution, the event notification responsive to detection of the event that satisfies the re-activation condition and the registration from the instance execution host (act 406). For example in FIG. 1B, durable instance manager 101 can send activation events to instance execution host 102 or some other instance execution host in response to detecting a defined wake up time or that application instance 112 is in a persisted but “Ready To Run” state and that instance execution host 102 or some other instance registered for event notifications. Alternately in FIG. 1C, durable instance manager 101 can send activation events 152 to instance execution host 102 or send activation events 153 to instance execution host 141 in response to detecting that application instance 121 is in a persisted but “Ready To Run” state and that instance execution host 102 or 141 some registered for event notifications.

Accordingly, embodiments of the invention facilitate increased reliability through the use of persistence. Further, since the loading and unloading of instances is monitored and controlled, a system can scale in terms of the amount of work it can handle on a particular hardware configuration.

The present invention may be embodied in other specific forms without departing from its spirit or essential characteristics. The described embodiments are to be considered in all respects only as illustrative and not restrictive. The scope of the invention is, therefore, indicated by the appended claims rather than by the foregoing description. All changes which come within the meaning and range of equivalency of the claims are to be embraced within their scope.