Does the state model need to be modified a bit?
I just completed some code changes that were needed to allow us to gracefully stop the run from the Paused state. This is (and was) supported by the state model, but both the stop() and pause() methods in the EventBuilder and Aggregator applications were stopping the data-processing future, and the stop() method was not checking to see if the future was already stopped.
In addition, I needed to add an "is the run paused" check in EventBuilder::stop() to skip over the EventStore::endSubRun() call if it had recently been called by the pause() method. This later addition really seemed like something that should be handled by the state model, and when we get time, we should look into whether some of the functionality that we currently have in various places might be better located in other places (e.g. the exit function of the Running state).