Agent Lifecycle

  1. Agent Startup:
    • Connects to Master Repository: When the agent starts, it first connects to the Master Repository to establish communication and synchronization.
  2. Connects to Work Repositories:
    • Through the master repository, the agent connects to any work repositories attached to it. Upon startup, the agent performs several key tasks:
      • Execute Outstanding Tasks: Executes any pending tasks that need to be completed in the work repositories upon the agent's startup.
      • Clean Stale Sessions: Cleans up stale sessions in each work repository. These are sessions that remained in a running state due to a crash (either of the agent or the repository).
      • Retrieve Scheduled Scenarios: The agent retrieves its list of scheduled scenarios from each work repository and computes the corresponding execution schedule.
  3. Listening on Port:
    • Agent Starts Listening: Once the startup tasks are completed, the agent begins listening on its designated port, waiting for execution requests.
  4. Handling Execution Requests:
    • Acknowledges Requests: When an execution request (such as a job to be executed) is received, the agent acknowledges the request and starts the session.
    • Launches Sessions: The agent launches the sessions according to the schedule, ensuring that each task is executed at the appropriate time.
  5. Administrative Requests:
    • Other Requests: The agent can process several other administrative requests:
      • Update its schedule (e.g., adding, modifying, or removing scheduled tasks).
      • Stop a session if needed.
      • Respond to a ping to confirm the agent's health and availability.
      • Clean Stale Sessions: Periodically, the agent checks for and cleans up any sessions that have been left in an invalid or stale state.
  6. Stop Agent Lifecycle:
    • Stop Signal: If a stop signal is issued (e.g., from the administrator or an external system), the agent processes this request and terminates its lifecycle.

 

 

No comments:

Post a Comment