Skip to content

Commit 2eff1aa

Browse files
Gupta, SuryaGupta, Surya
authored andcommitted
[CSTACKEX-204] Duration Changes
1 parent 9177186 commit 2eff1aa

3 files changed

Lines changed: 16 additions & 21 deletions

File tree

‎plugins/storage/volume/ontap/src/main/java/org/apache/cloudstack/storage/asup/OntapAsupManager.java‎

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -84,12 +84,11 @@ public class OntapAsupManager extends ManagerBase {
8484
private static final int ASUP_LOCK_TIMEOUT_SECONDS = 5;
8585

8686
/**
87-
* Fixed wakeup interval (ms) for {@link OntapAsupPollTask}. The task wakes on this cadence
88-
* and checks whether the configured push interval
89-
* ({@link OntapConfigurationManager#AsupIntervalSeconds})
90-
* has elapsed. This decouples the scheduler's fixed delay from the live config value,
91-
* so changes made in the CloudStack UI take effect without a management-server restart
92-
* (within one wakeup).
87+
* Fixed wakeup interval (ms) for {@link OntapAsupPollTask} (2 hours). The task wakes on
88+
* this cadence and checks whether the live configured push interval
89+
* ({@link OntapConfigurationManager#AsupIntervalSeconds}) has elapsed. UI edits of that
90+
* interval are applied immediately via the configuration-edit event; this delay is only
91+
* the background check so a due push is still noticed with no UI click.
9392
*/
9493
static final long ASUP_POLL_CHECK_INTERVAL_MS =
9594
TimeUnit.SECONDS.toMillis(OntapStorageConstants.ASUP_POLL_CHECK_INTERVAL_SECONDS);
@@ -307,11 +306,10 @@ protected void pushAsupForStoragePool(StoragePoolVO pool, Set<String> clustersHe
307306

308307
/**
309308
* Builds the heartbeat (event-id 0) description as a JSON object carrying the CloudStack and
310-
* ONTAP versions, the management-server operating system platform, the ONTAP cluster UUID,
311-
* and whether this plugin can snapshot a VM whose disks span multiple ONTAP pools.
309+
* ONTAP versions, the management-server operating system platform, and the ONTAP cluster UUID.
312310
* Example: {@code {"message":"CloudStack connected to ONTAP cluster","cloudstackVersion":
313311
* "4.23.0.0","platform":"Linux 5.15.0-91-generic (amd64)","ontapVersion":"9.17.1",
314-
* "clusterUuid":"...","managementServerCount":2,"snapshot_across_pool":true}}
312+
* "clusterUuid":"...","managementServerCount":2}}
315313
*/
316314
private String buildHeartbeatDescription(String cloudStackVersion, String ontapVersion,
317315
String clusterUuid) {

‎plugins/storage/volume/ontap/src/main/java/org/apache/cloudstack/storage/utils/OntapStorageConstants.java‎

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -165,21 +165,20 @@ public class OntapStorageConstants {
165165
public static final String ASUP_ENABLED_CONFIG_KEY = "ontap.asup.enabled";
166166
public static final String ASUP_ENABLED_DEFAULT = "true";
167167
public static final String ASUP_INTERVAL_CONFIG_KEY = "ontap.asup.interval";
168-
public static final int ASUP_MIN_INTERVAL_SECONDS = 60; // 1 minute
168+
public static final int ASUP_MIN_INTERVAL_SECONDS = 10800; // 3 hours
169169
public static final int ASUP_MAX_INTERVAL_SECONDS = 86400; // 24 hours
170170
public static final int ASUP_DEFAULT_INTERVAL_SECONDS = 43200; // 12 hours (twice a day)
171171

172-
/** Wakeup cadence of the ASUP poll task; also the upper bound on how long a config change takes to apply. */
173-
public static final int ASUP_POLL_CHECK_INTERVAL_SECONDS = 60; // 1 minute
174-
175172
/**
176-
* Global Settings shows a generic "takes effect within 30 seconds" toast for every dynamic
177-
* key (the config cache TTL). The ASUP keys are only re-read once per poll wakeup, so the
178-
* descriptions state the real bound.
173+
* Fixed wakeup cadence of {@code OntapAsupPollTask}. Must stay at or below
174+
* {@link #ASUP_MIN_INTERVAL_SECONDS} so a due push cannot be missed by more than this
175+
* window. Config edits are applied immediately via the configuration-edit event; this
176+
* delay is only the background check, not the ASUP push interval.
179177
*/
180-
private static final String ASUP_CONFIG_APPLY_NOTE = String.format(
181-
"Applied on the next ASUP poll check (within %d seconds); no management server restart required.",
182-
ASUP_POLL_CHECK_INTERVAL_SECONDS);
178+
public static final int ASUP_POLL_CHECK_INTERVAL_SECONDS = 7200; // 2 hours
179+
180+
private static final String ASUP_CONFIG_APPLY_NOTE =
181+
"Takes effect immediately; no management server restart required.";
183182

184183
public static final String ASUP_ENABLED_DESCRIPTION = "Enable periodic ASUP (AutoSupport) telemetry push from the "
185184
+ "CloudStack ONTAP plugin to the ONTAP cluster. Set to true to enable or false to disable. "

‎plugins/storage/volume/ontap/src/test/java/org/apache/cloudstack/storage/asup/OntapAsupManagerTest.java‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -158,8 +158,6 @@ void pushAsupForStoragePool_newCluster_sendsHeartbeatThenPoolMessage() {
158158
List<EmsApplicationLog> msgs = cap.getAllValues();
159159
assertEquals(OntapStorageConstants.ASUP_EVENT_ID_HEARTBEAT, msgs.get(0).getEventId());
160160
assertEquals(OntapStorageConstants.ASUP_EVENT_ID_STORAGE_POOL, msgs.get(1).getEventId());
161-
assertTrue(msgs.get(0).getEventDescription().contains("\"snapshot_across_pool\":true"),
162-
msgs.get(0).getEventDescription());
163161
assertTrue(msgs.get(0).getEventDescription().contains("\"managementServerCount\":0"),
164162
msgs.get(0).getEventDescription());
165163
}

0 commit comments

Comments
 (0)