Skip to content

Run Log: two step logging for end of run, #414

Open
corrodis wants to merge 5 commits into
developfrom
sc/RunLog
Open

Run Log: two step logging for end of run, #414
corrodis wants to merge 5 commits into
developfrom
sc/RunLog

Conversation

@corrodis

@corrodis corrodis commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

Log two transitions and run ends: one when the stop starts to ensure the record is present, and a second to confirm the transition was successful.

@eflumerf eflumerf moved this from 📋 Triage to 👍 PR Created in art-daq Work Tracker Jun 9, 2026
writeRunInfoTransition(
RunInfoVInterface::RunTransitionType::HALT,
getLastLogEntry(RunControlStateMachine::HALT_TRANSITION_NAME));
writeRunInfoTransition(RunInfoVInterface::RunTransitionType::HALT_COMPLETE, "");

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this back to back? shouldnt ```
writeRunInfoTransition(
RunInfoVInterface::RunTransitionType::HALT,
getLastLogEntry(RunControlStateMachine::HALT_TRANSITION_NAME));

@rrivera747 rrivera747 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, but I dont understand the location of ```
writeRunInfoTransition(
RunInfoVInterface::RunTransitionType::HALT,
getLastLogEntry(RunControlStateMachine::HALT_TRANSITION_NAME));

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR enhances end-of-run logging by recording transitions in two steps (e.g., STOP and STOP_COMPLETE) so that a “stop started” record exists even if the transition later fails, and a “completed” record confirms success. It also adds support for writing a consolidated end-of-run summary to the logbook/ECL with an option to suppress the usual footer.

Changes:

  • Add STOP_COMPLETE and HALT_COMPLETE run transition types and use them to implement two-step end-of-run transition logging.
  • Write the STOP transition record at the start of transitionStopping() and write STOP_COMPLETE upon reaching stateConfigured().
  • Extend system log entry creation to pass a SkipFooter parameter to logbook supervisors and add end-of-run consolidated ECL summary generation.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 5 comments.

File Description
otsdaq/GatewaySupervisor/GatewaySupervisor.h Adds Run Info interface usage, new helper declaration, and new cached fields used for two-step logging and consolidated summaries.
otsdaq/GatewaySupervisor/GatewaySupervisor.cc Implements two-step STOP/HALT DB updates, raw comment caching, consolidated end-of-run ECL entry, and SkipFooter plumbing for logbook SOAP calls.
otsdaq/FiniteStateMachine/RunInfoVInterface.h Extends RunTransitionType with STOP_COMPLETE and HALT_COMPLETE to support transition completion markers.

Comment on lines +4964 to +4966
if(command == "Stop")
activeStateMachineWriteToEcl_ =
(CgiDataUtilities::postData(cgiIn, "writeToEcl") == "1");
Comment on lines 5099 to +5111
stateMachineTransitionUsername_ =
username; // set the username for this transition attempt (used for logging and logbook entry)

if(logEntry != "")
{
if(command == RunControlStateMachine::START_TRANSITION_NAME)
{
activeStateMachineRawStartComment_ = logEntry;
activeStateMachineRawStopComment_.clear();
}
else if(command == RunControlStateMachine::STOP_TRANSITION_NAME)
activeStateMachineRawStopComment_ = logEntry;

Comment on lines +5854 to 5856
// Write consolidated end-of-run summary to ECL if enabled via env var and user didn't opt out
bool doLogConsolidated = true; //default to logging consolidated run summary
try
Comment on lines +13380 to +13384
ConfigurationTree configLinkNode =
CorePropertySupervisorBase::theConfigurationManager_->getSupervisorTableNode(
supervisorContextUID_, supervisorApplicationUID_);
if(!configLinkNode.isDisconnected())
{
Comment on lines +47 to +49
START,
STOP_COMPLETE,
HALT_COMPLETE
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: 👍 PR Created

Development

Successfully merging this pull request may close these issues.

6 participants