Skip to content

OPNsense's reload in a recovery in place, under a time limit of 300 s, the second XGS 3300, 2026-11-30

On 2026-11-02 the second XGS 3300's recovery in place stopped in OPNsense's reload of its interfaces (rc.reload_all), in Unbound's reconfiguration, and only fastpath.py's cap of 900 s ended it: the appliance was restarted, and nothing in the recovery's lines said where the reload had waited (984). Since this change recover.sh runs that reload under a limit of its own, 300 s. A reload still running then is ended, and the recovery goes on with a warning that says the step the reload waited in (from the system log), the processes it left waiting, and for a lock file they wait on, the processes holding it. A reload that ends in time says none of it.

What was measured: the second XGS 3300, vendor version 22, OPNsense 26.7.9_1, kernel FreeBSD 15.1-RELEASE-p6, with os-xgs-npu 0.2.0-alpha.1.3 replaced by the branch, installed as an owner installs it (the tree piped to the box, then install/install.sh): only recover.sh changed of the 197 files the installer writes, octep.ko stayed the same module and was not reloaded, and install/verify.sh gave 10 passed, 0 failed, 1 to look at, as before the install. Unbound on and answering, an IPsec tunnel to the XGS 136 up, the setting that restarts the appliance after a failed recovery turned off for the runs so that every end could be read. Each run stopped the fast path on purpose (dev.octep.0.quiesce) and let recover.sh run as fastpath.py runs it, in a session of its own, while the PC looked every 10 s at the reload's processes, at fstat of Unbound's start lock and at the waiting processes' kernel stacks. The release was put back after each lab, the configuration restored, and verify.sh gave 10 passed, 0 failed, 1 to look at again.

Measured

2026-11-30, 01:52 UTC: Unbound's start lock (/tmp/unbound_start.lock) held by a process that does not let go (flock -o /tmp/unbound_start.lock /bin/sleep 1207), then the fast path stopped the coprocessor booted again and waited for the host after 177 s, the driver up after 273 s, and the reload began at 01:56:35. It waited in Unbound's stop: flock -E 0 -o /tmp/unbound_start.lock true, in lockf (kernel stack lf_advlockasync, lf_advlock, sys_flock), its parent the reload's php. Ended at 300 s exactly (02:01:35)
what recover.sh said then, in this order the warning, with no advice to restart anything by hand; the last step it began, as the system log has it: plugins_configure local (execute task : unbound_configure_do(1)); left running by it: the waiting flock, with its process id and lockf; /tmp/unbound_start.lock is held by the holder's process id and command line, and that a restart of Unbound waits until it ends as well; the reload's last 5 lines; and what a reload ended there leaves undone and that the console's "Reload all services" does it. Then the fast path answers again: taken up in place in 573 s (its reload of the interfaces ended at 300 s; see the warning above)
the same run, checked exit 0; no restart (the boot time unchanged); the process ids it named were those ps and fstat showed; no temporary file of its left; the management link back at 02:01:35 and the coprocessor answering on it at 02:01:49; the switch's ports given jumbo frames again at 02:01:48; the tunnel to the XGS 136 up (1 IKE, 1 child association), the 7 front ports with an address as before, configd answering at once
the holder ended at 02:06:52 its waiter went with it within the second; Unbound answered, and no flock or reload was left
the console's "Reload all services" (/usr/local/etc/rc.reload_all), then exit 0 in 39 s. It did what the warning says was left: the web GUI's step, IPsec, OpenVPN and WireGuard, the routes, and the plugins' services stopped and started again. Unbound restarted, the firewall's rules back to 129 (131 after the ended reload), the tunnel up, the web GUI answering
2026-11-30, 02:08 UTC: the same with no lock held the reload began at 02:13:20, its logged steps ran in 9 s, and taken up in place in 313 s, with no bracket. None of the new lines: 0 matches for the warning, the last step it began, left running by it, is held by, not done after that step, see the warning above and rc.reload_all:. Exit 0, no restart, the management link, the switch's jumbo frames and the tunnel back
2026-11-29, 21:59 UTC: the first form of the change, the same held lock the reload waited in the same step and was ended at 300 s (22:03:58 to 22:08:58), taken up in place in 576 s, no restart. But its lines said too little: the last 5 lines it printed were steps it had finished (gateway monitor, firewall, Dnsmasq, NTP, OpenSSH), and it advised restarting Unbound by hand - which, given 30 s while the holder lived, waited behind the same lock in lockf. That is what the second form, measured above, changed
2026-11-29, 22:15 and 22:22 UTC: the stall of 2026-11-02 sought with no lock held - configctl unbound restart twice during the reload, 5 and 7 s in, then 1 and 3 s in with the fast path stopped again 20 s in not reproduced in 2 tries: the reloads ended in about 36 s and 41 to 51 s. The first said taken up in place in 311 s; the second ended did not answer within 120 s (exit 1), the second stop having taken the coprocessor as gone again; a recovery by hand after it said taken up in place in 316 s. None of them said the warning

The reload held in Unbound's stop, ended at 300 s: recover.sh names the step it began (unbound_configure_do), the flock waiting in lockf, the process holding Unbound's start lock, the reload's last lines and what it left undone, then taken up in place in 573 s - and fstat of the lock with the waiter's kernel stack

A recovery with no lock held: the reload ends in time and recover.sh says none of the new lines - taken up in place in 313 s

What it does not mean

  • What held Unbound's start lock on 2026-11-02 is still not known. The stall was made here by holding the lock on purpose; in two tries with Unbound restarted during the reload it did not happen on its own. If it happens in service, the recovery's lines now name the holder.
  • Unbound's stop waits for its start lock with no limit (unbound_service_stop(), OPNsense's unbound.inc); that is OPNsense's code, not this plugin's. The limit only keeps the recovery from waiting with it.
  • A reload ended at the limit leaves its later steps undone until "Reload all services" or the next reload. In the run above nothing was seen missing (the tunnel, the routes and the addresses as before), because OPNsense had already run the WAN's VPN step when its address came back; another configuration may miss more.
  • Not run on the XGS 136: its tunnel to the second XGS 3300 stays up in the lab, and with an outbound IPsec association on its engine the ARMADA driver stays loaded, so its recovery restarts the appliance rather than taking it up in place (1230). The limit's code is the same on both families, and tools/test-recover.py runs it for both.
  • Not run under vendor versions 21 and 23, on the first XGS 3300, or on an OPNsense without an XGS board, where recover.sh does not run.
  • 300 s is not tuned: the reloads that ended in time took 36 to 51 s here, and one that waits for a lock does not end on its own however long it is given.

Discussion

The discussion of this page is held in the project's GitHub Discussions. Showing it here loads giscus from giscus.app and GitHub, and writing in it needs a GitHub account - what that means.