mirror of
https://github.com/kiddin9/op-packages.git
synced 2026-10-30 07:45:13 +08:00
⛅ Sync 2026-09-28 17:06:29
This commit is contained in:
1 parent
86e1d0663a
commit
8e6f80e195
138 files changed
+975
-606
No files matched your search
@@ -12,9 +12,11 @@
|
||||
# Lock: sibling ${FWLIVE_ADAPTIVE_LOCK_FILE:-$STATE.lock} — never the JSON
|
||||
# inode (atomic mv replaces that inode; locking it would not serialize writers).
|
||||
# Lock covers only short update — never held across ubus/filter work.
|
||||
# Hot-path budget: ≤1 flock exec per update (release by closing the fd when the
|
||||
# subshell exits — no flock -u). /proc/uptime + state I/O via shell builtins/
|
||||
# redirects (no sed/cat/jsonfilter on the adaptive path). Fail-open on missing
|
||||
# Hot-path budget: ≤1 flock exec and 2 find execs per successful update
|
||||
# (directory safety checked before lock open and before the state write).
|
||||
# Release flock by closing the fd when the subshell exits (no flock -u).
|
||||
# /proc/uptime + state I/O use shell builtins/redirects (no sed/cat/jsonfilter
|
||||
# on the adaptive path). Fail-open on missing
|
||||
# flock, lock busy, or corrupt state. Fail-closed if the lock file cannot be
|
||||
# opened (skip the write; do not record unlocked). Lock-busy ⇒ unlocked
|
||||
# last-writer-wins is acceptable (state stays one valid JSON line; ordering
|
||||
|
||||
@@ -253,7 +253,7 @@ run_with_timeout() {
|
||||
fi
|
||||
done
|
||||
[ "$peer" = 1 ] || break
|
||||
"$busybox_bin" sleep 0.1
|
||||
"$busybox_bin" sleep 0.1 || "$busybox_bin" sleep 1 || exit 125
|
||||
done
|
||||
exit "$status"
|
||||
' fwlive-timeout "$FWLIVE_TIMEOUT_BIN" "$secs" \
|
||||
@@ -1220,6 +1220,7 @@ run_selftest() {
|
||||
got=$(printf '%s\n' "log prefix \"fwlive${_tab}tabbed\" comment \"!fw4: TabRule\"" | nft_dump_fields)
|
||||
OUT=''
|
||||
_map_keys=0
|
||||
_map_lines=0
|
||||
_map_overflow=''
|
||||
map_from_nft_stream all <<EOF
|
||||
$got
|
||||
@@ -1236,6 +1237,7 @@ EOF
|
||||
fi
|
||||
OUT=''
|
||||
_map_keys=0
|
||||
_map_lines=0
|
||||
_map_overflow=''
|
||||
map_from_nft_stream all <<EOF
|
||||
$got
|
||||
|
||||
Reference in new issue
Block a user