Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

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 --/  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: The idea of the unique ID is that we guarantee that the ack matches our ping, maybe overkill?
        RSM  ->   RSM:   CancelTimer(app_server_id)
      else unique_id mismatch
        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
      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
    end
    note across
        App Manager should process the error accordingly, e.g. display an error, restart the app etc.
        Rialto will take no further action until App Manager requests the moving app to the not running state
    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
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


@enduml