Skip to content

Add support for coordinated shutdown #226

@erlingrj

Description

@erlingrj

My proposal is a gossip based algorithm, like the coordination of the startup tag, only we require 2x number of steps before we are sure that all federates have agreed on a stop tag. Also it requires the possibility to insert a barrier on the event queue that inhibits advancing beyond a certain tag.

When a federate calls env->request_shutdown_at(env, tag) he will send a shutdown_request message to all his neighbors with a proposed tag. He will also but a barrier with this tag on his event queue. He will then continue executing waiting for the reception of shutdown_requests from all his neighbors. When he has received from all his neighbors we have completed 1 step. He takes the maximum of all proposed tags, possibly updates the barrier on the event queue. Then he starts step 2, where again the current proposed shutdown tag is sent and again we wait for the reception of a proposed shutdown tag from all neighbors. This continues for a number of steps = longest_path * 2 where longest_path is the longest path of the federation when viewed as an undirected graph.

For federates not initiating the shutdown, the algorithm is more or less the same, only, they initiate it upon receiving the first shutdown request.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions