@camunda8/orchestration-cluster-api 8.9.0-alpha.11 → 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/dist/fp/index.cjs CHANGED
@@ -5460,9 +5460,9 @@ var zDecisionInstanceResult = import_zod.z.object({
5460
5460
  description: "The name of the DMN decision."
5461
5461
  }),
5462
5462
  decisionDefinitionType: zDecisionDefinitionTypeEnum,
5463
- decisionDefinitionVersion: import_zod.z.optional(import_zod.z.int().register(import_zod.z.globalRegistry, {
5463
+ decisionDefinitionVersion: import_zod.z.int().register(import_zod.z.globalRegistry, {
5464
5464
  description: "The version of the decision."
5465
- })),
5465
+ }),
5466
5466
  decisionEvaluationInstanceKey: zDecisionEvaluationInstanceKey,
5467
5467
  decisionEvaluationKey: zDecisionEvaluationKey,
5468
5468
  elementInstanceKey: import_zod.z.union([
@@ -6364,7 +6364,7 @@ var zProblemDetail = import_zod.z.object({
6364
6364
  var zProcessDefinitionFilter = import_zod.z.object({
6365
6365
  name: import_zod.z.optional(zStringFilterProperty),
6366
6366
  isLatestVersion: import_zod.z.optional(import_zod.z.boolean().register(import_zod.z.globalRegistry, {
6367
- description: "Whether to only return the latest version of each process definition.\nWhen using this filter, pagination functionality is limited, you can only paginate forward using `after` and `limit`.\nThe response contains no `startCursor` in the `page`, and requests ignore the `from` and `before` in the `page`.\n"
6367
+ description: "Whether to only return the latest version of each process definition.\nWhen using this filter, pagination functionality is limited, you can only paginate forward using `after` and `limit`.\nThe response contains no `startCursor` in the `page`, and requests ignore the `from` and `before` in the `page`.\nWhen using this filter, sorting is limited to `processDefinitionId` and `tenantId` fields only.\n"
6368
6368
  })),
6369
6369
  resourceName: import_zod.z.optional(import_zod.z.string().register(import_zod.z.globalRegistry, {
6370
6370
  description: "Resource name of this process definition."
@@ -7389,7 +7389,8 @@ var zProcessInstanceSearchQuerySortRequest = import_zod.z.object({
7389
7389
  "endDate",
7390
7390
  "state",
7391
7391
  "hasIncident",
7392
- "tenantId"
7392
+ "tenantId",
7393
+ "businessId"
7393
7394
  ]).register(import_zod.z.globalRegistry, {
7394
7395
  description: "The field to sort by."
7395
7396
  }),
@@ -8832,7 +8833,8 @@ var zBaseProcessInstanceFilterFields = import_zod.z.object({
8832
8833
  description: "Whether the element instance has an incident or not."
8833
8834
  })),
8834
8835
  incidentErrorHashCode: import_zod.z.optional(zIntegerFilterProperty),
8835
- tags: import_zod.z.optional(zTagSet)
8836
+ tags: import_zod.z.optional(zTagSet),
8837
+ businessId: import_zod.z.optional(zStringFilterProperty)
8836
8838
  }).register(import_zod.z.globalRegistry, {
8837
8839
  description: "Base process instance search filter."
8838
8840
  });
@@ -12309,7 +12311,7 @@ function createLogger(opts = {}) {
12309
12311
  }
12310
12312
 
12311
12313
  // src/runtime/version.ts
12312
- var packageVersion = "8.9.0-alpha.11";
12314
+ var packageVersion = "8.9.0-alpha.13";
12313
12315
 
12314
12316
  // src/runtime/supportLogger.ts
12315
12317
  var NoopSupportLogger = class {
@@ -13109,6 +13111,7 @@ async function executeWithHttpRetry(fn, policy, logger, classify = defaultHttpCl
13109
13111
  var BackpressureManager = class {
13110
13112
  logger;
13111
13113
  now;
13114
+ sleep;
13112
13115
  cfg;
13113
13116
  severity = "healthy";
13114
13117
  consecutive = 0;
@@ -13121,9 +13124,12 @@ var BackpressureManager = class {
13121
13124
  observeOnly = false;
13122
13125
  healthySince = 0;
13123
13126
  // timestamp when severity last became healthy
13127
+ backoffMs = 0;
13128
+ // current backoff delay in ms (0 = no backoff)
13124
13129
  constructor(opts = {}) {
13125
13130
  this.logger = opts.logger;
13126
13131
  this.now = opts.now || (() => Date.now());
13132
+ this.sleep = opts.sleep || ((ms) => new Promise((r) => setTimeout(r, ms)));
13127
13133
  this.cfg = {
13128
13134
  enabled: true,
13129
13135
  initialMaxConcurrency: null,
@@ -13137,6 +13143,9 @@ var BackpressureManager = class {
13137
13143
  maxWaiters: 1e3,
13138
13144
  healthyRecoveryMultiplier: 1.5,
13139
13145
  unlimitedAfterHealthyMs: 3e4,
13146
+ backoffInitialMs: 25,
13147
+ backoffMaxMs: 2e3,
13148
+ backoffEscalate: 2,
13140
13149
  ...opts.config
13141
13150
  };
13142
13151
  this.observeOnly = !!this.cfg.observeOnly;
@@ -13152,7 +13161,8 @@ var BackpressureManager = class {
13152
13161
  // When disabled, report unlimited semantics explicitly
13153
13162
  permitsMax: this.cfg.enabled === false ? null : this.permitsMax,
13154
13163
  permitsCurrent: this.cfg.enabled === false ? 0 : this.permitsCurrent,
13155
- waiters: this.waiters.length
13164
+ waiters: this.waiters.length,
13165
+ backoffMs: this.backoffMs
13156
13166
  };
13157
13167
  }
13158
13168
  log(evt, data, prevSeverity) {
@@ -13174,6 +13184,10 @@ var BackpressureManager = class {
13174
13184
  if (this.observeOnly) return;
13175
13185
  if (!this.isEnabled()) return;
13176
13186
  if (this.permitsMax === null) return;
13187
+ if (this.backoffMs > 0) {
13188
+ await this.sleep(this.backoffMs);
13189
+ if (this.permitsMax === null) return;
13190
+ }
13177
13191
  if (this.permitsCurrent < (this.permitsMax || 0)) {
13178
13192
  this.permitsCurrent++;
13179
13193
  return;
@@ -13237,11 +13251,23 @@ var BackpressureManager = class {
13237
13251
  } else if (this.severity === "soft") {
13238
13252
  if (!this.observeOnly) this.scalePermits(this.cfg.reduceFactor);
13239
13253
  }
13254
+ if (!this.observeOnly && this.permitsMax !== null && this.permitsMax <= this.cfg.floorConcurrency && this.severity === "severe") {
13255
+ if (this.backoffMs === 0) {
13256
+ this.backoffMs = this.cfg.backoffInitialMs;
13257
+ } else {
13258
+ this.backoffMs = Math.min(this.cfg.backoffMaxMs, this.backoffMs * this.cfg.backoffEscalate);
13259
+ }
13260
+ this.log("backoff.escalate", { delayMs: this.backoffMs });
13261
+ }
13240
13262
  if (this.severity !== prevSeverity)
13241
13263
  this.log("severity", { severity: this.severity }, prevSeverity);
13242
13264
  }
13243
13265
  recordHealthyHint() {
13244
13266
  if (!this.cfg.enabled && !this.observeOnly) return;
13267
+ if (this.backoffMs > 0) {
13268
+ this.backoffMs = 0;
13269
+ this.log("backoff.clear", { reason: "healthy-hint" });
13270
+ }
13245
13271
  const now2 = this.now();
13246
13272
  this.maybeRecover(now2);
13247
13273
  }
@@ -13265,13 +13291,23 @@ var BackpressureManager = class {
13265
13291
  this.healthySince = now2;
13266
13292
  }
13267
13293
  if (this.severity === "healthy") this.consecutive = 0;
13268
- if (prev !== this.severity) this.log("severity", { severity: this.severity }, prev);
13294
+ if (prev !== this.severity) {
13295
+ if (this.backoffMs > 0) {
13296
+ this.backoffMs = 0;
13297
+ this.log("backoff.clear", { reason: "severity-decay" });
13298
+ }
13299
+ this.log("severity", { severity: this.severity }, prev);
13300
+ }
13269
13301
  }
13270
13302
  if (this.permitsMax !== null) {
13271
13303
  const bootstrapCap = this.cfg.initialMaxConcurrency ?? 16;
13272
13304
  if (this.severity !== "healthy") {
13273
13305
  if (this.permitsMax < bootstrapCap) {
13274
13306
  this.permitsMax = Math.min(bootstrapCap, this.permitsMax + this.cfg.recoveryStep);
13307
+ if (this.permitsMax > this.cfg.floorConcurrency && this.backoffMs > 0) {
13308
+ this.backoffMs = 0;
13309
+ this.log("backoff.clear", { reason: "left-floor" });
13310
+ }
13275
13311
  this.log("permits.recover", { max: this.permitsMax, phase: "additive" }, this.severity);
13276
13312
  this.release();
13277
13313
  }
@@ -13279,6 +13315,7 @@ var BackpressureManager = class {
13279
13315
  if (this.healthySince > 0 && now2 - this.healthySince >= this.cfg.unlimitedAfterHealthyMs) {
13280
13316
  this.permitsMax = null;
13281
13317
  this.permitsCurrent = 0;
13318
+ this.backoffMs = 0;
13282
13319
  while (this.waiters.length) {
13283
13320
  const w = this.waiters.shift();
13284
13321
  try {