Stale broker_<key>.d directories accumulate in .ECCE: the reaper's rm -f cannot remove them (Windows)
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 3/5
- Geschätzter Aufwand
- 1-2 Tage
- Anfängerfreundlichkeit
- 73/100
Rechercherichtung
Start with packaging/gateway/ecce-gateway-reap around lines 152–157 and read how live_broker is built in ecce-session-lib.sh around lines 54–58; compare those paths with the directory created by packaging/windows/ecce-broker-win. Check the reaper’s callers in ecce-gateway-start and the wrappers’ EXIT trap. Done when reaping preserves both paths for a live session and removes an old inactive .d directory without rm errors.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
Observed: repeated test runs on a Windows test machine leave broker_* entries behind
in the user's .ECCE state directory; nothing removes them and they accumulate across
runs.
Mechanism, from the code. On Windows the session broker is started by
packaging/windows/ecce-broker-win, which creates two things under
$ECCE_REALUSERHOME/.ECCE (ecce-broker-win:26-30):
BROKERFILE="$(ecce_broker_file)" # .../broker_<host>_<id> (a file)
KEY="$(ecce_session_key)"
DIR="$STATEDIR/broker_$KEY.d" # .../broker_<host>_<id>.d (a DIRECTORY)
PIDFILE="$DIR/mosquitto.pid"
Both are removed by stop() (ecce-broker-win:36-47, rm -rf "$DIR" "$BROKERFILE"),
which runs from ecce-broker-win stop or from the watch loop once the session's
windows are gone. A run that is killed, crashes, or ends without those paths running
leaves both behind.
The sweeper that is supposed to catch that is packaging/gateway/ecce-gateway-reap
(called from ecce-gateway-start:154-156 and from the wrappers' EXIT trap),
lines 152-157:
broker_prefix="$STATEDIR/broker_$(ecce_session_prefix)"
for f in "$broker_prefix"*; do
[ -e "$f" ] || continue
case " $live_broker " in *" $f "*) continue ;; esac
[ -n "$(find "$f" -mmin +1 2>/dev/null)" ] && rm -f "$f"
done
Two problems with the .d directory:
- The glob
broker_<host>_*matchesbroker_<host>_<id>.das well as the file, but
$live_brokeris built fromecce_broker_file(ecce-session-lib.sh:54-58), which
yields only the plainbroker_<host>_<id>path. The.ddirectory therefore never
matches the live list, not even for a session that is currently running. rm -fdoes not remove a directory. So the.ddirectory is attempted on every
reap, never removed, and the attempt writes arm: cannot remove ...: Is a directoryline to stderr -- including, per (1), for a live session's own directory.
Consequence. ~/.ECCE grows one broker_<host>_<id>.d directory per session that did
not stop cleanly, each holding a mosquitto.pid and a mosquitto log, for the life of
the account. On a machine used for repeated test runs this is unbounded. The stale
pid files are not read by anything outside their own .d, so there is no known
misbehaviour beyond the litter and the stderr noise, but the reaper is the component
that is meant to keep that directory bounded and for this entry it does not.
Suggested fix: include the .d directory in $live_broker (or exclude *.d from the
broker-file loop and sweep it in a loop of its own), and use rm -rf for it. Either
way, the reap must treat broker_<key> and broker_<key>.d as one unit so a live
session's directory is not a sweep candidate.
Not verified on a Windows machine: the sequence above is read from the scripts. It has
not been confirmed that the surviving entries seen after test runs are specifically the
.d directories rather than the broker files, nor measured how many a typical run
leaves.
- Vorherrschende Sprache
- C
- Sterne
- 10
- Forks
- 8
- Ø Merge
- 6 Std. 32 Min.
- Gemergte PRs (30 T.)
- 1
Entwicklungsumgebung
Dieses Projekt bietet weder Dev-Container noch Dockerfile noch Beitragsleitfaden – die Einrichtung liegt bei Ihnen. Beginnen Sie mit der README; die allgemeinen Schritte stehen in unserem Leitfaden für den ersten Beitrag.
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus FriendsofECCE/ECCE
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 68/100
FriendsofECCE/ECCE#1358 ·
-
bug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
FriendsofECCE/ECCE#1353 ·
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
FriendsofECCE/ECCE#1348 ·
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 76/100
FriendsofECCE/ECCE#1347 ·
-
bug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
FriendsofECCE/ECCE#1345 ·
Alle Issues in FriendsofECCE/ECCE
Ähnliche Issues
-
Installation fails from source: missing libintl.h on macOS, undeclared R_typeToChar() on R 4.6Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
vincentarelbundock/xtx#11 ·
-
Schwierigkeit 1/5 1-3 Stunden Anfängerfreundlichkeit 88/100
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 70/100
compiler-explorer/compiler-explorer#9738 ·
Maintainer antworten meist innerhalb von 2 Tagen
-
Schwierigkeit 1/5 1-3 Stunden Anfängerfreundlichkeit 88/100
Maintainer antworten meist innerhalb von 3 Tagen
-
[Android Auto] MU1017 (MHI2Q_JP_AUG22_P1017) cluster map works with a pinned profile — values insideOffen
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 92/100
kamgurgul/mib2q-carplay#74 ·