(cause: Cause.Cause<unknown>)
| 503 | ) |
| 504 | |
| 505 | const markShardLocksUnhealthy = (cause: Cause.Cause<unknown>) => |
| 506 | Effect.suspend(() => { |
| 507 | if (!shardLocksHealthy) return Effect.void |
| 508 | shardLocksHealthy = false |
| 509 | shardLocksHealthyLatch.unsafeClose() |
| 510 | |
| 511 | const affectedShards = MutableHashSet.fromIterable([...acquiredShards, ...releasingShards]) |
| 512 | MutableHashSet.clear(selfShards) |
| 513 | MutableHashSet.clear(acquiredShards) |
| 514 | for (const shardId of affectedShards) { |
| 515 | MutableHashSet.add(releasingShards, shardId) |
| 516 | MutableHashSet.add(forceReleasingShards, shardId) |
| 517 | } |
| 518 | updateShardsGauge() |
| 519 | activeShardsLatch.unsafeOpen() |
| 520 | |
| 521 | return Effect.gen(function*() { |
| 522 | yield* Effect.logError("Shard lock storage is unhealthy", cause) |
| 523 | yield* Effect.forkIn(syncSingletons, shardingScope) |
| 524 | |
| 525 | yield* forkInterruptShards([...affectedShards], true) |
| 526 | activeShardsLatch.unsafeOpen() |
| 527 | }) |
| 528 | }) |
| 529 | |
| 530 | const markShardLocksHealthy = Effect.suspend(() => { |
| 531 | if (shardLocksHealthy) return Effect.void |
nothing calls this directly
no test coverage detected