...
| PlantUML Macro |
|---|
@startuml
autonumber
participant ApplicationManager as AM
participant RialtoServerManager as RSM
participant RialtoApplicationSessionServer as RASS
participant RialtoClient as RC
== Periodic health check ==
loop Every [5] seconds
loop For each Application Session Server
RSM --/ RASS: ping(unique_id)
RSM -> RSM: SetTimer(healthcheck_frequency[4seconds] seconds, app_server_id)
RASS -> RASS: ping all internal threads
RASS --/ RC: ping(unique_id)
note left
This step and next step should be skipped if
Rialto Client hasn't established an IPC
connection - the app session server can ack
the ping immediately
end note
optalt Happy case, ping is acknowledged
RC --/ RASS: ack(unique_id)
RASS --/ RSM: ack(unique_id)
opt unique_id in ack matches unique id in ping
note across:RSM The idea-> of the uniqueRSM: ID is that we guarantee that the ack matches our ping, maybe overkill?
RSM -> RSM: CancelTimer(app_server_id)
else unique_id mismatch CancelTimer(app_server_id)
RSM -> RSM: Clear numOfFailedPings
end
else Timer fires (Ack not received in time)
optalt App session server is not assigned to an app yet (preloaded)
RSM -> RSM: Kill app session server & spawn a new one
else App session server is assigned to an app
RSM --/ AM: appFailed(application_id)
end
alt numOfFailedPings end
else Timer fires (Ack not received in time)
opt App session server is not assigned to an app yet (preloaded)
>= ServerManagerConfig::numOfFailedPingsBeforeRecovery
RSM -> RSM: Kill app session server & spawn a new one
else
App session server is assigned to an app
RSM -> RSM: --/Increment numOfFailedPings
AM: appFailed(application_id)end
end
end
note across
App Manager should process the error accordingly, e.g. display an error, restart the app etc.
Rialto will takestart norecovery further action until(restart AppRialtoApplicationSessionServer) Managerif requestsnumber theof movingfailed apppings toexceeds the not running statelimit(ServerManagerConfig::numOfFailedPingsBeforeRecovery).
end note
end
end
== Unexpected ack ==
RASS --/ RSM: ack(id)
note right: Ack received when no ping sent
opt App session server is not assigned to an app yet (preloaded)
RSM -> RSM: Kill app session server & spawn a new one
else App session server is assigned to an app
RSM --/ AM: appFailed(application_id)
end
== Unexpected socket disconnect ==
RASS --/ RSM: Socket connection lost
note right
Rialto Server Manager detects connection
to app session server lost
end note
optalt App session server is not assigned to an app yet (preloaded)
RSM -> RSM: Kill app session server & spawn a new one
else App session server is assigned to an app
RSM --/ AM: appFailed(application_id)
end
@enduml |