@camunda8/orchestration-cluster-api 8.9.0-alpha.12 → 8.9.0-alpha.13

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.
package/CHANGELOG.md CHANGED
@@ -1,9 +1,15 @@
1
- # [8.9.0-alpha.12](https://github.com/camunda/orchestration-cluster-api-js/compare/v8.9.0-alpha.11...v8.9.0-alpha.12) (2026-03-08)
1
+ # [8.9.0-alpha.13](https://github.com/camunda/orchestration-cluster-api-js/compare/v8.9.0-alpha.12...v8.9.0-alpha.13) (2026-03-09)
2
+
3
+
4
+ ### Features
5
+
6
+ * add backoff-at-floor to backpressure algorithm ([a0504bc](https://github.com/camunda/orchestration-cluster-api-js/commit/a0504bcdfd3e24c47e168cddc59aeae957bfc8dd))
2
7
 
8
+ # [8.9.0-alpha.12](https://github.com/camunda/orchestration-cluster-api-js/compare/v8.9.0-alpha.11...v8.9.0-alpha.12) (2026-03-08)
3
9
 
4
10
  ### Features
5
11
 
6
- * build from hardened contract in 8.9 ([03ef35a](https://github.com/camunda/orchestration-cluster-api-js/commit/03ef35a9cda1913bf11bd42b07ae95829d4118cc))
12
+ - build from hardened contract in 8.9 ([03ef35a](https://github.com/camunda/orchestration-cluster-api-js/commit/03ef35a9cda1913bf11bd42b07ae95829d4118cc))
7
13
 
8
14
  # [8.9.0-alpha.11](https://github.com/camunda/orchestration-cluster-api-js/compare/v8.9.0-alpha.10...v8.9.0-alpha.11) (2026-03-06)
9
15
 
@@ -12426,7 +12426,7 @@ function installAuthInterceptor(client2, getStrategy, getAuthHeaders) {
12426
12426
  }
12427
12427
 
12428
12428
  // src/runtime/version.ts
12429
- var packageVersion = "8.9.0-alpha.12";
12429
+ var packageVersion = "8.9.0-alpha.13";
12430
12430
 
12431
12431
  // src/runtime/supportLogger.ts
12432
12432
  var NoopSupportLogger = class {
@@ -13226,6 +13226,7 @@ async function executeWithHttpRetry(fn, policy, logger, classify = defaultHttpCl
13226
13226
  var BackpressureManager = class {
13227
13227
  logger;
13228
13228
  now;
13229
+ sleep;
13229
13230
  cfg;
13230
13231
  severity = "healthy";
13231
13232
  consecutive = 0;
@@ -13238,9 +13239,12 @@ var BackpressureManager = class {
13238
13239
  observeOnly = false;
13239
13240
  healthySince = 0;
13240
13241
  // timestamp when severity last became healthy
13242
+ backoffMs = 0;
13243
+ // current backoff delay in ms (0 = no backoff)
13241
13244
  constructor(opts = {}) {
13242
13245
  this.logger = opts.logger;
13243
13246
  this.now = opts.now || (() => Date.now());
13247
+ this.sleep = opts.sleep || ((ms) => new Promise((r) => setTimeout(r, ms)));
13244
13248
  this.cfg = {
13245
13249
  enabled: true,
13246
13250
  initialMaxConcurrency: null,
@@ -13254,6 +13258,9 @@ var BackpressureManager = class {
13254
13258
  maxWaiters: 1e3,
13255
13259
  healthyRecoveryMultiplier: 1.5,
13256
13260
  unlimitedAfterHealthyMs: 3e4,
13261
+ backoffInitialMs: 25,
13262
+ backoffMaxMs: 2e3,
13263
+ backoffEscalate: 2,
13257
13264
  ...opts.config
13258
13265
  };
13259
13266
  this.observeOnly = !!this.cfg.observeOnly;
@@ -13269,7 +13276,8 @@ var BackpressureManager = class {
13269
13276
  // When disabled, report unlimited semantics explicitly
13270
13277
  permitsMax: this.cfg.enabled === false ? null : this.permitsMax,
13271
13278
  permitsCurrent: this.cfg.enabled === false ? 0 : this.permitsCurrent,
13272
- waiters: this.waiters.length
13279
+ waiters: this.waiters.length,
13280
+ backoffMs: this.backoffMs
13273
13281
  };
13274
13282
  }
13275
13283
  log(evt, data, prevSeverity) {
@@ -13291,6 +13299,10 @@ var BackpressureManager = class {
13291
13299
  if (this.observeOnly) return;
13292
13300
  if (!this.isEnabled()) return;
13293
13301
  if (this.permitsMax === null) return;
13302
+ if (this.backoffMs > 0) {
13303
+ await this.sleep(this.backoffMs);
13304
+ if (this.permitsMax === null) return;
13305
+ }
13294
13306
  if (this.permitsCurrent < (this.permitsMax || 0)) {
13295
13307
  this.permitsCurrent++;
13296
13308
  return;
@@ -13354,11 +13366,23 @@ var BackpressureManager = class {
13354
13366
  } else if (this.severity === "soft") {
13355
13367
  if (!this.observeOnly) this.scalePermits(this.cfg.reduceFactor);
13356
13368
  }
13369
+ if (!this.observeOnly && this.permitsMax !== null && this.permitsMax <= this.cfg.floorConcurrency && this.severity === "severe") {
13370
+ if (this.backoffMs === 0) {
13371
+ this.backoffMs = this.cfg.backoffInitialMs;
13372
+ } else {
13373
+ this.backoffMs = Math.min(this.cfg.backoffMaxMs, this.backoffMs * this.cfg.backoffEscalate);
13374
+ }
13375
+ this.log("backoff.escalate", { delayMs: this.backoffMs });
13376
+ }
13357
13377
  if (this.severity !== prevSeverity)
13358
13378
  this.log("severity", { severity: this.severity }, prevSeverity);
13359
13379
  }
13360
13380
  recordHealthyHint() {
13361
13381
  if (!this.cfg.enabled && !this.observeOnly) return;
13382
+ if (this.backoffMs > 0) {
13383
+ this.backoffMs = 0;
13384
+ this.log("backoff.clear", { reason: "healthy-hint" });
13385
+ }
13362
13386
  const now2 = this.now();
13363
13387
  this.maybeRecover(now2);
13364
13388
  }
@@ -13382,13 +13406,23 @@ var BackpressureManager = class {
13382
13406
  this.healthySince = now2;
13383
13407
  }
13384
13408
  if (this.severity === "healthy") this.consecutive = 0;
13385
- if (prev !== this.severity) this.log("severity", { severity: this.severity }, prev);
13409
+ if (prev !== this.severity) {
13410
+ if (this.backoffMs > 0) {
13411
+ this.backoffMs = 0;
13412
+ this.log("backoff.clear", { reason: "severity-decay" });
13413
+ }
13414
+ this.log("severity", { severity: this.severity }, prev);
13415
+ }
13386
13416
  }
13387
13417
  if (this.permitsMax !== null) {
13388
13418
  const bootstrapCap = this.cfg.initialMaxConcurrency ?? 16;
13389
13419
  if (this.severity !== "healthy") {
13390
13420
  if (this.permitsMax < bootstrapCap) {
13391
13421
  this.permitsMax = Math.min(bootstrapCap, this.permitsMax + this.cfg.recoveryStep);
13422
+ if (this.permitsMax > this.cfg.floorConcurrency && this.backoffMs > 0) {
13423
+ this.backoffMs = 0;
13424
+ this.log("backoff.clear", { reason: "left-floor" });
13425
+ }
13392
13426
  this.log("permits.recover", { max: this.permitsMax, phase: "additive" }, this.severity);
13393
13427
  this.release();
13394
13428
  }
@@ -13396,6 +13430,7 @@ var BackpressureManager = class {
13396
13430
  if (this.healthySince > 0 && now2 - this.healthySince >= this.cfg.unlimitedAfterHealthyMs) {
13397
13431
  this.permitsMax = null;
13398
13432
  this.permitsCurrent = 0;
13433
+ this.backoffMs = 0;
13399
13434
  while (this.waiters.length) {
13400
13435
  const w = this.waiters.shift();
13401
13436
  try {
@@ -23515,4 +23550,4 @@ export {
23515
23550
  withTimeoutTE,
23516
23551
  eventuallyTE
23517
23552
  };
23518
- //# sourceMappingURL=chunk-4LIDRKND.js.map
23553
+ //# sourceMappingURL=chunk-ULXL7H75.js.map