@go-to-k/cdkd 0.284.5 → 0.284.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -8727,6 +8727,15 @@ const defaultSleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
8727
8727
  * by `markNonRetryable`, which is rethrown ahead of either, so a deliberate
8728
8728
  * cdkd refusal cannot be turned back into a retry by a custom classifier
8729
8729
  * (issue #1778).
8730
+ *
8731
+ * REPORTING (issue #2018). A propagation sequence that gives up emits ONE
8732
+ * `warn` line naming how many retries it spent and how much of the budget it
8733
+ * slept, and the per-attempt `debug` lines carry the running total. Before
8734
+ * this, an exhausted retry rethrew the raw AWS error and nothing in a
8735
+ * default-verbosity run distinguished "cdkd retried for 47.75s" from "cdkd
8736
+ * has no retry for this at all" — which is why a field report of exactly this
8737
+ * failure could only be diagnosed by reading the source and diffing two
8738
+ * releases. Neither counter feeds a control decision; they are reporting only.
8730
8739
  */
8731
8740
  async function withRetry(operation, logicalId, opts = {}) {
8732
8741
  const maxRetries = opts.maxRetries ?? 8;
@@ -8737,6 +8746,8 @@ async function withRetry(operation, logicalId, opts = {}) {
8737
8746
  const attemptCeiling = defaultSchedule ? Math.max(maxRetries, 26) : maxRetries;
8738
8747
  let lastError;
8739
8748
  let sawPropagation = false;
8749
+ let propagationRetries = 0;
8750
+ let propagationSleptMs = 0;
8740
8751
  for (let attempt = 0; attempt <= attemptCeiling; attempt++) try {
8741
8752
  return await operation();
8742
8753
  } catch (error) {
@@ -8747,13 +8758,27 @@ async function withRetry(operation, logicalId, opts = {}) {
8747
8758
  const propagation = defaultSchedule && isIamPropagationError(message);
8748
8759
  if (propagation) sawPropagation = true;
8749
8760
  const attemptLimit = sawPropagation ? 26 : maxRetries;
8750
- if (!retryable || attempt >= attemptLimit) throw error;
8761
+ if (!retryable || attempt >= attemptLimit) {
8762
+ if (propagationRetries > 0) {
8763
+ const budgetExhausted = sawPropagation && attempt >= attemptLimit;
8764
+ const summary = `${logicalId}: gave up after ${propagationRetries} IAM-propagation ${propagationRetries === 1 ? "retry" : "retries"} over ${(propagationSleptMs / 1e3).toFixed(2)}s of propagation backoff${budgetExhausted ? " (the full propagation budget)" : ""} - ${message}`;
8765
+ try {
8766
+ opts.logger?.warn?.(summary);
8767
+ } catch {}
8768
+ }
8769
+ throw error;
8770
+ }
8751
8771
  const delay = propagation ? Math.min(250 * Math.pow(2, attempt), IAM_PROPAGATION_MAX_DELAY_MS) : Math.min(initialDelayMs * Math.pow(2, attempt), maxDelayMs);
8752
- opts.logger?.debug(` ⏳ Retrying ${logicalId} in ${delay / 1e3}s (attempt ${attempt + 1}/${attemptLimit}) - ${message}`);
8772
+ const backoffThroughThisAttemptMs = propagation ? propagationSleptMs + delay : propagationSleptMs;
8773
+ opts.logger?.debug(` ⏳ Retrying ${logicalId} in ${delay / 1e3}s (attempt ${attempt + 1}/${attemptLimit}${propagation ? `, ${(backoffThroughThisAttemptMs / 1e3).toFixed(2)}s backoff through this attempt` : ""}) - ${message}`);
8753
8774
  for (let waited = 0; waited < delay; waited += 1e3) {
8754
8775
  if (opts.isInterrupted?.()) throw opts.onInterrupted ? opts.onInterrupted() : /* @__PURE__ */ new Error("Interrupted");
8755
8776
  await sleep(Math.min(1e3, delay - waited));
8756
8777
  }
8778
+ if (propagation) {
8779
+ propagationRetries++;
8780
+ propagationSleptMs = backoffThroughThisAttemptMs;
8781
+ }
8757
8782
  }
8758
8783
  throw lastError;
8759
8784
  }
@@ -15618,7 +15643,7 @@ var CloudControlProvider = class {
15618
15643
  if (context?.finalSnapshotIdentifier !== void 0) throw new ProvisioningError(`${logicalId} (${resourceType}) requires a final snapshot (DeletionPolicy: Snapshot), but the Cloud Control API delete route has no final-snapshot parameter. Re-run with --skip-final-snapshot after snapshotting manually, or retain the resource.`, resourceType, logicalId, physicalId);
15619
15644
  if (context?.removeProtection === true && resourceType === "AWS::AutoScaling::AutoScalingGroup") {
15620
15645
  this.logger.debug(`Delegating protected AutoScalingGroup ${logicalId} delete to the SDK ASGProvider (Cloud Control cannot force-delete a protected ASG)`);
15621
- const { ASGProvider } = await import("./asg-provider-C1NtROYt.js").then((n) => n.n);
15646
+ const { ASGProvider } = await import("./asg-provider-B9L-88MC.js").then((n) => n.n);
15622
15647
  return await new ASGProvider().delete(logicalId, physicalId, resourceType, _properties, context);
15623
15648
  }
15624
15649
  const isProtectedEc2Instance = context?.removeProtection === true && resourceType === "AWS::EC2::Instance";
@@ -23196,7 +23221,7 @@ const FLUSH_INTERVAL_MS = 2e3;
23196
23221
  const FLUSH_EVENT_THRESHOLD = 50;
23197
23222
  /** Build-time cdkd version, with a dev fallback for non-built contexts. */
23198
23223
  function getCdkdVersion() {
23199
- return "0.284.5";
23224
+ return "0.284.6";
23200
23225
  }
23201
23226
  /**
23202
23227
  * Generate a time-sortable unique run id, e.g.
@@ -25665,4 +25690,4 @@ var DeployEngine = class {
25665
25690
 
25666
25691
  //#endregion
25667
25692
  export { IntrinsicFunctionResolver as $, StackHasActiveImportsError as $n, validateContainerRepoName as $t, formatResourceLine as A, AssemblyReader as An, describeTypeWithThrottleRetry as At, isExportAliasCollision as B, ConfigError as Bn, WorkGraph as Bt, refusesFinalSnapshot as C, MIGRATE_TMP_PREFIX as Cn, s3BucketDomainName as Ct, MULTI_REGION_RECREATE_BLOCKED_TYPES as D, PARTITION_TABLE as Dn, applyRoleArnIfSet as Dt, extractDeploymentEventError as E, expectedOwnerParam as En, s3BucketWebsiteUrl as Et, red as F, getAwsClients as Fn, S3StateBackend as Ft, clearOnUpdateRemoval as G, LocalStartServiceError as Gn, escapeRegExp$1 as Gt, stateKeySecretExposure as H, DeployCancelledError as Hn, createAssetRedirectResolver as Ht, yellow as I, resetAwsClients as In, rebuildClientForBucketRegion as It, findSilentDropProperties as J, NestedStackChildDirectDestroyError as Jn, BOOTSTRAP_MARKER_PREFIX as Jt, ProviderRegistry as K, LockError as Kn, stripControlChars as Kt, collectDeclaredOutputNames as L, setAwsClients as Ln, shouldRetainResource as Lt, cyan as M, clearBucketRegionCache as Mn, DagBuilder as Mt, gray as N, resolveBucketRegion as Nn, TemplateParser as Nt, isStatefulRecreateTargetSync as O, canonicalizeRegion as On, DiffCalculator as Ot, green as P, AwsClients as Pn, LockManager as Pt, isTerminationProtectionPropagationError as Q, ResourceUpdateNotSupportedError as Qn, validateAssetBucketName as Qt, collectPublishedOutputNames as R, AssetError as Rn, AssetPublisher as Rt, isFinalSnapshotError as S, CFN_TEMPLATE_URL_LIMIT as Sn, s3BucketArn as St, makeCanonicalizePropertiesFn as T, uploadCfnTemplate as Tn, s3BucketRegionalDomainName as Tt, IAMRoleProvider as U, LocalInvokeBuildError as Un, loadPublishableAssetManifest as Ut, secretBearingStateKeyWarning as V, DependencyError as Vn, buildAssetRedirectMap as Vt, collectInlinePolicyNamesManagedBySiblings as W, LocalMigrateError as Wn, rewriteTemplateAssetReferences as Wt, slowCcOperationTimeoutMs as X, ProvisioningError as Xn, getBootstrapMarkerKey as Xt, CloudControlProvider as Y, PartialFailureError as Yn, ensureAssetStorage as Yt, disableInstanceApiTermination as Z, ResourceTimeoutError as Zn, parseBootstrapMarker as Zt, ATOMIC_FINAL_SNAPSHOT_TYPES as _, resolveStateBucketWithDefaultAndSource as _n, TEMPLATE_SOURCED_RULES as _t, DeploymentEventsStore as a, runDockerStreaming as an, normalizeAwsError as ar, resolveExplicitPhysicalId as at, ccRoutedFinalSnapshotError as b, warnDeprecatedNoPrefixCliFlag as bn, redactSecretsForState as bt, replayFailedOperations as c, Synthesizer as cn, isRetryableTransientError as cr, configBooleanRefusal as ct, updatePartialReason as d, getLegacyStateBucketName as dn, __exportAll as dr, replayWarn as dt, buildDenyExternalAccessPolicy as en, StackTerminationProtectionError as er, cfnRefValueFromPhysicalId as et, UNSPECIFIED_SKIP_REASON as f, resolveApp as fn, requireConfigArray as ft, computeImplicitDeleteEdges as g, resolveStateBucketWithDefault as gn, STATE_SOURCED_READBACK_RULES as gt, IMPLICIT_DELETE_DEPENDENCIES as h, resolveSkipPrefix as hn, STATE_SOURCED_CROSS_GENERATION_RULES as ht, DeploymentEventsReader as i, runDockerForeground as in, isCdkdError as ir, normalizeAwsTagsToCfn as it, bold as j, processStackMessages as jn, withRetry as jt, renderStatefulReason as k, derivePartitionAndUrlSuffix as kn, INTRINSIC_KEYS as kt, replayRollback as l, synthesisStatusMessage as ln, isThrottlingError as lr, configStringRefusal as lt, withResourceDeadline as m, resolveCaptureObservedState as mn, requireConfigString as mt, DEFAULT_RESOURCE_WARN_AFTER_MS as n, formatDockerLoginError as nn, SynthesisError as nr, refStateLookupFromResource as nt, planFailedOps as o, AssetManifestLoader as on, withErrorHandling as or, assertRegionMatch as ot, deleteSkipReason as p, resolveAutoAssetStorage as pn, requireConfigObject as pt, findActionableSilentDrops as q, MissingCdkCliError as qn, AssetModeResolver as qt, DeployEngine as r, getDockerCmd as rn, formatError as rr, WAFv2WebACLProvider as rt, planRollback as s, getDockerImageBySourceHash as sn, isMarkedNonRetryable as sr, coerceCfnBoolean as st, DEFAULT_RESOURCE_TIMEOUT_MS as t, buildDockerImage as tn, StateError as tr, getAccountInfo as tt, updatePartialMessage as u, getDefaultStateBucketName as un, markNonRetryable as ur, readConfigString as ut, PRE_DELETE_SNAPSHOT_TYPES as v, resolveUseCdkBootstrapAssets as vn, createSecretMasker as vt, unsupportedFinalSnapshotError as w, findLargeInlineResources as wn, s3BucketDualStackDomainName as wt, createPreDeleteFinalSnapshot as x, CFN_TEMPLATE_BODY_LIMIT as xn, scrubResourceRecord as xt, buildFinalSnapshotIdentifier as y, stateBucketExistenceConfirmed as yn, maskSecretsInText as yt, exportAliasCollisionScrubWarning as z, CdkdError as zn, stringifyValue as zt };
25668
- //# sourceMappingURL=deploy-engine-BKSfYWps.js.map
25693
+ //# sourceMappingURL=deploy-engine-Ce7kNQp2.js.map