Repository navigation
fix(lane): bring a lane fully back when its RPM returns after an outage - #56
Merged
4 commits merged intoNov 24, 2026
Merged
4 commits merged into
4 commits merged into
Conversation
On the 3.11 scratch stack a Rapiscan simulator that was down for 4 minutes never came back: the lane configures every RPM driver with 10 retries 10 s apart, RobustConnection then throws "Maximum number of connection attempts reached", and the module stays STOPPED with an error (or LOADED with an error when the device was down at boot). Nothing retried from there, so any outage longer than about two minutes (switch reboot, cable pull) took the lane's radiation data down until someone restarted the module by hand. RpmRecoverySupervisor runs per lane while the lane is started. Every 15 s it looks at the RPM member and, only if it is auto-start, carries an error, and sits in LOADED or STOPPED, re-runs init (if needed) and start. Failed rounds back off 30 s / 60 s / 2 min / 5 min. A member an operator stopped on purpose has no error and is left alone. The lane's existing STARTED handler re-wires occupancy once the member is up. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The RPM recovery supervisor restarts a failed RPM member, and each attempt holds it in STARTING for the driver's whole connection loop (about 100 s). Application readiness reads a nested STARTING member as a start still in flight, so one detector that stayed unreachable kept the ready marker down and the whole node unhealthy; oscar.sh start/restart then failed. The supervisor now reports when it is recovering, LaneSystem exposes that through IAutoStartDispatchStatus.isMemberUnderRecovery, and readiness treats such a member as settled once the lane's own auto-start dispatch is complete. Found at the live cutover: the site's RS-350 simulator was down. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
SensorSystem starts a lane's auto-start members once, right after the lane starts, and waits at
most 10 s for each to initialize. The RS-350 occupancy process (and the Kromek D5 one on mobile
detector lanes) is initialized only when its detector reaches STARTED, so a detector that is
offline at boot leaves it un-started ("Cannot start subsystem ... - Occupancy"). When the
detector comes up later (RpmRecoverySupervisor or an operator restart), LaneSystem initializes
the process again, which also resets a running process to INITIALIZED, but nothing starts it.
The lane then records no occupancies for that detector and application readiness stays
withdrawn, so the container reports unhealthy.
Seen in the field: a walker lane booted while its RS-350 was unreachable; 50 min later the
supervisor recovered the detector, the process stayed INITIALIZED for 100 min until a restart,
and the node was unhealthy for the whole time.
After that init, OccupancyProcessStarter now starts the process on the lane's executor, but only
once the lane's own auto-start pass is over (autoStartDispatchComplete), the process is
auto-start, and it is still INITIALIZED when the task runs.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…tarts late
LaneSystem creates its occupancy helpers in afterStart, each bound to the occupancy producer:
WebIdHelper waits 5 s for it to reach STARTED, OcrHelper 10 s, and both give up at once when it
is in error (AbstractModule.waitForState rethrows the module's error), which is where a detector
that was offline at boot leaves an RPM. EmlAutoAdjudicationHelper silently skips subscribing
without a producer UID. None of them retried, so after RpmRecoverySupervisor (or an operator)
brought the detector back, an RS-350 lane ran without WebID analysis ("Failed to create
WebId/Occupancy subscription") and a portal lane without vehicle OCR ("OCR inactive on lane")
until the next node restart.
Each helper now reports whether it is attached (or still waiting), the helper construction moved
out of afterStart into attach* methods guarded by one lock, and when the occupancy producer
reaches STARTED after the lane's auto-start pass, LaneSystem re-creates only the helpers that
gave up, on the lane executor. EML is re-attached on portal lanes only: on RS-350/D5 lanes its
producer (the occupancy process) has no UID when the helper is created, so it never subscribes
there today, and re-attaching would newly enable it. A normal boot is unchanged: helpers that attached or are still
waiting are left alone.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
7a7324a
Collaborator
|
Merged into Architectural Review & Unification with
|
This was referenced Nov 24, 2026
mjd948
added a commit
to mjd948/osh-oakridge-modules
that referenced
this pull request
Nov 25, 2026
ORNL squash-merged our session, RS-350, lane-recovery and WebID fixes (ORNL#54, ORNL#55, ORNL#56, ORNL#60) plus their own follow-ups (ORNL#61), so their side was taken in every conflict except two: - LaneSystem keeps our Mobile Detector design (the occupancy process member is reused across restarts and covers D5 walkers); ORNL's "detector already started" start-up is kept for a newly created process, for RS-350 and D5 alike. EML re-attach follows ORNL. - Rs350OccupancyProcessModule takes ORNL's version: its event-bus restart handler (where our orphan guard lived) is gone upstream. 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.
Problem
LaneSystemconfigures every RPM driver (Rapiscan, Aspect, RS-350) withreconnectAttempts = 10, 10 s apart. After that,RobustConnectionthrows "Maximum number ofconnection attempts reached", and the RPM module stays STOPPED with an error, or LOADED with an
error if the device was down at boot. Nothing retries, so any outage longer than about two minutes
(a switch reboot, a cable pull) takes the lane's radiation data down until someone restarts the
module by hand. Defect issue #51.
Reproduced on a 3.11 Compose stack with a Rapiscan simulator down for 4 minutes: the RPM module
stayed in ERROR for good.
Fix (four commits)
RpmRecoverySupervisor, one per lane while the lane is started.error, and is LOADED or STOPPED: it re-runs init (if needed) and start.
Readiness. Each recovery attempt holds the member in STARTING for the driver's connection
loop (about 100 s), and
ApplicationReadinessread that as a start still in flight. So oneunreachable detector kept the ready marker down and the container unhealthy, and
oscar.sh start/restartfailed. The supervisor now reports when it is recovering(
IAutoStartDispatchStatus.isMemberUnderRecovery). Readiness treats such a member as settledonce the lane's own auto-start dispatch is complete.
Start the RS-350 occupancy process when its detector comes up late. Found in the field
today, and present in ORNL's code path too:
SensorSystemgives each auto-start member 10 s to initialize. The RS-350 occupancy processinitializes only once its detector is STARTED, so a detector that is down at boot leaves it
un-started.
LaneSystem's STARTED handler re-runsoccupancyProducer.init(). That also resets a runningprocess to INITIALIZED, because
AbstractModule.canInit()always proceeds, and nothingstarts it.
lasted 100 minutes, until a restart.
OccupancyProcessStarternow starts the process on the lane executor, only after the lane'sauto-start pass, when the process is auto-start and still INITIALIZED.
Re-attach the lane's WebID, OCR and EML helpers when a detector comes up late.
LaneSystemcreates these helpers inafterStart, bound to the occupancy producer.WebIdHelperwaits 5 s andOcrHelper10 s for it to reach STARTED, and both give up atonce when it is in error, because
waitForStaterethrows the module's error. That is where adetector offline at boot leaves its RPM.
("Failed to create WebId/Occupancy subscription"), and a portal lane without vehicle OCR
("OCR inactive on lane"), until the next node restart.
reaches STARTED after the lane's auto-start pass, the lane re-creates only the helpers that
gave up, on the lane executor.
helper is created, so it never subscribes there today. Whether it should is your call.
Compatibility
operator-stopped RPM is untouched.
Tests
RpmRecoverySupervisorTest(7),ApplicationReadinessTest(new case) andOccupancyProcessStarterTest(10). Commit 4 has no unit test of its own: the helpers need arunning hub. It was verified on a Compose stack instead (see below).
ORNL/oscarcheckout with this branch overlaid):node tools/validate-release-metadata.jspasses, and:sensorhub-system-lane:testwith:sensorhub-service-oscar:testpasses 341, 18 skipped, with 0 failures.Field evidence
with the RPM unreachable for 5 minutes left the node healthy, and the RPM started 3 s after the
simulator came up.
minutes. Commit 3 is the fix for what that run showed: the occupancy process was never started.
Commit 3 was then checked on a Compose stack with the RS-350 simulator off at boot and back
later. Without it, the occupancy process stayed INITIALIZED and readiness stayed down; with it,
the process started 1 ms after its init and readiness came back. It has been running on the
24/7 node since.
later. Without it, the RS-350 lane logged "Failed to create WebId/Occupancy subscription", the
portal lane logged "OCR inactive", and neither recovered. With it, both re-attached
(
Re-attached WebID …,Re-attached vehicle OCR …) within milliseconds of their detectorsstarting. A normal boot re-attaches nothing. Running on the 24/7 node since then.
Known, not addressed here
When an RS-350's RPM restarts while its occupancy process is running,
LaneSystemre-runsinit()on that process.
Rs350OccupancyProcessModule.initChain()then builds a new chain whoseRs350OutputToOccupancysubscribes again, and the old chain's subscriptions are cancelled only indispose(). That may duplicate subscriptions. This is suspected from reading the code and has notbeen reproduced. Commit 3 makes sure the process is started again, but not that the old chain is
disposed.
Merge note
#57 (Mobile Detector System) touches two spots that this PR also changes in
LaneSystem.afterStart: the lines next tostartRpmRecovery(), and the old WebID-helper line,where #57 adds a null check that commit 4 already contains. Whichever of the two merges second
needs a small rebase, which we'll do.
🤖 Generated with Claude Code