1. Field of the Invention
The present invention is related to a method, system, and article of manufacture for agent processing.
2. Description of the Related Art
A client computer on which client applications run may be connected by a network, such as the Internet, to a server computer. The Internet is a world-wide collection of connected computer networks (i.e., a network of networks). The server computer may be connected to several low level devices. One type of low level device is a redundant array of independent disks (RAID). A RAID device enables storage of the same data on multiple hard disks, thus allowing simultaneous accesses to the copies of data.
When a client application desires to access a low level device to, for example, retrieve data about the low level device (e.g., whether the low level device is online and available for use or offline and not available for use), the client application submits a request for the data to, for example, the server computer connected to the low level device. The server computer generates a process to handle the client application's request. The process is assigned a portion of memory, which is referred to as the address space of the process.
Moreover, agents implemented in software at the server computer may be used to handle low level device interactions. An agent performs some function, such as retrieving data about a low level device. Thus, the server computer may generate an agent to fulfill the client application's request.
In many cases, the agents may access hardware or third party libraries that have unknown stability levels (e.g., crash often). In some systems, the agents run in the same address space as the process (e.g., a server process) that executed the agents. If agents are permitted to run within the same address space as a process, when one agent fails (e.g., because it is accessing an unstable device), the entire process fails and must be restarted. If the process generates multiple agents, then the failure of one agent causes the termination of all of the agents. This, of course, causes disruptions for a client application.
A Common Gateway Interface (CGI) is a specification for transferring information between a World Wide Web (“Web”) server and a CGI program. A CGI program may send multiple CGI requests (i.e., requests from a CGI program) to a Web server. Each request is handled by a CGI process, and each CGI process uses a separate address space. For example, if three CGI processes are invoked, each CGI process has a separate address space, resulting in the use of three different address spaces.
FastCGI is a programming interface that can speed up Web applications that use the Common Gateway Interface (CGI). In particular, FastCGI is a plug-in to a Web server computer that processes CGI requests received from a client computer. FastCGI manages multiple CGI requests with a single process that uses a single address space. Thus, if three CGI requests are received a the server computer, one CGI process using one address space handles all three CGI requests.
Thus, there is a need in the art for improved agent execution.
Provided are a method, system, and for processing a request. Initially, an agent that may process the request is identified. Whether the agent should be executed within an address space of an invoking process that would invoke the agent or within a separate address space is determined. If it is determined that the agent should be executed within a separate address space, the agent is executed within a separate address space.
In certain implementations, there are multiple agents and an agent is identified from the group of agents.
In additional implementations, determining whether the agent should be executed within an address space of an invoking process or within a separate address space is based on information in a configuration file. The configuration file includes an indication of whether an agent should be executed in a separate address space, a group identifier, and an indication of when to launch the agent.
In yet other implementations, it is determined when the agent should be launched. In certain implementations, the agent is launched when the invoking process starts. In certain implementations, the agent is launched when the request is received.
In further implementations, an agent has a group identifier and it is determined whether the agent is part of a group of agents sharing the group identifier. In certain implementations, when an agent is part of the group of agents sharing the group identifier and when the agent is executed within the separate address space, each of the agents in the group of agents are executed within that separate address space.
In additional implementations, it is determined that the agent has failed. If the agent was executed within the separate address space, the agent is restarted.
In yet other implementations, an indication to switch the agent that is executing within a separate address space to the agent that is executing within the address space of the invoking process that invoked the agent is received. The agent that is to be switched is terminated and executed within the address space of the invoking process. In certain implementations, the agent is part of a group of agents and each of the agents in the group is terminated and executed within the address space of the invoking process that invoked the agent.
In further implementations, an indication to switch the agent that is executing within an address space of an invoking process that invoked the agent to an agent that is executing in the separate address space is received. The agent that is executing within the address space of a process that invoked the agent is quiesced and executed within the separate address space.
In additional implementations, when the invoking process that has invoked the agent is restarted, a determination is made of which agents are to be executed in one or more separate address spaces based on information stored by the invoking process before it was restarted. Then, those agents are executed in the one or more separate address spaces.
The described implementations of the invention provide a method, system, and for agent processing. In particular, an agent may be forked or threaded. The designation of an agent as forked or threaded may be switched while the agent is processing. Moreover, if a process terminates before completing processing, when the process restarts, the process redetermines which agents should be forked based on information stored before the process terminated.
Referring now to the drawings in which like reference numbers represent corresponding parts throughout:
In the following description, reference is made to the accompanying drawings which form a part hereof and which illustrate several implementations of the present invention. It is understood that other implementations may be utilized and structural and operational changes may be made without departing from the scope of the present invention.
In certain implementations of the invention, an agent may be executed within an address space of a process that is invoking the agent (an “invoking process”) or may be executed within a secondary address space. When an agent is executed within an address space of a process that is invoking the agent, the agent is said to be a “threaded agent.” When an agent is executed within a secondary address space, rather than the address space of the process that executed the agent, the agent is said to be a “forked agent.”
The invention provides a common infrastructure to enable agents to be executed either within the same address space of a server computer process that receives a request from a client computer or executed within a separate address space. In certain implementations, the designation of an agent as threaded or forked is based on run time configurable parameters. In certain implementations, the designation of an agent as threaded or forked is dynamically determined based on past execution history of the agent. The designation of an agent as threaded or forked may be changed while the agent is executing.
With implementations of this invention, a system administrator may designate an agent as threaded or forked. For example, if a system administrator knows (e.g., from past testing experience) that a particular agent often fails (i.e., is unstable), then the system administrator may designate this agent as a forked agent that executes within a separate address space, rather than within the address space of a process that invoked the agent. On the other hand, if an agent is known to often complete successfully (i.e., does not terminate often and is stable), then the system administrator may designate the agent as a threaded agent that executes within the address space of the process that invoked the agent. When an agent that is executed within the address space of the process that invoked the agent fails, the process is terminated and restarted. When an agent that is executed in a separate address space fails, the agent (rather than the process) is terminated and restarted. Since an agent that is unstable may be executed within a separate address space, while an agent that is stable may be executed within the address space of the process that invoked the stable agent, the process will be more stable (i.e., it is less likely that the process will be terminated and restarted).
In certain implementations, an agent manages a low level device (e.g., a RAID device). For example, the agent may retrieve data on the state of the low level device. The data may indicate, for example, whether the low level device is online or offline, the status of spindles or temperature sensors at the low level device, or the number of volumes in a RAID device. The agent may also change the low level device (e.g., take a volume of a RAID device offline). In certain implementations, the agent may retrieve data stored on the low level device.
The HTTP server 102 is connected to RAID devices 154, 156, and 192. The HTTP server 102 includes an operating system 104, such as a UNIX® operating system. The operating system 104 generates one or more processes to perform various functions. The client application A 110 sends requests to the HTTP server 102 to access RAID devices 154, 156, and/or 192.
In certain implementations, when the operating system 104 starts up, the operating system 104 invokes a primary process 118. The primary process 118 binds to uniform resource locators (URLS) (i.e., “ports”) at the HTTP server 102. The primary process 118 may be a daemon. The primary process 118 may include an agent daemon 120 for servicing requests for agent services from client applications 110, 112, and 114.
The agent daemon 120 includes a main component 122 that starts up the agent daemon 120. The agent daemon 120 also includes a mapping to URLs 126, 128, and 130 at HTTP server 124 (which represents HTTP server 102 for the primary process). The agent daemon 120 also includes agent session managers 132. Agent session managers 132 includes session managers 134, 136, and 138 for managing agent proxies 142, 144, and 182. The agent proxies 142 and 144 are part of agent library 140, while agent proxy 182 is part of agent library 180. Each agent proxy 142, 144, and 182 manages a forked or threaded agent 150, 152, or 190. Threaded agent-N 152 is the nth agent. In certain implementations, the number of agents is set by a vendor who designed the agents. Each agent 150, 152, or 190 may be connected to a low level device, such as RAID devices 154, 156, and 192. In certain implementations, agents 150, 152, and 190 are written to an agent application programming interface (agent API). The agent API may be written in any programming language (e.g., a C language API or a Java language API). In
An HTTP server 124 process communicates with a session manager 134, 136, or 138. The session manager 134, 136, or 138 communicates with an agent 150, 152 or 190 through an agent proxy 142, 144, or 182. If the agent 190 is forked, the communication occurs over a form of interprocess communication (IPC). IPC is a set of programming interfaces used to manage processes executed by an operating system. IPC enables two or more processes to communicate with each other. If an agent 150 or 152 is threaded, a local procedure may be used to communicate with the agent. Neither the client application 110, 112, or 114 nor the agent 150, 152, or 190 needs to be aware of whether a particular agent 150, 152, or 190 is forked or threaded. In certain implementations, the client application 110, 112, or 114 or the agent 150, 152, or 190 may request information on whether a particular agent 150, 152, or 190 is forked or threaded.
Client application A 110 may make a request for agent services (e.g., obtaining data describing the state of RAID device 192 or data stored at RAID device 192) through a socket to URL 126. The request is passed on to a session manager, such as session manager 134. The session manager 134 determines which agent should process the request and whether the agent is a forked agent. To process a request, the agent retrieves data requested by the client (e.g., data describing a device or data stored on the device). The determination of which agent should process the request may be based on which agent is connected to a device from which the client application has requested data. For example, if client application A 110 has requested data about RAID device 192, then the session manager would assign agent-1190 to process the request.
The determination of whether the selected agent is forked or threaded may be made, for example, with reference to a configuration file that specifies which agents are to be threaded and which are to be forked. In this example, the session manager 134 determines that the request should be passed to a forked agent. Additionally, the session manager 134 determines when to launch an agent. In particular, an agent may be classified as “lazy” or “immediate” in a configuration file. When the primary process 118 starts, the session managers 132 review the configuration file and determine whether any of the agents are immediate. Agents classified as immediate are launched when the primary process 118 starts. Agents classified as lazy are launched when a request from a client application 110, 112, or 114 is received. Table A illustrates a sample configuration file.
According to the configuration file of Table A, agent-1190 is forked, is lazy (i.e., launched in response to a first client application request), and has group ID 1. Agent-2150 is threaded, immediate (i.e., launched when the primary process 118 is launched), and has group ID 2. Agent-3152 is threaded, lazy, and has group ID 3.
The group ID values are used when forking multiple agents. In certain implementations, multiple agents may be forked as a group so that they may logically work together and share data. The session manager 134, 136, or 138 determines whether to group two or more agents based on the group ID in the configuration file.
The session manager 134 invokes a secondary process 160. For ease of illustration, one secondary process 160 is shown. However, multiple additional processes may be invoked for additional forked agents. The secondary process 160 includes many of the components of the primary process, but does not include agent proxies 142 and 144 managing threaded agents 150 and 152, respectively, and does not include the threaded agents 150 and 152, as illustrated in
Moreover, client application B 112 may make a request for agent services to access RAID device 154 through a socket to URL 128. The request is passed on to session manager 136. The session manager 136 determines which agent should process the request and whether the agent is a forked agent. In this example, the session manager 136 determines that the request should be passed to a threaded agent-2150. The session manager 136 passes the request to agent proxy 142, which manages threaded agent-2150. Threaded agent-2150 processes the request.
For ease of illustration, only one forked agent-1190 has been illustrated in secondary process 160.
When an agent is threaded, the session manager 136 or 138 within a primary process 118 passes the request to an agent proxy 142 or 144 within the primary process 118 (block 310). The agent proxy 142 or 144 within the primary process 118 passes the request to the threaded agent 150 or 152 (block 312). The threaded agent 150 or 152 performs the request (block 314).
When an agent is forked, the session manager 134 within a primary process 118 creates a secondary process 160 that includes the forked agent 190 (block 308). The session manager 134 within the primary process 118 determines whether the forked agent 190 is in a group of agents, by for example, using a configuration file (block 316). If so, processing continues to block 318, otherwise, processing continues to block 320. In block 318, the session manager, 134 invokes other agents in the group in the secondary process 160. Then, the session manager 134 within the primary process 118 passes the request to an agent proxy 182 within the secondary process 160 (block 320). The agent proxy 182 within the secondary process 160 passes the request to the forked agent 190 (block 322). The forked agent 190 performs the request (block 324), by, for example accessing RAID device 192.
When the primary process 118 restarts, the primary process 118 is able to access the data. In particular, each session manager 134, 136, or 138 uses the data to determine whether an agent 110, 112 or 114 should be forked (block 702). For example, if a threaded agent 112 or 114 failed previously, upon restart, whichever session manager 136 or 138 that is determining whether that agent 112 or 114 should be forked, may designate that agent 112 or 114 as a forked agent when the primary process 118 restarts due to that agent's 112 or 114 previously failure. Additionally, if a forked agent 190 did not fail, the session manager 134, 136 or 138 may designate that agent as a threaded agent when the primary process 118 restarts. Then, the agents designated as forked agents are forked (block 704). In certain implementations, the determination of which agents should be forked may be made by an agent daemon, a session manager, or an agent library, or by some combination of these components.
In block 802, it is determined whether the agent 150, 152 or 190 is being switched from a threaded agent 150 or 152 to a forked agent. If so, processing continues at block 804, otherwise, processing continues at block 806. In block 804, the threaded agent 150 or 152 is quiesced and then restarted as a forked agent. In block 806, since a forked agent 190 is being switched to a threaded agent, the forked agent 190 is terminated and restarted as a threaded agent. In particular, the agent API includes a quiesce method that may be invoked to tell a threaded agent 150 or 152 to temporarily stop processing and prepare data for restarting. When the threaded agent 150 or 152 is restarted as a forked agent, the forked agent uses the prepared data to restart at a point at which processing had been quiesced.
In certain implementations, when a forked agent 190 is to be switched to a threaded agent, if the forked agent 190 is part of a group of agents, only the forked agent 190 is switched. In certain implementations, when a forked agent 190 is to be switched to a threaded agent, if the forked agent 190 is part of a group of agents, all of the forked agents in the group are switched to threaded agents.
In certain implementations, the agents are Common Information Model (CIM) providers in a CIM environment. CIM is a standard for an object-oriented model for managing information. The CIM standard is provided by the Distributed Management Task Force, Inc. (DMTF). For further information on the CIM standard, see “Specifications for CIM Operations over HTTP,” Version 1.1, May 2, 2002, from the DMTF, which is incorporated by reference herein in its entirety.
UNIX is a registered trademark of the Open Group.
The above described implementations for creating consistent copies may be implemented using standard programming and/or engineering techniques to produce software, firmware, hardware, or any combination thereof. The term “article of manufacture” as used herein refers to code or logic implemented in hardware logic (e.g., an integrated circuit chip, Programmable Gate Array (PGA), Application Specific Integrated Circuit (ASIC), etc.) or a computer readable medium (e.g., magnetic storage medium (e.g., hard disk drives, floppy disks, tape, etc.), optical storage (CD-ROMs, optical disks, etc.), volatile and non-volatile memory devices (e.g., EEPROMs, ROMs, PROMs, RAMs, DRAMs, SRAMs, firmware, programmable logic, etc.)). Code in the computer readable medium is accessed and executed by a processor. The code may further be accessible through a transmission media or from a file server over a network. In such cases, the article of manufacture in which the code is implemented may comprise a transmission media, such as a network transmission line, wireless transmission media, signals propagating through space, radio waves, infrared signals, etc. Of course, those skilled in the art will recognize that many modifications may be made to this configuration without departing from the scope of the present invention, and that the article of manufacture may comprise any information bearing medium known in the art.
In alternative implementations, the HTTP server 124 may be replaced with any socket interface.
In certain implementations, rather than the session managers 134, 136, and 138, other components, such as the agent proxies 142, 144, and 182 may determine which agent should process a request and/or whether the agent should be forked or threaded.
The logic of
The logic of
The foregoing description of the preferred implementations of the invention has been presented for the purposes of illustration and description. It is not intended to be exhaustive or to limit the invention to the precise form disclosed. Many modifications and variations are possible in light of the above teaching. It is intended that the scope of the invention be limited not by this detailed description, but rather by the claims appended hereto. The above specification, examples and data provide a complete description of the manufacture and use of the composition of the invention. Since many implementations of the invention can be made without departing from the spirit and scope of the invention, the invention resides in the claims hereinafter appended.
Number | Name | Date | Kind |
---|---|---|---|
2012527 | Batchelder | Aug 1935 | A |
2675228 | Baird et al. | Apr 1954 | A |
3571677 | Oeschger | Mar 1971 | A |
4138692 | Meeker | Feb 1979 | A |
4228219 | Hoy et al. | Oct 1980 | A |
4558395 | Yamada | Dec 1985 | A |
4665466 | Green | May 1987 | A |
4721996 | Tustaniwskyj | Jan 1988 | A |
4729424 | Mizuno | Mar 1988 | A |
4733331 | Chauvet | Mar 1988 | A |
4791983 | Nicol | Dec 1988 | A |
4809134 | Tustaniwskyj | Feb 1989 | A |
4870477 | Nakanishi | Sep 1989 | A |
4882654 | Nelson | Nov 1989 | A |
4977444 | Nakajima | Dec 1990 | A |
5144531 | Go | Sep 1992 | A |
5166863 | Shmunis | Nov 1992 | A |
5177667 | Graham | Jan 1993 | A |
5183104 | Novotny | Feb 1993 | A |
5282847 | Trescony et al. | Feb 1994 | A |
5305461 | Feigenbaum et al. | Apr 1994 | A |
5323847 | Koizumi | Jun 1994 | A |
5406807 | Ashiwake | Apr 1995 | A |
5465192 | Yoshikawa | Nov 1995 | A |
5504858 | Ellis et al. | Apr 1996 | A |
5535094 | Nelson | Jul 1996 | A |
5588119 | Vincent | Dec 1996 | A |
5659701 | Amit et al. | Aug 1997 | A |
5675473 | McDunn | Oct 1997 | A |
5701045 | Yokozawa | Dec 1997 | A |
5706668 | Hilpert | Jan 1998 | A |
5751933 | Dev | May 1998 | A |
5771388 | Mondrik et al. | Jun 1998 | A |
5912802 | Nelson | Jun 1999 | A |
5940269 | Ko | Aug 1999 | A |
5950011 | Albrecht | Sep 1999 | A |
5956750 | Yamamoto et al. | Sep 1999 | A |
6006251 | Toyouchi et al. | Dec 1999 | A |
6029742 | Burward-Hoy | Feb 2000 | A |
6031528 | Langfahl | Feb 2000 | A |
6050327 | Gates | Apr 2000 | A |
6058426 | Godwin et al. | May 2000 | A |
6067545 | Wolff | May 2000 | A |
6067559 | Allard et al. | May 2000 | A |
6101616 | Joubert | Aug 2000 | A |
6118776 | Berman | Sep 2000 | A |
6119118 | Kain et al. | Sep 2000 | A |
6125924 | Lin | Oct 2000 | A |
6130820 | Konstad | Oct 2000 | A |
6135200 | Okochi | Oct 2000 | A |
6137680 | Kodaira | Oct 2000 | A |
6144379 | Bertram | Nov 2000 | A |
6151031 | Atkins et al. | Nov 2000 | A |
6151331 | Wilson | Nov 2000 | A |
6167445 | Gai et al. | Dec 2000 | A |
6182142 | Win et al. | Jan 2001 | B1 |
6205796 | Chu | Mar 2001 | B1 |
6205803 | Scaringe | Mar 2001 | B1 |
6213194 | Chrysler | Apr 2001 | B1 |
6229538 | McIntyre | May 2001 | B1 |
6243747 | Lewis et al. | Jun 2001 | B1 |
6301605 | Napolitano et al. | Oct 2001 | B1 |
6313990 | Cheon | Nov 2001 | B1 |
6314555 | Ndumu et al. | Nov 2001 | B1 |
6381637 | Kamada | Apr 2002 | B1 |
6392667 | McKinnon et al. | May 2002 | B1 |
6396697 | Chen | May 2002 | B1 |
6408336 | Schneider et al. | Jun 2002 | B1 |
6425005 | Dugan et al. | Jul 2002 | B1 |
6425007 | Messinger | Jul 2002 | B1 |
6438984 | Novotny | Aug 2002 | B1 |
6463454 | Lumelsky et al. | Oct 2002 | B1 |
6477572 | Elderton | Nov 2002 | B1 |
6487643 | Khare et al. | Nov 2002 | B1 |
6496871 | Jagannathan et al. | Dec 2002 | B1 |
6505244 | Natarajan et al. | Jan 2003 | B1 |
6526768 | Wall | Mar 2003 | B1 |
6542360 | Koizumi | Apr 2003 | B1 |
6574708 | Hayter et al. | Jun 2003 | B1 |
6587343 | Novotny | Jul 2003 | B1 |
6604136 | Change et al. | Aug 2003 | B1 |
6604137 | Cowan | Aug 2003 | B1 |
6628304 | Mitchell | Sep 2003 | B1 |
6636239 | Arquie | Oct 2003 | B1 |
6658526 | Nguyen et al. | Dec 2003 | B1 |
6671776 | DeKoning | Dec 2003 | B1 |
6704778 | Horman | Mar 2004 | B1 |
6714936 | Nevin | Mar 2004 | B1 |
6760761 | Sciacca | Jul 2004 | B1 |
6772204 | Hansen | Aug 2004 | B1 |
6775700 | Cheng et al. | Aug 2004 | B1 |
6799208 | Sankaranarayan et al. | Sep 2004 | B1 |
6804773 | Grigsby et al. | Oct 2004 | B1 |
6823382 | Stone | Nov 2004 | B1 |
6834298 | Singer et al. | Dec 2004 | B1 |
6845395 | Blumenau et al. | Jan 2005 | B1 |
6871232 | Curie et al. | Mar 2005 | B1 |
6978291 | Vardi et al. | Dec 2005 | B1 |
20010043617 | McKinnon | Nov 2001 | A1 |
20010044907 | Yoshimoto et al. | Nov 2001 | A1 |
20020019864 | Mayer | Feb 2002 | A1 |
20020069377 | Mabuchi et al. | Jun 2002 | A1 |
20020083169 | Aki et al. | Jun 2002 | A1 |
20020113816 | Mitchell et al. | Aug 2002 | A1 |
20020133669 | Devireddy et al. | Sep 2002 | A1 |
20020143905 | Govindarajan et al. | Oct 2002 | A1 |
20020143920 | Dev et al. | Oct 2002 | A1 |
20020147801 | Gullotta et al. | Oct 2002 | A1 |
20020152305 | Jackson et al. | Oct 2002 | A1 |
20020162010 | Allen et al. | Oct 2002 | A1 |
20020169858 | Bellinger et al. | Nov 2002 | A1 |
20020178380 | Wolf et al. | Nov 2002 | A1 |
20020184300 | Schmelling et al. | Dec 2002 | A1 |
20020188584 | Ghannam | Dec 2002 | A1 |
20020194407 | Kim | Dec 2002 | A1 |
20030028624 | Hasan et al. | Feb 2003 | A1 |
20030055972 | Fuller et al. | Mar 2003 | A1 |
20030074599 | Golasky et al. | Apr 2003 | A1 |
20030091037 | Latif et al. | May 2003 | A1 |
20030093501 | Carlson et al. | May 2003 | A1 |
20030169289 | Holt | Sep 2003 | A1 |
20030184580 | Kodosky et al. | Oct 2003 | A1 |
20040024573 | Allen | Feb 2004 | A1 |
Number | Date | Country |
---|---|---|
0 623 876 | Nov 1994 | EP |
0 773 649 | May 1997 | EP |
1 111 840 | Jun 2001 | EP |
2 278 468 | Nov 1994 | GB |
2 344 963 | Jun 2000 | GB |
2 354 611 | Mar 2001 | GB |
WO9842102 | Sep 1998 | WO |
WO0029954 | May 2000 | WO |
WO0072183 | Nov 2000 | WO |
WO0130007 | Apr 2001 | WO |
WO0225870 | Mar 2002 | WO |
WO02089418 | Nov 2002 | WO |
WO03014911 | Feb 2003 | WO |
Number | Date | Country | |
---|---|---|---|
20040216126 A1 | Oct 2004 | US |