Repository navigation
Multiple DFOs: ignore TriggerDecisions for completed triggers, and fix the DFO assignment loop - #527
Open
wesketchum wants to merge 23 commits into
Open
wesketchum wants to merge 23 commits into
wesketchum wants to merge 23 commits into
Conversation
…ompleted With multiple DFOs, each DFO sends its own TriggerDecision for every trigger to the DF app it selects. Extra TriggerDecisions that reach a DF app while the trigger is in progress are ignored, but nothing covers one that arrives after the trigger record has been written. - DataflowStatusModule_test/LateDuplicateDecision: TriggerDecision, TRB completion and token for trigger 5, then a second TriggerDecision for 5. The DF app forwards it to the TRB again, so the record is rebuilt (in dfo_protocol_test the second write fails with "Object already exists"). - DFOModule_test/LateDecisionAfterCompletion: trigger 7 is dispatched and reported completed, then a TriggerDecision for 7 arrives again. The DFO treats it as new and sends DataflowStatusRequests for it instead of ignoring it. Both tests fail on current develop; they document the behaviour to fix. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
With multiple DFOs, each DFO sends its own TriggerDecision for every trigger. One that reached a DF app after the trigger record was written was built again, and the second write failed with "Object already exists" (seen in dfo_protocol_test). - DataflowStatusModule: also treat a TriggerDecision for a trigger in recently_completed_triggers as a duplicate. - DFOModule: remember triggers that DF apps report as completed (bounded set, cleared at stop) and ignore TriggerDecisions that arrive for them later, instead of sending status requests and retrying assignment. - DFOModule: record the assignment before dispatching, and remove it if the send fails, so that a DataflowStatus arriving in between is not reported as an UnexpectedTriggerDecision by the DFO that sent it. Makes DataflowStatusModule_test/LateDuplicateDecision and DFOModule_test/LateDecisionAfterCompletion pass. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…g it CompletionDuringAssignment: the DF app reports the trigger completed while the DFO waits for a slot. The DFO must give up and go on to the next trigger. CompletionReportedByAnotherDFApp: one DF app reports the trigger completed and another still offers a slot. The DFO must not send it there. Co-Authored-By: Claude <noreply@anthropic.com>
…r a slot With several DFOs, another DFO's TriggerDecision can reach a DF app, and be completed, while this DFO is still in its assignment loop. The loop then retried until the end of the run, keeping the DFO busy and the trigger inhibited, or sent the trigger to a different DF app. The loop now checks, under the same lock as the slot search, whether the trigger is completed or already assigned, and stops if so. The wait for status replies ends early in that case. The timing counters are only updated for a TriggerDecision that was sent. Co-Authored-By: Claude <noreply@anthropic.com>
… wait Two changes to how a DFO picks the DF app for a TriggerDecision. When a DF app reports the trigger as building while the DFO is waiting for status replies, the DFO now sends its TriggerDecision to that DF app instead of dropping it. The DF app discards the duplicate. This keeps the number of TriggerDecisions each DFO sends as DFOProtocol_test expects (AllDFOsAgreeOnAssignments failed now and then with 5 != 6). A trigger reported as completed is still dropped. When the wait for status replies took more than three reply waits, for example because the DFO process was suspended, the replies are discarded and requested again. They may predate another DFO's assignment, and choosing from them sent one trigger to two DF apps in dfo_protocol_test (stopped-dfo). Co-Authored-By: Claude <noreply@anthropic.com>
The fake HSI data is sparse, so every HSI fragment in this test carries kRequestWindowAfterBuffer, with kIncomplete for kTiming triggers and kEmptyFragment for the others. These failed test_data_files in every run. Mask them by trigger type. Co-Authored-By: Claude <noreply@anthropic.com>
…opped In the stopped-dfo configuration the DFO is stopped for 5 s, the same as the DataflowStatus timeout. When it resumes it can find every DF app status stale before it has read the queued status messages. It then reports "No DataflowStatus received" and, for one pass, "could not be assigned", and recovers within milliseconds. Ignore those two messages in the log of the stopped DFO only. Co-Authored-By: Claude <noreply@anthropic.com>
The signal delay is counted from the launch of the run control session. At 25 s the signal landed on the conf, start or enable_triggers command in about half of the runs, so the command timed out in run control and the application was never stopped or killed while taking triggers. Move the signals to 40 s, about halfway through the time with triggers enabled. Co-Authored-By: Claude <noreply@anthropic.com>
With several DFOs it is normal for a DFO to see a trigger in a DF app's status before it has assigned that trigger itself: another DFO sent its TriggerDecision first. This was an INFO if the DF app was building the trigger and a WARNING if it was already writing it, and the WARNING failed the log check of dfo_protocol_test now and then. The text also said "with no TriggerDecision message received", which is not what is checked: the DFO may have the TriggerDecision and still be waiting for status replies. Say "before this DFO assigned it". Co-Authored-By: Claude <noreply@anthropic.com>
The signal delay is counted from the launch of the run control session, and boot takes between 25 s and 45 s depending on the load of the host. With 30 s of triggers no fixed delay is safe: at 40 s the stop still hit conf or enable_triggers in 4 of 6 runs on a busy host. Take triggers for 60 s and send the signals at 60 s, which leaves room for boot times between 25 s and 55 s. Co-Authored-By: Claude <noreply@anthropic.com>
With several DFOs a trigger must still be built by exactly one DF app. Compare the record names (trigger number and sequence number) across the output files of all DF apps and fail if one appears twice. Co-Authored-By: Claude <noreply@anthropic.com>
…e run Run control refuses the commands after the kill while the dead application is part of the session, so the killed-dfo configuration of dfo_protocol_test never stopped its run. This module kills dfo-02 during triggering, excludes it with the run control 'exclude' command, and then stops the run as usual. Co-Authored-By: Claude <noreply@anthropic.com>
… DFO Run control, the MLT and the DF apps report the DFO that was killed. Ignore those messages, each tied to the name of the killed application. Co-Authored-By: Claude <noreply@anthropic.com>
…r the exclude After 'exclude --target root-controller/df-controller/dfo-02' the root controller sent no further commands to df-controller, so the DF apps and the other DFOs were never stopped. Include a surviving application of the segment after the exclude. Co-Authored-By: Claude <noreply@anthropic.com>
The run cannot be stopped with the command list of this module once a DFO has been killed; dfo_protocol_killed_dfo_test.py excludes the killed DFO first. Co-Authored-By: Claude <noreply@anthropic.com>
…the run Same sequence as dfo_protocol_killed_dfo_test, for df-02. The two DF apps that survive share the triggers after the kill, so each is expected to write more than a third of the records. Co-Authored-By: Claude <noreply@anthropic.com>
…rning Co-Authored-By: Claude <noreply@anthropic.com>
…be sent A DF app that has died keeps a fresh status until dataflow_status_timeout_ms has passed. Until then every trigger cost a failed send and a full reply wait, so TriggerDecisions queued in the DFO. A failed TriggerDecision dispatch already marks the status stale; do the same for a failed status request, and do not wait for a reply to a request that was not sent. Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
… and the stale status error for a stopped DF app A non-timing trigger close to a timing one gets that trigger's HSI frame. A DF app stopped for as long as the status timeout may be reported as silent. Co-Authored-By: Claude <noreply@anthropic.com>
…meout A stop as long as the DataflowStatus timeout made stale-status errors a matter of timing, so they had to be allowed. With a shorter stop they are not expected and the allowances are removed. Co-Authored-By: Claude <noreply@anthropic.com>
…tatus timeout" The stop stays as long as the DataflowStatus timeout. Co-Authored-By: Claude <noreply@anthropic.com>
Open
6 of 13 tasks
… limit As receive_dataflow_status does. The function was already 75 lines on develop; splitting it is better done on its own. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
See issue #526 for some details.
With several DFOs, each DFO receives every TriggerDecision from the MLT and sends its own TriggerDecision for that trigger to the DF app it selects. This PR fixes three problems that come from that, all seen in
dfo_protocol_test:Object already exists(1 to 3 times per run, also in the nightly extended tests).recently_completed_triggersis also a duplicate.stopped-dforuns).Also in the DFO:
UnexpectedTriggerDecision) is now a debug message, "was reported as building/writing by X before this DFO assigned it". With several DFOs this is normal, and the check is on assignment, not receipt. TheUnexpectedTriggerDecisionissue is removed from the DFO (TRBModule has its own).Tests
DataflowStatusModule_test/LateDuplicateDecision, and inDFOModule_testLateDecisionAfterCompletion,CompletionDuringAssignment,CompletionReportedByAnotherDFAppandBuildingReportedDuringAssignment. The first four are also on[wketchum/test-late-duplicate-trigger-decisions](https://github.com/DUNE-DAQ/dfmodules/tree/wketchum/test-late-duplicate-trigger-decisions)without the fixes, where they fail.integtest/dfo_protocol_test.py(configurationsdefault,stopped-dfo,stopped-df):run_duration30 s to 60 s, signal at 60 s from the start of the session, 5 s stop.frag_bitmasks_by_TC_type); the fake HSI data is sparse, so these bits are expected.killed-dfoandkilled-dfconfigurations are moved to their own modules,dfo_protocol_killed_dfo_test.pyanddfo_protocol_killed_df_test.py. Once an application has been killed, run control refuses the transitions after it, so these modulesexcludethe dead application andincludea surviving one before stopping the run (excludealso flipsincludedon the parent controller). They test the dataflow with a dead application, not how run control copes with one.Dependencies
dfo_protocol_killed_dfo_test: without it, triggering stops after the kill. The other tests do not need it.tp-inputqueues) is optional. Without it, a readout application occasionally logs aFollyQueue::try_pusherror on its TP queue (about 4 in 45 runs), which failstest_log_files; this is not a dataflow problem.Open questions for reviewers (some details in #526):
DFOProtocol_test/AllDFOsAgreeOnAssignmentswould then need to allow.dfo_protocol_testmeant to equal the DataflowStatus timeout? With it, the resumed DFO finds every status stale and logs "could not be assigned" once.To test
Type of change
Testing checklist
dbt-build --unittest)pytest -s minimal_system_quick_test.py)dunedaq_integtest_bundle.sh)python -m pytest)pre-commit run --all-files)On daq.fnal.gov, NFD_DEV_261117_A9, with this branch (a1ea174), trigger#448 and daqsystemtest#364:
dfo_protocol_test: 6 of 6 runs pass every check. NoObject already exists, no record in two files. The one "could not be assigned" of a resumed DFO (question 5) appeared in 3 of the 6 runs.dfo_protocol_killed_dfo_testanddfo_protocol_killed_df_test: 1 of 1 each.Object already existsin 15 runs (against 3 in 10 without the fix); the retry loop gone in 10stopped-dforuns; in 20 morestopped-dforuns with f0c6c32's change, no trigger in two files.These are tens of runs, so the rare races are "not seen" rather than proven fixed.
Further checks
dbt-build --lint, and/or see https://dune-daq-sw.readthedocs.io/en/latest/packages/styleguide/)