The following diagram depicts the interaction between the client and server
when retrieving cluster data.
When a client first asks the server for instances and tasks for a cluster (or on the first request after cluster state has expired), the server will:
- Create a
ClusterState
object withFetchStatus
=INITIAL
- Store it in the in-memory
ClusterStateCache
- Return
INITIAL
to client - Proceed to process the request in the background ("Background Processing" swimlane)
- Background: Populate the cached
ClusterState
object with cluster data - Background: Update the
ClusterState
object'sFetchStatus
- Return current state to client
Client will poll the server until it finds INITIAL
or ERROR
state.
If the user clicks "Refresh Server Cache", the client will send a
forceRefresh=true
parameter on its first polling attempt. The server upon
seeing forceRefresh=true
will invalidate the cached ClusterState
entry
and begin the above process again.
Fetch Status State | Description |
---|---|
INITIAL | State object created |
FETCHING | Server has begun fetching cluster data asynchronously |
FETCHED | Server has completed fetching cluster data |
ERROR | Server encountered an error fetching cluster data |
When a ClusterState object is added to the in-memory cache,
it is set to expire within clusterStateCacheTtl
milliseconds.
The default being 30mins. After that time, the cache object is
set to null
and won't be set to INITIAL
until necessitated by
a subsequent client request.