Duty Cycle
ClusteredServiceAgent.doWork()¶
All the Clustered Service is driven by the ClusteredServiceAgent's duty cycle, which is the
doWork()
method. Once the ClusteredServiceAgent has started, doWork()
is called on it repeatedly. At a high level, the duty
cycle performs the following:
- updates the Clustered Service DutyCycleStallTracker, which tracks stalls in the Cluster container max cycle time and Cluster container work cycle time exceeded count Counters
- the duty cycle performs 'slow tick work' every 1 ms
- if the Aeron Client's Conductor is driven by an AgentInvoker, it invokes it
- it checks various termination conditions
- it updates the clustered service mark file if a 1-second deadline has passed since the last update
- it polls the ServiceAdapter, reading and processing any Service messages from the Consensus Module
- if the BoundedLogAdapter is connected to the Log (it has an Image logbuffer)
- it polls the Log for Log messages up to the commit-pos Counter, passing any new messages into the ClusteredService
- it calls
doBackgroundWork()
on the ClusteredService