ConfigKeys left unused while their read site still does raw _configDao.getConfiguration() map lookups
@DaanHoogland đang làm issue này rồi.
Từ ngày 18/8/2026.
Đánh giá
Issue này chưa được đánh giá.
Mô tả
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.
- Ngôn ngữ chính
- Java
- Star
- 3.1k
- Fork
- 1.4k
- Merge trung bình
- 6 ngày 20 giờ
- Pull request đã merge (30 ngày)
- 27
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của apache/cloudstack
-
bug
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 90/100
apache/cloudstack#14222 ·
-
create-kubernetes-binaries-iso.sh builds the ISO without setting a volume ID on EL8 based os's Đang mởbug component:kubernetes
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 88/100
apache/cloudstack#14180 ·
-
bug component:projects component:UI
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 88/100
apache/cloudstack#14070 · 5 bình luận ·
-
component:backup
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
apache/cloudstack#14013 ·
-
KVM agent fails to connect to Ceph RBD storage pool after upgrading Ceph client to Tentacle 20.2.4 Đang mởbug component:ceph
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
apache/cloudstack#13989 · 3 bình luận ·
Tất cả issue của apache/cloudstack
Issue tương tự
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
-
Two open-case totals on one screen: the Programs tile says 15,858 and the nav badge says 15,868 Đang mởbug frontend maui-pilot
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
objectionary/eo-graphs#74 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100