ConfigKeys left unused while their read site still does raw _configDao.getConfiguration() map lookups
Maintainer antworten meist innerhalb von 1 Tag
@DaanHoogland arbeitet bereits daran.
Seit 18.8.2026.
Bewertung
Dieses Issue wurde noch nicht bewertet.
Beschreibung
Found while writing ConfigKey-wiring unit tests for PR #13884 (issue #10752, phase out enum Config).
ManagementServerImpl.configure() (server/src/main/java/com/cloud/server/ManagementServerImpl.java:1141-1148) still reads two settings through the raw configuration map instead of their migrated ConfigKeys:
_configs = _configDao.getConfiguration();
final String value = _configs.get("event.purge.interval");
final int cleanup = NumbersUtil.parseInt(value, 60 * 60 * 24); // 1 day.
_purgeDelay = NumbersUtil.parseInt(_configs.get("event.purge.delay"), 0);
ManagementServer.EventPurgeInterval and ManagementServer.EventPurgeDelay both already exist on the interface — three lines below, AlertPurgeInterval/AlertPurgeDelay (the exact same purge-scheduling pattern) were correctly migrated to .value() in the same method, so these two are a clear miss rather than a deliberate choice.
This is a different variant from the pattern in #13893 (redundant/diverging hardcoded defaults passed to parseInt/parseLong around an already-migrated .value() call): here the read site was never migrated to .value() (or even to _configDao.getValue(key.key())) at all — it still goes through a raw Map<String,String> _configs = _configDao.getConfiguration() lookup by literal key string, bypassing the ConfigKey entirely. The earlier .value()-replacement sweep only searched for the _configDao.getValue(key.key()) call shape, so it structurally couldn't catch this one.
It also happens to carry the same kind of default-mismatch risk as #13893: EventPurgeDelay's registered default is "15", but the hardcoded fallback here is 0, and 0 is the sentinel that disables purging (if (_purgeDelay != 0) { schedule... }). So migrating this site isn't a pure no-op — it needs the same default-reconciliation judgment call as the #13893 cases before switching it over.
Only these two sites were found in ManagementServerImpl; this was spotted incidentally while scoping unit tests for the .value() migration, not through an exhaustive sweep — worth a repo-wide grep for other _configDao.getConfiguration()-backed raw map reads (_configs.get("literal.key")) that have a matching ConfigKey sitting unused nearby.
- Vorherrschende Sprache
- Java
- Sterne
- 3.1k
- Forks
- 1.4k
- Ø Merge
- 6 T. 8 Std.
- Gemergte PRs (30 T.)
- 20
Entwicklungsumgebung
- Kein Dockerfile und keine Docker-Compose-Datei
- Hat eine Pull-Request-Vorlage
- Beitragsleitfaden lesen
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 apache/cloudstack
-
bug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 80/100
apache/cloudstack#14248 ·
Maintainer antworten meist innerhalb von 1 Tag
-
bug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 68/100
apache/cloudstack#14244 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
-
bug
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 90/100
apache/cloudstack#14222 ·
Maintainer antworten meist innerhalb von 1 Tag
-
create-kubernetes-binaries-iso.sh builds the ISO without setting a volume ID on EL8 based os'sOffenbug component:kubernetes
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 88/100
apache/cloudstack#14180 ·
Maintainer antworten meist innerhalb von 1 Tag
-
bug component:projects component:UI
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 88/100
apache/cloudstack#14070 · 5 Kommentare ·
Maintainer antworten meist innerhalb von 1 Tag
Alle Issues in apache/cloudstack
Ähnliche Issues
-
bug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
liquid-java/liquidjava#321 ·
Maintainer antworten meist innerhalb von 2 Tagen
-
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 88/100
Maintainer antworten meist innerhalb von 1 Tag
-
rename config parameterOffen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 82/100
OpenConext/OpenConext-access#1015 ·
Maintainer antworten meist innerhalb von 1 Tag
-
68000: FDBcc branch target is 2 bytes too low (uses inst_start+2 instead of the displacement word)Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 82/100
NationalSecurityAgency/ghidra#9702 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 85/100
apache/rocketmq-dashboard#5358 ·
Maintainer antworten meist innerhalb von 3 Tagen