@zlink-systems/framework 0.30.1 → 0.30.2
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/.tsbuildinfo +1 -1
- package/dist/contracts/Common/ZLinkEncodedPayload.d.ts +6 -0
- package/dist/contracts/Common/ZLinkEncodedPayload.js +18 -3
- package/dist/contracts/Common/encoded-payload-storage.d.ts +1 -1
- package/dist/contracts/Common/encoded-payload-storage.js +5 -2
- package/dist/contracts/Configuration/Builders.d.ts +1 -1
- package/dist/contracts/Configuration/RegistrationBuilderPolicy.d.ts +2 -1
- package/dist/contracts/Configuration/RegistrationBuilderPolicy.js +5 -1
- package/dist/contracts/Configuration/RegistrationBuilders.js +2 -2
- package/dist/contracts/Configuration/RegistrationTypes.d.ts +1 -0
- package/dist/contracts/Dispatch/ZLinkDispatchOptions.d.ts +2 -2
- package/dist/contracts/Locations/Rows.d.ts +2 -0
- package/dist/contracts/Spots/Contracts.d.ts +4 -0
- package/dist/contracts/Spots/ZLinkSpot.d.ts +3 -3
- package/dist/runtime/abort.d.ts +5 -0
- package/dist/runtime/abort.js +10 -0
- package/dist/runtime/actors/actor-authority-publication.js +3 -2
- package/dist/runtime/actors/actor-client.d.ts +0 -1
- package/dist/runtime/actors/actor-client.js +38 -45
- package/dist/runtime/actors/actor-context.d.ts +2 -0
- package/dist/runtime/actors/actor-context.js +46 -9
- package/dist/runtime/actors/actor-handoff.d.ts +7 -3
- package/dist/runtime/actors/actor-handoff.js +212 -88
- package/dist/runtime/actors/actor-join-relocation.d.ts +2 -0
- package/dist/runtime/actors/actor-local-native-join.js +4 -0
- package/dist/runtime/actors/actor-mailbox.js +27 -1
- package/dist/runtime/actors/actor-remote-joiner.js +3 -1
- package/dist/runtime/actors/actor-reply.d.ts +4 -0
- package/dist/runtime/actors/actor-reply.js +29 -0
- package/dist/runtime/actors/actor-runtime-contracts.d.ts +2 -0
- package/dist/runtime/actors/actor-runtime-state.js +2 -20
- package/dist/runtime/actors/actor-source-transfer.d.ts +1 -17
- package/dist/runtime/actors/index.d.ts +6 -2
- package/dist/runtime/actors/index.js +37 -21
- package/dist/runtime/actors/session-disconnected-wire.d.ts +8 -0
- package/dist/runtime/actors/session-disconnected-wire.js +48 -0
- package/dist/runtime/admission.d.ts +9 -1
- package/dist/runtime/admission.js +55 -32
- package/dist/runtime/application-jobs/application-job-queue-scope.d.ts +13 -0
- package/dist/runtime/application-jobs/application-job-queue-scope.js +27 -1
- package/dist/runtime/application-jobs/contracts.d.ts +2 -0
- package/dist/runtime/backend/contracts/index.d.ts +19 -3
- package/dist/runtime/backend/mesh-actor-session-node-adapter.js +2 -2
- package/dist/runtime/backend/mesh-completion-table.js +5 -0
- package/dist/runtime/backend/mesh-dispatch-pump.d.ts +26 -2
- package/dist/runtime/backend/mesh-dispatch-pump.js +193 -107
- package/dist/runtime/backend/node/node-raw-binding-port.js +90 -58
- package/dist/runtime/backend/node/node-raw-mesh-backend.d.ts +33 -8
- package/dist/runtime/backend/node/node-raw-mesh-backend.js +142 -143
- package/dist/runtime/backend/node/node-socket-backend-adapter.d.ts +1 -1
- package/dist/runtime/backend/node/node-socket-backend-adapter.js +5 -5
- package/dist/runtime/channels/channel-clients.d.ts +1 -0
- package/dist/runtime/channels/channel-clients.js +20 -5
- package/dist/runtime/channels/channel-dispatch-pipeline.d.ts +22 -3
- package/dist/runtime/channels/channel-dispatch-pipeline.js +103 -57
- package/dist/runtime/channels/channel-dispatchers.d.ts +3 -2
- package/dist/runtime/channels/channel-dispatchers.js +44 -37
- package/dist/runtime/channels/channel-envelope.d.ts +1 -0
- package/dist/runtime/channels/channel-envelope.js +74 -31
- package/dist/runtime/channels/channel-runtime-lifecycle.d.ts +4 -3
- package/dist/runtime/channels/channel-runtime-lifecycle.js +19 -24
- package/dist/runtime/channels/channel-runtime-manager.d.ts +3 -2
- package/dist/runtime/channels/channel-runtime-manager.js +4 -4
- package/dist/runtime/channels/channel-transports.d.ts +0 -1
- package/dist/runtime/channels/channel-transports.js +35 -33
- package/dist/runtime/channels/client-server-location-runtime.js +5 -4
- package/dist/runtime/channels/dispatch-error-reporter.d.ts +2 -1
- package/dist/runtime/channels/dispatch-error-reporter.js +2 -1
- package/dist/runtime/channels/fanout-location-runtime.d.ts +1 -1
- package/dist/runtime/channels/fanout-location-runtime.js +3 -3
- package/dist/runtime/diagnostics/flow-context.js +19 -7
- package/dist/runtime/diagnostics/index.js +4 -9
- package/dist/runtime/diagnostics/message-flow.d.ts +8 -0
- package/dist/runtime/diagnostics/message-flow.js +35 -5
- package/dist/runtime/diagnostics/runtime-metrics.d.ts +2 -2
- package/dist/runtime/diagnostics/runtime-metrics.js +10 -8
- package/dist/runtime/execution/index.d.ts +4 -2
- package/dist/runtime/execution/index.js +33 -10
- package/dist/runtime/execution/serial-execution-queue.d.ts +4 -0
- package/dist/runtime/execution/serial-execution-queue.js +21 -2
- package/dist/runtime/execution/state-lane.d.ts +2 -0
- package/dist/runtime/execution/state-lane.js +5 -0
- package/dist/runtime/foundation/operation-registry.d.ts +25 -1
- package/dist/runtime/foundation/operation-registry.js +86 -18
- package/dist/runtime/foundation/raw-service-mesh-runtime.d.ts +39 -3
- package/dist/runtime/foundation/raw-service-mesh-runtime.js +151 -55
- package/dist/runtime/foundation/service-liveness-registry.d.ts +12 -1
- package/dist/runtime/foundation/service-liveness-registry.js +38 -0
- package/dist/runtime/foundation/service-mailbox.d.ts +7 -0
- package/dist/runtime/foundation/service-maintenance-runtime.js +1 -6
- package/dist/runtime/foundation/service-relocation-object-owner.d.ts +2 -3
- package/dist/runtime/foundation/service-relocation-object-owner.js +48 -35
- package/dist/runtime/foundation/service-relocation-runtime.js +7 -3
- package/dist/runtime/foundation/service-runtime-contracts.d.ts +8 -1
- package/dist/runtime/foundation/service-session-binding-ingress-port.d.ts +2 -1
- package/dist/runtime/foundation/service-stateful-registry.d.ts +5 -4
- package/dist/runtime/foundation/service-stateful-registry.js +24 -26
- package/dist/runtime/foundation/service-stateful-runtime.d.ts +72 -6
- package/dist/runtime/foundation/service-stateful-runtime.js +444 -117
- package/dist/runtime/foundation/service-stateful-wire-codec.d.ts +14 -1
- package/dist/runtime/foundation/service-stateful-wire-codec.js +48 -27
- package/dist/runtime/foundation/service-wire-binary-primitives.d.ts +6 -1
- package/dist/runtime/foundation/service-wire-binary-primitives.js +27 -11
- package/dist/runtime/foundation/service-wire-constants.generated.d.ts +1 -0
- package/dist/runtime/foundation/service-wire-constants.generated.js +1 -0
- package/dist/runtime/foundation/service-wire-m6a-codec.d.ts +10 -0
- package/dist/runtime/foundation/service-wire-m6a-codec.js +166 -53
- package/dist/runtime/host/actor-packet-relay.d.ts +6 -4
- package/dist/runtime/host/actor-packet-relay.js +59 -72
- package/dist/runtime/host/actor-placement-coordinator.js +25 -8
- package/dist/runtime/host/actor-transfer-runtime.d.ts +7 -31
- package/dist/runtime/host/actor-transfer-runtime.js +85 -331
- package/dist/runtime/host/application-job-queue.d.ts +24 -3
- package/dist/runtime/host/application-job-queue.js +28 -41
- package/dist/runtime/host/index.d.ts +5 -1
- package/dist/runtime/host/index.js +171 -97
- package/dist/runtime/host/location-runtime-owner.js +2 -6
- package/dist/runtime/host/mesh-router-resolver.d.ts +4 -0
- package/dist/runtime/host/mesh-router-resolver.js +14 -6
- package/dist/runtime/host/remote-bound-session-relay.d.ts +2 -4
- package/dist/runtime/host/remote-bound-session-relay.js +71 -190
- package/dist/runtime/host/route-mesh-runtime.d.ts +2 -2
- package/dist/runtime/host/route-mesh-runtime.js +5 -3
- package/dist/runtime/host/runtime-shutdown.d.ts +1 -0
- package/dist/runtime/host/runtime-shutdown.js +3 -2
- package/dist/runtime/host/service-relocation-host-runtime.d.ts +17 -7
- package/dist/runtime/host/service-relocation-host-runtime.js +550 -367
- package/dist/runtime/host/spot-runtime-options-factory.js +15 -7
- package/dist/runtime/host/user-spot-creation-coordinator.js +33 -84
- package/dist/runtime/locations/auto-connect-loop.d.ts +2 -0
- package/dist/runtime/locations/auto-connect-loop.js +22 -14
- package/dist/runtime/locations/auto-connect-reconciler.js +0 -6
- package/dist/runtime/locations/auto-connect-types.d.ts +0 -1
- package/dist/runtime/locations/descriptor-publication.d.ts +4 -0
- package/dist/runtime/locations/descriptor-publication.js +11 -0
- package/dist/runtime/locations/domain-store-contract.d.ts +1 -0
- package/dist/runtime/locations/in-memory-authority-store.d.ts +7 -1
- package/dist/runtime/locations/in-memory-authority-store.js +56 -19
- package/dist/runtime/locations/in-memory-location-store.js +1 -10
- package/dist/runtime/locations/index.d.ts +1 -0
- package/dist/runtime/locations/index.js +1 -0
- package/dist/runtime/locations/lease-tracker.js +1 -6
- package/dist/runtime/locations/location-store-repository.d.ts +51 -1
- package/dist/runtime/locations/location-store-repository.js +363 -139
- package/dist/runtime/locations/relocation-blob.d.ts +18 -1
- package/dist/runtime/locations/relocation-blob.js +52 -1
- package/dist/runtime/locations/request-source-resolver.d.ts +37 -0
- package/dist/runtime/locations/request-source-resolver.js +80 -0
- package/dist/runtime/locations/resolvers.js +1 -1
- package/dist/runtime/locations/runtime.d.ts +6 -2
- package/dist/runtime/locations/runtime.js +37 -30
- package/dist/runtime/messaging/payload-codec.d.ts +7 -1
- package/dist/runtime/messaging/payload-codec.js +7 -6
- package/dist/runtime/messaging/request-result.js +29 -26
- package/dist/runtime/protocol/service_wire_codec.generated.d.ts +19 -1
- package/dist/runtime/protocol/service_wire_codec.generated.js +85 -0
- package/dist/runtime/protocol/service_wire_pilot_codec.generated.d.ts +7 -1
- package/dist/runtime/protocol/service_wire_pilot_codec.generated.js +23 -7
- package/dist/runtime/spots/formal-remote-actor-admission-registry.js +3 -2
- package/dist/runtime/spots/index.d.ts +18 -11
- package/dist/runtime/spots/index.js +234 -176
- package/dist/runtime/spots/spot-activation-registry.d.ts +4 -2
- package/dist/runtime/spots/spot-activation-registry.js +21 -11
- package/dist/runtime/spots/spot-activation-state.d.ts +1 -1
- package/dist/runtime/spots/spot-activation-state.js +7 -7
- package/dist/runtime/spots/spot-activation.d.ts +6 -3
- package/dist/runtime/spots/spot-activation.js +123 -44
- package/dist/runtime/spots/spot-actor-admission-coordinator.d.ts +1 -0
- package/dist/runtime/spots/spot-actor-admission-coordinator.js +13 -22
- package/dist/runtime/spots/spot-actor-membership.d.ts +0 -1
- package/dist/runtime/spots/spot-actor-membership.js +0 -8
- package/dist/runtime/spots/spot-actor-packet-dispatch.js +33 -8
- package/dist/runtime/spots/spot-actor-packet-drain.js +5 -33
- package/dist/runtime/spots/spot-entry-activation.d.ts +2 -0
- package/dist/runtime/spots/spot-entry-activation.js +14 -9
- package/dist/runtime/spots/spot-handler-registry.d.ts +4 -3
- package/dist/runtime/spots/spot-handler-registry.js +6 -2
- package/dist/runtime/spots/spot-manager-internal-contracts.d.ts +2 -2
- package/dist/runtime/spots/spot-manager-public.js +2 -2
- package/dist/runtime/spots/spot-node-autoconnect.d.ts +2 -1
- package/dist/runtime/spots/spot-node-autoconnect.js +18 -39
- package/dist/runtime/spots/spot-node-runtime-manager.d.ts +19 -2
- package/dist/runtime/spots/spot-node-runtime-manager.js +115 -50
- package/dist/runtime/spots/spot-outbound.js +3 -3
- package/dist/runtime/spots/spot-remote-codec.js +5 -1
- package/dist/runtime/spots/spot-runtime-ports.d.ts +0 -1
- package/dist/runtime/spots/spot-serial-executor.d.ts +10 -0
- package/dist/runtime/spots/spot-serial-executor.js +61 -8
- package/dist/runtime/spots/spot-serial-turn-executor.js +19 -2
- package/dist/runtime/spots/spot-subscription-dispatch.js +1 -1
- package/dist/runtime/spots/spot-timer.d.ts +57 -5
- package/dist/runtime/spots/spot-timer.js +287 -103
- package/dist/runtime/streams/actor-session-binding-registry.d.ts +42 -11
- package/dist/runtime/streams/actor-session-binding-registry.js +165 -48
- package/dist/runtime/streams/actor-session-binding-runtime-owner.d.ts +8 -4
- package/dist/runtime/streams/bound-actor-relay-sender.d.ts +2 -1
- package/dist/runtime/streams/bound-actor-relay-sender.js +15 -8
- package/dist/runtime/streams/bound-session-service.d.ts +1 -1
- package/dist/runtime/streams/bound-session-service.js +6 -11
- package/dist/runtime/streams/index.d.ts +3 -2
- package/dist/runtime/streams/index.js +6 -4
- package/dist/runtime/streams/managed-stream.js +3 -2
- package/dist/runtime/streams/native-fallback-bound-session.js +8 -73
- package/dist/runtime/streams/session-actor-coordinator.d.ts +2 -8
- package/dist/runtime/streams/session-actor-coordinator.js +15 -32
- package/dist/runtime/streams/stream-binding-runtime-ports.d.ts +3 -10
- package/dist/runtime/streams/stream-session-runtime.js +1 -4
- package/dist/runtime/workers/index.js +1 -1
- package/package.json +3 -3
- package/src/contracts/Common/ZLinkEncodedPayload.ts +24 -4
- package/src/contracts/Common/encoded-payload-storage.ts +6 -3
- package/src/contracts/Configuration/Builders.ts +4 -1
- package/src/contracts/Configuration/RegistrationBuilderPolicy.ts +7 -2
- package/src/contracts/Configuration/RegistrationBuilders.ts +6 -2
- package/src/contracts/Configuration/RegistrationTypes.ts +1 -0
- package/src/contracts/Dispatch/ZLinkDispatchOptions.ts +2 -1
- package/src/contracts/Locations/Rows.ts +2 -0
- package/src/contracts/Spots/Contracts.ts +8 -0
- package/src/contracts/Spots/ZLinkSpot.ts +3 -3
- package/src/runtime/abort.ts +12 -0
- package/src/runtime/actors/actor-authority-publication.ts +3 -2
- package/src/runtime/actors/actor-client.ts +61 -70
- package/src/runtime/actors/actor-context.ts +49 -9
- package/src/runtime/actors/actor-handoff.ts +282 -106
- package/src/runtime/actors/actor-join-relocation.ts +2 -0
- package/src/runtime/actors/actor-local-native-join.ts +4 -0
- package/src/runtime/actors/actor-mailbox.ts +40 -2
- package/src/runtime/actors/actor-remote-joiner.ts +6 -1
- package/src/runtime/actors/actor-reply.ts +42 -0
- package/src/runtime/actors/actor-runtime-contracts.ts +2 -0
- package/src/runtime/actors/actor-runtime-state.ts +2 -20
- package/src/runtime/actors/actor-source-transfer.ts +1 -34
- package/src/runtime/actors/index.ts +41 -27
- package/src/runtime/actors/session-disconnected-wire.ts +66 -0
- package/src/runtime/admission.ts +69 -34
- package/src/runtime/application-jobs/application-job-queue-scope.ts +33 -1
- package/src/runtime/application-jobs/contracts.ts +2 -0
- package/src/runtime/backend/contracts/index.ts +39 -4
- package/src/runtime/backend/mesh-actor-session-node-adapter.ts +5 -3
- package/src/runtime/backend/mesh-completion-table.ts +4 -0
- package/src/runtime/backend/mesh-dispatch-pump.ts +223 -124
- package/src/runtime/backend/node/node-raw-binding-port.ts +106 -70
- package/src/runtime/backend/node/node-raw-mesh-backend.ts +221 -170
- package/src/runtime/backend/node/node-socket-backend-adapter.ts +5 -5
- package/src/runtime/channels/channel-clients.ts +49 -24
- package/src/runtime/channels/channel-dispatch-pipeline.ts +173 -124
- package/src/runtime/channels/channel-dispatchers.ts +116 -72
- package/src/runtime/channels/channel-envelope.ts +105 -36
- package/src/runtime/channels/channel-runtime-lifecycle.ts +13 -13
- package/src/runtime/channels/channel-runtime-manager.ts +12 -5
- package/src/runtime/channels/channel-transports.ts +49 -58
- package/src/runtime/channels/client-server-location-runtime.ts +11 -10
- package/src/runtime/channels/dispatch-error-reporter.ts +4 -2
- package/src/runtime/channels/fanout-location-runtime.ts +17 -9
- package/src/runtime/diagnostics/flow-context.ts +20 -7
- package/src/runtime/diagnostics/index.ts +1 -7
- package/src/runtime/diagnostics/message-flow.ts +47 -9
- package/src/runtime/diagnostics/runtime-metrics.ts +12 -10
- package/src/runtime/execution/index.ts +40 -14
- package/src/runtime/execution/serial-execution-queue.ts +31 -4
- package/src/runtime/execution/state-lane.ts +7 -0
- package/src/runtime/foundation/operation-registry.ts +98 -20
- package/src/runtime/foundation/raw-service-mesh-runtime.ts +244 -67
- package/src/runtime/foundation/service-liveness-registry.ts +39 -0
- package/src/runtime/foundation/service-mailbox.ts +8 -0
- package/src/runtime/foundation/service-maintenance-runtime.ts +1 -8
- package/src/runtime/foundation/service-relocation-object-owner.ts +54 -37
- package/src/runtime/foundation/service-relocation-runtime.ts +7 -3
- package/src/runtime/foundation/service-runtime-contracts.ts +12 -1
- package/src/runtime/foundation/service-session-binding-ingress-port.ts +2 -1
- package/src/runtime/foundation/service-stateful-registry.ts +38 -35
- package/src/runtime/foundation/service-stateful-runtime.ts +667 -152
- package/src/runtime/foundation/service-stateful-wire-codec.ts +49 -11
- package/src/runtime/foundation/service-wire-binary-primitives.ts +35 -12
- package/src/runtime/foundation/service-wire-constants.generated.ts +1 -0
- package/src/runtime/foundation/service-wire-m6a-codec.ts +187 -51
- package/src/runtime/host/actor-packet-relay.ts +113 -94
- package/src/runtime/host/actor-placement-coordinator.ts +31 -8
- package/src/runtime/host/actor-transfer-runtime.ts +104 -430
- package/src/runtime/host/application-job-queue.ts +29 -44
- package/src/runtime/host/index.ts +286 -129
- package/src/runtime/host/location-runtime-owner.ts +2 -6
- package/src/runtime/host/mesh-router-resolver.ts +13 -5
- package/src/runtime/host/remote-bound-session-relay.ts +86 -248
- package/src/runtime/host/route-mesh-runtime.ts +11 -5
- package/src/runtime/host/runtime-shutdown.ts +15 -4
- package/src/runtime/host/service-relocation-host-runtime.ts +784 -475
- package/src/runtime/host/spot-runtime-options-factory.ts +18 -7
- package/src/runtime/host/user-spot-creation-coordinator.ts +41 -100
- package/src/runtime/locations/auto-connect-loop.ts +22 -14
- package/src/runtime/locations/auto-connect-reconciler.ts +0 -6
- package/src/runtime/locations/auto-connect-types.ts +0 -1
- package/src/runtime/locations/descriptor-publication.ts +7 -0
- package/src/runtime/locations/domain-store-contract.ts +5 -0
- package/src/runtime/locations/in-memory-authority-store.ts +85 -23
- package/src/runtime/locations/in-memory-location-store.ts +1 -12
- package/src/runtime/locations/index.ts +1 -0
- package/src/runtime/locations/lease-tracker.ts +2 -9
- package/src/runtime/locations/location-store-repository.ts +628 -152
- package/src/runtime/locations/relocation-blob.ts +75 -1
- package/src/runtime/locations/request-source-resolver.ts +138 -0
- package/src/runtime/locations/resolvers.ts +2 -2
- package/src/runtime/locations/runtime.ts +70 -40
- package/src/runtime/messaging/payload-codec.ts +8 -11
- package/src/runtime/messaging/request-result.ts +33 -29
- package/src/runtime/protocol/service_wire_codec.generated.ts +87 -4
- package/src/runtime/protocol/service_wire_pilot_codec.generated.ts +13 -10
- package/src/runtime/spots/formal-remote-actor-admission-registry.ts +3 -2
- package/src/runtime/spots/index.ts +375 -281
- package/src/runtime/spots/spot-activation-registry.ts +25 -13
- package/src/runtime/spots/spot-activation-state.ts +12 -19
- package/src/runtime/spots/spot-activation.ts +170 -86
- package/src/runtime/spots/spot-actor-admission-coordinator.ts +25 -55
- package/src/runtime/spots/spot-actor-membership.ts +0 -15
- package/src/runtime/spots/spot-actor-packet-dispatch.ts +56 -11
- package/src/runtime/spots/spot-actor-packet-drain.ts +9 -52
- package/src/runtime/spots/spot-entry-activation.ts +24 -19
- package/src/runtime/spots/spot-handler-registry.ts +15 -4
- package/src/runtime/spots/spot-manager-internal-contracts.ts +2 -2
- package/src/runtime/spots/spot-manager-public.ts +2 -2
- package/src/runtime/spots/spot-node-autoconnect.ts +22 -45
- package/src/runtime/spots/spot-node-runtime-manager.ts +197 -67
- package/src/runtime/spots/spot-outbound.ts +3 -3
- package/src/runtime/spots/spot-remote-codec.ts +9 -2
- package/src/runtime/spots/spot-runtime-ports.ts +0 -1
- package/src/runtime/spots/spot-serial-executor.ts +97 -25
- package/src/runtime/spots/spot-serial-turn-executor.ts +22 -3
- package/src/runtime/spots/spot-subscription-dispatch.ts +1 -1
- package/src/runtime/spots/spot-timer.ts +413 -157
- package/src/runtime/streams/actor-session-binding-registry.ts +236 -64
- package/src/runtime/streams/actor-session-binding-runtime-owner.ts +16 -8
- package/src/runtime/streams/bound-actor-relay-sender.ts +23 -9
- package/src/runtime/streams/bound-session-service.ts +7 -10
- package/src/runtime/streams/index.ts +12 -6
- package/src/runtime/streams/managed-stream.ts +4 -2
- package/src/runtime/streams/native-fallback-bound-session.ts +14 -103
- package/src/runtime/streams/session-actor-coordinator.ts +39 -88
- package/src/runtime/streams/stream-binding-runtime-ports.ts +3 -9
- package/src/runtime/streams/stream-session-runtime.ts +1 -5
- package/src/runtime/workers/index.ts +1 -1
|
@@ -3,8 +3,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.ZLinkUserSpotCreationCoordinator = exports.ZLinkHostSpotAddressTransport = exports.ZLinkRelocationStateIncompatibleError = exports.ZLinkRouteMeshRuntimeCoordinator = exports.ZLinkRetiringRollbackError = exports.ZLinkDrainingStatePublishError = exports.transferIdString = exports.ZLinkActorTransferAuthorityRuntime = exports.ZLinkFrameworkRuntimeHost = void 0;
|
|
4
4
|
exports.hasUnsupportedManualTopology = hasUnsupportedManualTopology;
|
|
5
5
|
exports.hasExactPeerReadiness = hasExactPeerReadiness;
|
|
6
|
+
const relocation_blob_1 = require("../locations/relocation-blob");
|
|
6
7
|
const application_job_queue_scope_1 = require("../application-jobs/application-job-queue-scope");
|
|
7
8
|
const location_store_pages_1 = require("../locations/location-store-pages");
|
|
9
|
+
const descriptor_publication_1 = require("../locations/descriptor-publication");
|
|
8
10
|
const stream_wire_1 = require("@zlink-systems/stream-wire");
|
|
9
11
|
const node_crypto_1 = require("node:crypto");
|
|
10
12
|
const node_util_1 = require("node:util");
|
|
@@ -20,6 +22,7 @@ const abort_1 = require("../abort");
|
|
|
20
22
|
const activation_admission_1 = require("../activation-admission");
|
|
21
23
|
const actors_1 = require("../actors");
|
|
22
24
|
const actor_message_follow_context_1 = require("../actors/actor-message-follow-context");
|
|
25
|
+
const actor_packet_relay_wire_1 = require("../actors/actor-packet-relay-wire");
|
|
23
26
|
const actor_transport_delivery_gate_1 = require("../actors/actor-transport-delivery-gate");
|
|
24
27
|
const admission_1 = require("../admission");
|
|
25
28
|
const application_job_queue_handler_start_gate_1 = require("../application-jobs/application-job-queue-handler-start-gate");
|
|
@@ -69,6 +72,8 @@ const spot_node_runtime_options_factory_1 = require("./spot-node-runtime-options
|
|
|
69
72
|
const spot_runtime_options_factory_1 = require("./spot-runtime-options-factory");
|
|
70
73
|
const stateful_authority_route_runtime_1 = require("./stateful-authority-route-runtime");
|
|
71
74
|
const user_spot_creation_coordinator_1 = require("./user-spot-creation-coordinator");
|
|
75
|
+
const spot_remote_route_codec_1 = require("../spots/spot-remote-route-codec");
|
|
76
|
+
const protocol_1 = require("../streams/protocol");
|
|
72
77
|
const HOST_SHUTDOWN_POLL_INTERVAL_MS = 100;
|
|
73
78
|
const HANDOFF_ACCEPTANCE_POLL_INTERVAL_MS = 10;
|
|
74
79
|
const DEFAULT_HOST_CONTROL_TIMEOUT_MS = 30_000;
|
|
@@ -146,6 +151,7 @@ class ZLinkFrameworkRuntimeHost {
|
|
|
146
151
|
routeMeshRuntime;
|
|
147
152
|
clientServerRuntime;
|
|
148
153
|
fanoutRuntime;
|
|
154
|
+
relocationStore;
|
|
149
155
|
routeMeshCoordinator;
|
|
150
156
|
constructor(options, internalOptions) {
|
|
151
157
|
this.options = options;
|
|
@@ -154,6 +160,11 @@ class ZLinkFrameworkRuntimeHost {
|
|
|
154
160
|
this.runtimeEventPublisher =
|
|
155
161
|
options.runtimeEventPublisher ?? new diagnostics_1.DefaultZLinkRuntimeEventPublisher();
|
|
156
162
|
this.metrics = new diagnostics_1.ZLinkRuntimeMetrics(options.registration.metrics?.meterProvider);
|
|
163
|
+
const relocationProvider = options.registration.locations.relocationStoreInstance;
|
|
164
|
+
this.relocationStore =
|
|
165
|
+
relocationProvider === undefined
|
|
166
|
+
? undefined
|
|
167
|
+
: new relocation_blob_1.ZLinkProviderRelocationRepository(relocationProvider, this.metrics);
|
|
157
168
|
const handlerStartGate = options.providerResolver?.get?.(application_job_queue_handler_start_gate_1.ZLINK_INTERNAL_APPLICATION_JOB_QUEUE_HANDLER_START_GATE);
|
|
158
169
|
this.applicationJobQueue = new application_job_queue_1.ApplicationJobQueue((0, application_job_queue_1.resolveApplicationJobQueueConfiguration)(options.registration.applicationJobQueue, () => (0, application_job_queue_1.nodeEffectiveProcessorCount)(options.registration.worker?.maxThreads)), undefined, handlerStartGate?.shouldHoldPermitBeforeHandler.bind(handlerStartGate), (error) => (this.errorSink ?? this.preStartErrorSink).reportRuntimeTaskException('logger-provider', error));
|
|
159
170
|
this.capacityStatus = new host_capacity_status_1.HostCapacityStatusProjection(options.registration.coreHwm, this.applicationJobQueue);
|
|
@@ -214,7 +225,7 @@ class ZLinkFrameworkRuntimeHost {
|
|
|
214
225
|
: this.boundSessionRelay.actorPackets.confirmRemoteSessionBinding(actor, sessionNode.status().routingId, sessionRid, signal, options);
|
|
215
226
|
},
|
|
216
227
|
relay: (actor, header, payload) => this.boundSessionRelay.actorPackets.relayActorPacket(actor, header, payload),
|
|
217
|
-
notifyDisconnected: (actor, signal) => this.boundSessionRelay.actorPackets.notifyBoundActorDisconnected(actor, signal)
|
|
228
|
+
notifyDisconnected: (actor, signal, binding) => this.boundSessionRelay.actorPackets.notifyBoundActorDisconnected(actor, signal, binding)
|
|
218
229
|
});
|
|
219
230
|
this.actorHandoff = new actors_1.ZLinkActorHandoffCoordinator({
|
|
220
231
|
routedTransport: this.routeTransport,
|
|
@@ -430,20 +441,11 @@ class ZLinkFrameworkRuntimeHost {
|
|
|
430
441
|
actorManager: () => this.actorManager,
|
|
431
442
|
primaryMeshNode: () => this.requirePrimaryMeshNode(),
|
|
432
443
|
notifyEntrySpotActorLeft: (actor, signal) => this.spotNodeRuntime?.notifyPrimaryEntrySpotActorLeft(actor, signal) ?? Promise.resolve(),
|
|
433
|
-
restoreEntrySpotActorJoined: (actor, signal) => this.spotNodeRuntime?.notifyPrimaryEntrySpotActorJoined(actor, signal) ?? Promise.resolve(),
|
|
434
444
|
locationLifecycle: () => this.locationOwner.currentLifecycle,
|
|
435
445
|
spotRouteResolver: () => this.createLocationSpotRouteResolver(),
|
|
436
446
|
actorHandoff: this.actorHandoff,
|
|
437
|
-
actorTransferRegistry: this.actorTransferRegistry,
|
|
438
447
|
authorityStore: () => this.locationOwner.currentStores?.locationStore,
|
|
439
448
|
currentOwner: () => this.locationOwner.currentRuntime?.currentOwnerToken,
|
|
440
|
-
liveDescriptors: (meshName, signal) => {
|
|
441
|
-
const runtime = this.locationOwner.currentRuntime;
|
|
442
|
-
if (runtime === undefined) {
|
|
443
|
-
throw new Error('Session owner liveness is unavailable without a Location runtime.');
|
|
444
|
-
}
|
|
445
|
-
return runtime.listLiveMeshNodes(meshName, signal);
|
|
446
|
-
},
|
|
447
449
|
sessionRelocationWire: () => this.serviceRelocation,
|
|
448
450
|
clearRemoteActorPacketTarget: (actorId) => this.boundSessionRelay.clearRemoteActorPacketTarget(actorId),
|
|
449
451
|
prepareApplicationJob: async (preparationSignal, origin) => {
|
|
@@ -495,13 +497,14 @@ class ZLinkFrameworkRuntimeHost {
|
|
|
495
497
|
};
|
|
496
498
|
},
|
|
497
499
|
reportPostCommitError: (error) => (this.errorSink ?? this.preStartErrorSink).reportRuntimeTaskException('source actor departure', error),
|
|
498
|
-
|
|
499
|
-
shutdownSignal: () => this.executionState?.abortController.signal,
|
|
500
|
-
metrics: this.metrics
|
|
500
|
+
shutdownSignal: () => this.executionState?.abortController.signal
|
|
501
501
|
});
|
|
502
502
|
this.serviceRelocation = new service_relocation_host_runtime_1.ZLinkHostServiceRelocationRuntime({
|
|
503
|
+
flowCreationEnabled: () => this.flowCreationEnabled(),
|
|
504
|
+
messageFlow: () => this.createDispatchErrorReporter(this.runtimeOrPreStartErrorSink).flow,
|
|
503
505
|
registration: options.registration,
|
|
504
506
|
targetAdmissionSealed: () => this.shutdownOperationStartedAt !== undefined,
|
|
507
|
+
requestPeerReconcile: (meshName, peerRid) => this.spotNodeRuntime?.requestPeerReconcile(meshName, peerRid) ?? Promise.resolve(),
|
|
505
508
|
sourceQuiescenceChanged: () => this.publishCurrentRuntimeStatus(),
|
|
506
509
|
providerResolver: options.providerResolver,
|
|
507
510
|
locationStore: () => this.locationOwner.currentStores?.locationStore,
|
|
@@ -512,11 +515,10 @@ class ZLinkFrameworkRuntimeHost {
|
|
|
512
515
|
meshNode: (meshName) => this.spotNodeRuntime?.meshNode(meshName),
|
|
513
516
|
completions: (meshName) => this.spotNodeRuntime?.meshCompletionTable(meshName),
|
|
514
517
|
spotManager: () => this.spotManager,
|
|
515
|
-
spotNodeRuntime: () => this.spotNodeRuntime,
|
|
516
518
|
actorManager: () => this.actorManager,
|
|
517
519
|
actorTransfer: this.actorTransferRuntime,
|
|
518
520
|
boundSessionRelocation: {
|
|
519
|
-
receiveSeal: (value, signal) => this.boundSessionRelay.boundSessions.receiveServiceWireSessionRelocationSeal(value, signal),
|
|
521
|
+
receiveSeal: (value, signal, onInstalled) => this.boundSessionRelay.boundSessions.receiveServiceWireSessionRelocationSeal(value, signal, onInstalled),
|
|
520
522
|
receiveRoute: (value) => this.boundSessionRelay.boundSessions.receiveServiceWireSessionRelocationRoute(value),
|
|
521
523
|
clear: () => this.boundSessionRelay.boundSessions.clearServiceWireSessionRelocations()
|
|
522
524
|
},
|
|
@@ -567,7 +569,7 @@ class ZLinkFrameworkRuntimeHost {
|
|
|
567
569
|
drainResources: (meshName, signal, stopStartingSignal) => this.performMeshDrain(meshName, signal, stopStartingSignal),
|
|
568
570
|
shutdownResources: (meshName, signal) => this.performMeshShutdown(meshName, signal),
|
|
569
571
|
cleanupHostResources: (signal) => this.cleanupOwnerForDrain(signal),
|
|
570
|
-
forceStopResources: (meshName) => this.
|
|
572
|
+
forceStopResources: (meshName, reason, signal) => this.performMeshShutdown(meshName, signal, reason)
|
|
571
573
|
});
|
|
572
574
|
this.metricRegistrations.push(this.metrics.registerHostState(() => runtimeStateMetricName(this.runtimeState)), this.metrics.registerHostCapacity(() => this.capacityStatus.snapshot(this.context?.getCoreHwmBudgetSnapshot())), this.metrics.registerApplicationJobQueuePressure(() => this.applicationJobQueue.snapshot()), this.metrics.registerMeshSnapshots(() => this.runtimeMetricMeshSnapshots()));
|
|
573
575
|
this.routeMeshRuntime = this.routeMeshCoordinator;
|
|
@@ -1016,7 +1018,6 @@ class ZLinkFrameworkRuntimeHost {
|
|
|
1016
1018
|
let spotNodeRuntime;
|
|
1017
1019
|
let streamRuntime;
|
|
1018
1020
|
let startedLocationRuntime;
|
|
1019
|
-
let statefulAuthorityRoutes;
|
|
1020
1021
|
try {
|
|
1021
1022
|
this.executionState = new execution_1.ZLinkFrameworkExecutionState(context);
|
|
1022
1023
|
// Seed the shared live-mode cell from the configured mode (default errorsOnly).
|
|
@@ -1039,18 +1040,13 @@ class ZLinkFrameworkRuntimeHost {
|
|
|
1039
1040
|
this.executionState.listenerTasks.push(...channelRuntime.start(this.executionState.taskRunner));
|
|
1040
1041
|
const locationRuntime = await this.locationOwner.startForRuntime(this.meshRouters.primaryMeshName(), spotNodeRuntime, channelRuntime, this.executionState.abortController.signal, () => this.shutdownDeadline.signal);
|
|
1041
1042
|
startedLocationRuntime = locationRuntime;
|
|
1042
|
-
if (locationRuntime !== undefined) {
|
|
1043
|
-
this.installOwnerLeaseRecoveryPublication(locationRuntime, spotNodeRuntime, channelRuntime);
|
|
1044
|
-
}
|
|
1045
1043
|
const locationStore = this.locationOwner.currentStores?.locationStore;
|
|
1046
1044
|
if (locationStore !== undefined && locationRuntime?.ownerLeaseUsable !== false) {
|
|
1047
|
-
await
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
this.statefulAuthorityRoutes = statefulAuthorityRoutes;
|
|
1053
|
-
}
|
|
1045
|
+
await this.publishOrStayPreparing(locationRuntime, async (publishSignal) => {
|
|
1046
|
+
await spotNodeRuntime.startLocationAutoConnect(publishSignal);
|
|
1047
|
+
await channelRuntime.startLocationAutoConnect(publishSignal);
|
|
1048
|
+
await spotNodeRuntime.publishMeshNodeState(contracts_1.ZLinkFrameworkRuntimeState.Preparing, publishSignal);
|
|
1049
|
+
});
|
|
1054
1050
|
}
|
|
1055
1051
|
streamRuntime = new streams_1.ZLinkStreamRuntimeManager({
|
|
1056
1052
|
listenerRecords,
|
|
@@ -1071,17 +1067,20 @@ class ZLinkFrameworkRuntimeHost {
|
|
|
1071
1067
|
});
|
|
1072
1068
|
streamRuntime.start();
|
|
1073
1069
|
this.streamRuntime = streamRuntime;
|
|
1070
|
+
// Location runtime §5: a host without an owner lease stays Preparing;
|
|
1071
|
+
// owner lease recovery enters Serving once it publishes descriptors.
|
|
1074
1072
|
if (locationRuntime === undefined || locationRuntime.ownerLeaseUsable) {
|
|
1075
|
-
await
|
|
1073
|
+
await this.publishOrStayPreparing(locationRuntime, (publishSignal) => this.enterServing(spotNodeRuntime, publishSignal));
|
|
1074
|
+
}
|
|
1075
|
+
if (locationRuntime !== undefined) {
|
|
1076
|
+
this.installOwnerLeaseRecoveryPublication(locationRuntime, spotNodeRuntime, channelRuntime);
|
|
1076
1077
|
}
|
|
1077
|
-
this.routeMeshCoordinator.markServing();
|
|
1078
|
-
this.setRuntimeState(contracts_1.ZLinkFrameworkRuntimeState.Serving);
|
|
1079
1078
|
this.lifecycleSink?.push('framework:started');
|
|
1080
1079
|
}
|
|
1081
1080
|
catch (error) {
|
|
1082
1081
|
if (this.shutdownDeadline !== undefined && (0, abort_1.isAbortError)(error))
|
|
1083
1082
|
throw error;
|
|
1084
|
-
await statefulAuthorityRoutes?.stop();
|
|
1083
|
+
await this.statefulAuthorityRoutes?.stop();
|
|
1085
1084
|
try {
|
|
1086
1085
|
await this.runWithShutdownDeadline(DEFAULT_HOST_CONTROL_TIMEOUT_MS, async () => (0, runtime_shutdown_1.rollbackRuntimeStart)({
|
|
1087
1086
|
context,
|
|
@@ -1127,7 +1126,9 @@ class ZLinkFrameworkRuntimeHost {
|
|
|
1127
1126
|
(options.pubSub?.manualConnections?.length ?? 0) > 0;
|
|
1128
1127
|
const hasDiscovery = hasConfiguredLocationStore(this.options.registration);
|
|
1129
1128
|
const source = hasManual && hasDiscovery ? 'manual_and_redis' : hasManual ? 'manual' : 'redis';
|
|
1130
|
-
const
|
|
1129
|
+
const capacity = descriptor === undefined
|
|
1130
|
+
? undefined
|
|
1131
|
+
: this.locationOwner.currentStores?.locationStore.confirmedCapacity?.({ meshName, rid: descriptor.rid }, descriptor.populationCapacity);
|
|
1131
1132
|
snapshots.push({
|
|
1132
1133
|
meshName,
|
|
1133
1134
|
source,
|
|
@@ -1139,9 +1140,9 @@ class ZLinkFrameworkRuntimeHost {
|
|
|
1139
1140
|
channelName: channel.channelName,
|
|
1140
1141
|
readyMembers: channel.readyTargetCount
|
|
1141
1142
|
})),
|
|
1142
|
-
actorCapacity:
|
|
1143
|
-
spotCapacity:
|
|
1144
|
-
spotTypeCapacities: (
|
|
1143
|
+
actorCapacity: capacity?.actors,
|
|
1144
|
+
spotCapacity: capacity?.spots,
|
|
1145
|
+
spotTypeCapacities: (capacity?.spotTypes ?? []).map((capacity) => ({
|
|
1145
1146
|
spotKind: capacity.objectKind === 'instance_spot' ? 'instance' : 'user',
|
|
1146
1147
|
stableType: capacity.stableType,
|
|
1147
1148
|
active: capacity.active,
|
|
@@ -1193,12 +1194,21 @@ class ZLinkFrameworkRuntimeHost {
|
|
|
1193
1194
|
}
|
|
1194
1195
|
}
|
|
1195
1196
|
installOwnerLeaseRecoveryPublication(runtime, spotNodeRuntime, channelRuntime) {
|
|
1196
|
-
|
|
1197
|
+
let recoveryOperation;
|
|
1198
|
+
const handler = (_renewal, wasOwnerLeaseUsable) => {
|
|
1197
1199
|
if (!this.ownerAdmissionOpen())
|
|
1198
1200
|
return;
|
|
1199
|
-
|
|
1201
|
+
if (wasOwnerLeaseUsable && this.runtimeState !== contracts_1.ZLinkFrameworkRuntimeState.Preparing)
|
|
1202
|
+
return;
|
|
1203
|
+
if (recoveryOperation !== undefined)
|
|
1204
|
+
return;
|
|
1205
|
+
recoveryOperation = this.resumeOwnerLeaseOwnedWork(runtime, spotNodeRuntime, channelRuntime)
|
|
1206
|
+
.catch((error) => {
|
|
1200
1207
|
runtime.closeOwnerLeaseAdmission(error);
|
|
1201
1208
|
this.runtimeOrPreStartErrorSink.reportRuntimeTaskException('owner lease recovery', error);
|
|
1209
|
+
})
|
|
1210
|
+
.finally(() => {
|
|
1211
|
+
recoveryOperation = undefined;
|
|
1202
1212
|
});
|
|
1203
1213
|
};
|
|
1204
1214
|
this.ownerLeaseRecoveryRuntime = runtime;
|
|
@@ -1208,30 +1218,64 @@ class ZLinkFrameworkRuntimeHost {
|
|
|
1208
1218
|
async resumeOwnerLeaseOwnedWork(runtime, spotNodeRuntime, channelRuntime) {
|
|
1209
1219
|
if (!this.ownerAdmissionOpen())
|
|
1210
1220
|
return;
|
|
1211
|
-
|
|
1212
|
-
|
|
1221
|
+
await this.publishOrStayPreparing(runtime, async (signal) => {
|
|
1222
|
+
await spotNodeRuntime.publishMeshNodeState(contracts_1.ZLinkFrameworkRuntimeState.Preparing, signal);
|
|
1223
|
+
if (runtime.ownerLeaseUsable === false)
|
|
1224
|
+
return;
|
|
1225
|
+
if (this.runtimeState !== contracts_1.ZLinkFrameworkRuntimeState.Preparing) {
|
|
1226
|
+
await spotNodeRuntime.publishMeshNodeState(this.runtimeState, signal);
|
|
1227
|
+
}
|
|
1228
|
+
await spotNodeRuntime.startLocationAutoConnect(signal);
|
|
1229
|
+
await channelRuntime.startLocationAutoConnect(signal);
|
|
1230
|
+
await channelRuntime.reclaimLocationOwnerRows(signal);
|
|
1231
|
+
await this.locationOwner.currentLifecycle?.reclaimOwnerRows();
|
|
1232
|
+
if (this.runtimeState === contracts_1.ZLinkFrameworkRuntimeState.Preparing) {
|
|
1233
|
+
await this.enterServing(spotNodeRuntime, signal);
|
|
1234
|
+
}
|
|
1235
|
+
});
|
|
1236
|
+
}
|
|
1237
|
+
// The one transition from Preparing to Serving: the host publishes its
|
|
1238
|
+
// Serving descriptors first, then takes new application work.
|
|
1239
|
+
async enterServing(spotNodeRuntime, signal) {
|
|
1213
1240
|
const store = this.locationOwner.currentStores?.locationStore;
|
|
1214
|
-
if (
|
|
1215
|
-
store
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1241
|
+
if (store !== undefined) {
|
|
1242
|
+
await this.startStatefulAuthority(store, spotNodeRuntime, signal);
|
|
1243
|
+
}
|
|
1244
|
+
await spotNodeRuntime.publishMeshNodeState(contracts_1.ZLinkFrameworkRuntimeState.Serving, signal);
|
|
1245
|
+
this.routeMeshCoordinator.markServing();
|
|
1246
|
+
this.setRuntimeState(contracts_1.ZLinkFrameworkRuntimeState.Serving);
|
|
1247
|
+
}
|
|
1248
|
+
// Location runtime §5: a startup publication the Store does not confirm (a
|
|
1249
|
+
// provider error, or no answer within the renew timeout) leaves the host in
|
|
1250
|
+
// Preparing. The owner lease renewal handler retries publication while the
|
|
1251
|
+
// host stays Preparing; only a settled rejection fails startup.
|
|
1252
|
+
async publishOrStayPreparing(runtime, publish) {
|
|
1253
|
+
const signal = this.executionState?.abortController.signal;
|
|
1254
|
+
try {
|
|
1255
|
+
await publish(signal);
|
|
1256
|
+
return true;
|
|
1257
|
+
}
|
|
1258
|
+
catch (error) {
|
|
1259
|
+
if (runtime === undefined || !(error instanceof descriptor_publication_1.ZLinkDescriptorPublicationUnconfirmedError))
|
|
1260
|
+
throw error;
|
|
1261
|
+
this.runtimeOrPreStartErrorSink.reportRuntimeTaskException('startup descriptor publication', error);
|
|
1262
|
+
return false;
|
|
1263
|
+
}
|
|
1264
|
+
}
|
|
1265
|
+
async startStatefulAuthority(locationStore, spotNodeRuntime, signal) {
|
|
1266
|
+
if (this.statefulAuthorityRoutes !== undefined || !this.requiresStatefulAuthorityRuntime()) {
|
|
1223
1267
|
return;
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
await
|
|
1228
|
-
|
|
1268
|
+
}
|
|
1269
|
+
this.installLocationBackedAuthorities(locationStore, spotNodeRuntime);
|
|
1270
|
+
const routes = this.createStatefulAuthorityRoutes(locationStore, spotNodeRuntime);
|
|
1271
|
+
await routes.start(signal);
|
|
1272
|
+
this.statefulAuthorityRoutes = routes;
|
|
1229
1273
|
}
|
|
1230
1274
|
createStatefulAuthorityRoutes(locationStore, spotNodeRuntime) {
|
|
1231
1275
|
return new stateful_authority_route_runtime_1.ZLinkStatefulAuthorityRouteRuntime({
|
|
1232
1276
|
store: locationStore,
|
|
1233
1277
|
creationStore: locationStore,
|
|
1234
|
-
relocationStore: this.
|
|
1278
|
+
relocationStore: this.relocationStore,
|
|
1235
1279
|
meshNodes: spotNodeRuntime.meshNodesByName,
|
|
1236
1280
|
pollingIntervalMs: this.options.registration.locations.options.pollingIntervalMs ??
|
|
1237
1281
|
Locations_1.zlinkDefaultLocationOptions.pollingIntervalMs,
|
|
@@ -1260,7 +1304,7 @@ class ZLinkFrameworkRuntimeHost {
|
|
|
1260
1304
|
activationNode.registerAsyncInstanceActivationAuthority?.(new instance_activation_authority_1.ZLinkInstanceActivationAuthority({
|
|
1261
1305
|
store: locationStore,
|
|
1262
1306
|
relocationPolicy: (stableType) => this.options.registration.spotNodes.get(meshName)?.instanceSpotFactoryRegistrations?.[stableType]?.relocation.kind,
|
|
1263
|
-
relocationStore: this.
|
|
1307
|
+
relocationStore: this.relocationStore,
|
|
1264
1308
|
meshName,
|
|
1265
1309
|
owner: () => this.locationOwner.currentRuntime?.currentOwnerToken,
|
|
1266
1310
|
metrics: this.metrics,
|
|
@@ -1308,7 +1352,16 @@ class ZLinkFrameworkRuntimeHost {
|
|
|
1308
1352
|
async performMeshDrain(meshName, signal, stopStartingSignal) {
|
|
1309
1353
|
await this.serviceRelocation.relocateMesh(meshName, this.relocationTargetApplicationVersion, signal, stopStartingSignal);
|
|
1310
1354
|
}
|
|
1311
|
-
async performMeshShutdown(meshName, signal) {
|
|
1355
|
+
async performMeshShutdown(meshName, signal, forceReason) {
|
|
1356
|
+
if (forceReason !== undefined) {
|
|
1357
|
+
this.spotNodeRuntime
|
|
1358
|
+
?.meshNode(meshName)
|
|
1359
|
+
?.cancelPendingOperations?.((0, framework_errors_internal_1.createInternalFrameworkException)(framework_errors_internal_1.ZLinkFrameworkInternalErrorKind.RuntimeShutdown, 'The host stopped before the request completed.'));
|
|
1360
|
+
await waitForForcedSessionNotification(this.streamRuntime?.notifyServerDrain(meshName));
|
|
1361
|
+
}
|
|
1362
|
+
else {
|
|
1363
|
+
await awaitWithDrainSignal(this.serviceRelocation.drainActorJoinSources(meshName), signal);
|
|
1364
|
+
}
|
|
1312
1365
|
await this.spotManager?.drainForShutdown(meshName, signal, this.runtimeDeadline);
|
|
1313
1366
|
await awaitWithDrainSignal(this.streamRuntime?.notifyServerDrain(meshName), signal);
|
|
1314
1367
|
}
|
|
@@ -1419,10 +1472,6 @@ class ZLinkFrameworkRuntimeHost {
|
|
|
1419
1472
|
throw new locations_1.ZLinkOwnerCleanupError(error);
|
|
1420
1473
|
}
|
|
1421
1474
|
}
|
|
1422
|
-
async forceStopMesh(meshName) {
|
|
1423
|
-
await waitForForcedSessionNotification(this.streamRuntime?.notifyServerDrain(meshName));
|
|
1424
|
-
await this.spotManager?.drainForShutdown(meshName, undefined, this.runtimeDeadline);
|
|
1425
|
-
}
|
|
1426
1475
|
registerInstanceApplicationLifecycle(meshName, node, spotManager) {
|
|
1427
1476
|
const activationNode = node;
|
|
1428
1477
|
activationNode.registerInstanceApplicationLifecycle?.({
|
|
@@ -1430,7 +1479,8 @@ class ZLinkFrameworkRuntimeHost {
|
|
|
1430
1479
|
isMaterializing: (target) => spotManager.isInstanceMaterializing(meshName, target.targetSpotId),
|
|
1431
1480
|
isIdleEvicting: (target) => spotManager.isInstanceSpotIdleEvicting(meshName, target.targetSpotId),
|
|
1432
1481
|
beginIdleEviction: (target) => spotManager.beginInstanceSpotIdleEviction(meshName, target.targetSpotId),
|
|
1433
|
-
materialize: (target, objectGeneration) => spotManager.materializeInstance(meshName, target.stableType, target.targetSpotId, objectGeneration, this.executionState?.abortController.signal),
|
|
1482
|
+
materialize: (target, objectGeneration) => spotManager.materializeInstance(meshName, target.stableType, target.targetSpotId, objectGeneration, this.executionState?.abortController.signal, 'first-terminal'),
|
|
1483
|
+
publish: (target) => spotManager.publishInstance(target, meshName),
|
|
1434
1484
|
discard: (target) => spotManager.discardInstance(meshName, target.targetSpotId),
|
|
1435
1485
|
beginTerminal: (target) => spotManager.beginInstanceTerminal(meshName, target.targetSpotId, target.objectGeneration),
|
|
1436
1486
|
completeTerminal: (target) => spotManager.completeInstanceTerminal(meshName, target.targetSpotId, target.objectGeneration)
|
|
@@ -1567,8 +1617,8 @@ class ZLinkFrameworkRuntimeHost {
|
|
|
1567
1617
|
descriptor.objectRole === 'server' &&
|
|
1568
1618
|
descriptor.placementWeight > 0 &&
|
|
1569
1619
|
descriptor.entrySpotId !== undefined &&
|
|
1570
|
-
excludedNodeRids?.has(
|
|
1571
|
-
capability
|
|
1620
|
+
excludedNodeRids?.has((0, routing_id_1.encodeRoutingIdStorageHex)(descriptor.rid)) !== true &&
|
|
1621
|
+
capability?.entryAccepted === true);
|
|
1572
1622
|
});
|
|
1573
1623
|
if (selected === undefined)
|
|
1574
1624
|
return undefined;
|
|
@@ -1587,7 +1637,7 @@ class ZLinkFrameworkRuntimeHost {
|
|
|
1587
1637
|
ownerId: selected.ownerId,
|
|
1588
1638
|
leaseGeneration: selected.leaseGeneration
|
|
1589
1639
|
},
|
|
1590
|
-
isLocal:
|
|
1640
|
+
isLocal: (0, routing_id_1.routingIdsEqual)(localStatus.routingId, selected.rid) &&
|
|
1591
1641
|
localStatus.lifecycleGeneration === selected.lifecycleGeneration
|
|
1592
1642
|
};
|
|
1593
1643
|
}
|
|
@@ -1649,7 +1699,7 @@ class ZLinkFrameworkRuntimeHost {
|
|
|
1649
1699
|
return (descriptor.state === 1 &&
|
|
1650
1700
|
descriptor.objectRole === 'server' &&
|
|
1651
1701
|
descriptor.placementWeight > 0 &&
|
|
1652
|
-
excludedNodeRids?.has(
|
|
1702
|
+
excludedNodeRids?.has((0, routing_id_1.encodeRoutingIdStorageHex)(descriptor.rid)) !== true &&
|
|
1653
1703
|
(spots.limit === 0 || spots.active + spots.reserved < spots.limit) &&
|
|
1654
1704
|
capability !== undefined &&
|
|
1655
1705
|
(spotTypeCapacity === undefined ||
|
|
@@ -1668,7 +1718,7 @@ class ZLinkFrameworkRuntimeHost {
|
|
|
1668
1718
|
leaseGeneration: selected.leaseGeneration
|
|
1669
1719
|
},
|
|
1670
1720
|
isLocal: localStatus !== undefined &&
|
|
1671
|
-
|
|
1721
|
+
(0, routing_id_1.routingIdsEqual)(localStatus.routingId, selected.rid) &&
|
|
1672
1722
|
localStatus.lifecycleGeneration === selected.lifecycleGeneration
|
|
1673
1723
|
};
|
|
1674
1724
|
}
|
|
@@ -1750,6 +1800,13 @@ class ZLinkFrameworkRuntimeHost {
|
|
|
1750
1800
|
throw new ConfigurationException_1.ZLinkConfigurationException('Actor placement target runtime is not initialized.');
|
|
1751
1801
|
}
|
|
1752
1802
|
return await actorPlacement.handleRemoteCreate(record, async (requestPayload, authority, createSignal) => {
|
|
1803
|
+
const registration = this.options.registration.spotNodes.get(meshName);
|
|
1804
|
+
if (registration === undefined ||
|
|
1805
|
+
!(0, spots_1.registrationAcceptsNewActor)(registration, record.stableType)) {
|
|
1806
|
+
// Framework failure before the callback (Actor model §6.3): the reservation is
|
|
1807
|
+
// cancelled and the requester excludes this host run.
|
|
1808
|
+
throw (0, framework_errors_internal_1.createInternalFrameworkException)(framework_errors_internal_1.ZLinkFrameworkInternalErrorKind.RouteNotConnected, `RouteMesh '${meshName}' registers no Entry Spot type that accepts Actor type '${record.stableType}'.`);
|
|
1809
|
+
}
|
|
1753
1810
|
const request = (0, creation_payload_codec_1.decodeFrameworkCreationPayload)(requestPayload, this.options.registration.messageSerializers);
|
|
1754
1811
|
const entrySpotId = this.spotNodeRuntime?.meshNodeDescriptor(meshName)?.entrySpotId;
|
|
1755
1812
|
if (entrySpotId === undefined) {
|
|
@@ -1781,7 +1838,7 @@ class ZLinkFrameworkRuntimeHost {
|
|
|
1781
1838
|
};
|
|
1782
1839
|
}
|
|
1783
1840
|
if (local.actorRef.objectGeneration !== authority.objectGeneration ||
|
|
1784
|
-
|
|
1841
|
+
!(0, routing_id_1.routingIdsEqual)(local.actorRef.nodeRid, record.reservation.targetNodeRid)) {
|
|
1785
1842
|
throw (0, framework_errors_internal_1.createInternalFrameworkException)(framework_errors_internal_1.ZLinkFrameworkInternalErrorKind.ActorCreateFailed, `Actor '${record.actorId}' native authority does not match its placement reservation.`);
|
|
1786
1843
|
}
|
|
1787
1844
|
let reply;
|
|
@@ -1834,7 +1891,7 @@ class ZLinkFrameworkRuntimeHost {
|
|
|
1834
1891
|
},
|
|
1835
1892
|
isLocalNode: (meshName, nodeRid) => {
|
|
1836
1893
|
const status = this.spotNodeRuntime?.meshNode(meshName)?.status();
|
|
1837
|
-
return status !== undefined &&
|
|
1894
|
+
return status !== undefined && (0, routing_id_1.routingIdsEqual)(status.routingId, nodeRid);
|
|
1838
1895
|
},
|
|
1839
1896
|
remoteClose: (meshName, targetNodeRid, request, timeoutMs) => {
|
|
1840
1897
|
const node = this.spotNodeRuntime?.meshNode(meshName);
|
|
@@ -1982,14 +2039,14 @@ class ZLinkFrameworkRuntimeHost {
|
|
|
1982
2039
|
activationConcurrency: (meshName) => this.activationAdmission.current(meshName)
|
|
1983
2040
|
};
|
|
1984
2041
|
}
|
|
1985
|
-
dispatchMeshNodeRecord(meshName, record, signal) {
|
|
2042
|
+
dispatchMeshNodeRecord(meshName, record, signal, admit) {
|
|
1986
2043
|
const control = this.serviceRelocation.tryHandleControl(meshName, record, signal);
|
|
1987
2044
|
if (control instanceof Promise)
|
|
1988
|
-
return control.then((handled) => handled ? undefined : this.dispatchMeshNodePayload(meshName, record, signal));
|
|
2045
|
+
return control.then((handled) => handled ? undefined : this.dispatchMeshNodePayload(meshName, record, signal, admit));
|
|
1989
2046
|
if (!control)
|
|
1990
|
-
return this.dispatchMeshNodePayload(meshName, record, signal);
|
|
2047
|
+
return this.dispatchMeshNodePayload(meshName, record, signal, admit);
|
|
1991
2048
|
}
|
|
1992
|
-
dispatchMeshNodePayload(meshName, record, signal) {
|
|
2049
|
+
dispatchMeshNodePayload(meshName, record, signal, admit) {
|
|
1993
2050
|
if (record.kind === service_runtime_contracts_1.ReceiveKind.NodeRequest && record.parts.length === 1) {
|
|
1994
2051
|
const terminal = (0, actors_1.decodeRemoteActorSourceLeaveTerminal)(record.parts[0].data());
|
|
1995
2052
|
if (terminal !== undefined) {
|
|
@@ -2000,7 +2057,7 @@ class ZLinkFrameworkRuntimeHost {
|
|
|
2000
2057
|
if (channelRuntime === undefined) {
|
|
2001
2058
|
throw new ConfigurationException_1.ZLinkConfigurationException('MeshNode node-direct dispatch requires the channel runtime.');
|
|
2002
2059
|
}
|
|
2003
|
-
return channelRuntime.dispatchMeshRoute(meshName, record, signal);
|
|
2060
|
+
return channelRuntime.dispatchMeshRoute(meshName, record, signal, admit);
|
|
2004
2061
|
}
|
|
2005
2062
|
async completeFormalSourceLeave(record, terminal) {
|
|
2006
2063
|
const completed = await this.spotManager?.completeFormalSourceLeaveTerminal(terminal.actorId, terminal.transferId, terminal.succeeded);
|
|
@@ -2033,21 +2090,21 @@ class ZLinkFrameworkRuntimeHost {
|
|
|
2033
2090
|
if (channelRuntime === undefined) {
|
|
2034
2091
|
throw new ConfigurationException_1.ZLinkConfigurationException('MeshNode channel dispatch requires the channel runtime.');
|
|
2035
2092
|
}
|
|
2036
|
-
return
|
|
2093
|
+
return channelRuntime.dispatchMeshChannel(meshName, record, signal, (dispatch, onRejected) => this.admitMeshDispatch(meshName, record, 'RouteMesh channel dispatch', dispatch, onRejected));
|
|
2037
2094
|
}
|
|
2038
2095
|
case service_runtime_contracts_1.ReceiveKind.NodeSend:
|
|
2039
2096
|
case service_runtime_contracts_1.ReceiveKind.NodeRequest: {
|
|
2040
|
-
return this.
|
|
2097
|
+
return this.dispatchMeshNodeRecord(meshName, record, signal, (dispatch, onRejected) => this.admitMeshDispatch(meshName, record, 'RouteMesh node dispatch', dispatch, onRejected));
|
|
2041
2098
|
}
|
|
2042
2099
|
case service_runtime_contracts_1.ReceiveKind.SpotSend:
|
|
2043
2100
|
case service_runtime_contracts_1.ReceiveKind.SpotRequest:
|
|
2044
2101
|
case service_runtime_contracts_1.ReceiveKind.SpotMulticast:
|
|
2045
|
-
return this.
|
|
2102
|
+
return this.dispatchMeshSpotRecord(meshName, owner, record, (dispatch, onRejected) => this.admitMeshDispatch(meshName, record, 'RouteMesh Spot dispatch', dispatch, onRejected));
|
|
2046
2103
|
case service_runtime_contracts_1.ReceiveKind.InstanceSpotActivation:
|
|
2047
2104
|
if (this.spotManager === undefined) {
|
|
2048
2105
|
throw new ConfigurationException_1.ZLinkConfigurationException('MeshNode Instance Spot dispatch requires the Spot manager.');
|
|
2049
2106
|
}
|
|
2050
|
-
return this.
|
|
2107
|
+
return this.spotManager.dispatchMeshInstance(meshName, owner, record, (dispatch, onRejected) => this.admitMeshDispatch(meshName, record, 'RouteMesh Instance Spot dispatch', dispatch, onRejected));
|
|
2051
2108
|
case service_runtime_contracts_1.ReceiveKind.SpotControl:
|
|
2052
2109
|
if (this.spotManager === undefined) {
|
|
2053
2110
|
throw new ConfigurationException_1.ZLinkConfigurationException('MeshNode Spot control dispatch requires the Spot manager.');
|
|
@@ -2058,13 +2115,32 @@ class ZLinkFrameworkRuntimeHost {
|
|
|
2058
2115
|
if (this.spotManager === undefined) {
|
|
2059
2116
|
throw new ConfigurationException_1.ZLinkConfigurationException('MeshNode Actor dispatch requires the Spot manager.');
|
|
2060
2117
|
}
|
|
2061
|
-
return this.
|
|
2118
|
+
return this.spotManager.dispatchMeshActor(applicationJobOrigin(), meshName, owner, record, (dispatch, onRejected) => this.admitMeshDispatch(meshName, record, 'RouteMesh Actor dispatch', dispatch, onRejected));
|
|
2062
2119
|
case service_runtime_contracts_1.ReceiveKind.SendReady:
|
|
2063
2120
|
return Promise.resolve();
|
|
2064
2121
|
default:
|
|
2065
2122
|
throw new ConfigurationException_1.ZLinkConfigurationException(`MeshNode record kind '${record.kind}' does not yet have a registered framework consumer.`);
|
|
2066
2123
|
}
|
|
2067
2124
|
}
|
|
2125
|
+
admitMeshDispatch(meshName, record, operation, dispatch, onRejected) {
|
|
2126
|
+
// Execution gate §13 and host relocation §14 keep control progress independent
|
|
2127
|
+
// of new application admission. Disconnect callbacks still use their owner gate.
|
|
2128
|
+
if (record.domain === service_runtime_contracts_1.ReadyDomain.Infrastructure)
|
|
2129
|
+
return dispatch();
|
|
2130
|
+
if (!this.admission.accepts(meshName) &&
|
|
2131
|
+
(record.kind === service_runtime_contracts_1.ReceiveKind.NodeSend ||
|
|
2132
|
+
record.kind === service_runtime_contracts_1.ReceiveKind.NodeRequest ||
|
|
2133
|
+
record.kind === service_runtime_contracts_1.ReceiveKind.SpotSend ||
|
|
2134
|
+
record.kind === service_runtime_contracts_1.ReceiveKind.SpotRequest)) {
|
|
2135
|
+
const relay = (0, spot_remote_route_codec_1.decodeRemoteActorPacketRelay)(record.parts, { serializers: this.options.registration.messageSerializers }, this.flowCreationEnabled());
|
|
2136
|
+
if (relay !== undefined &&
|
|
2137
|
+
(0, protocol_1.decodeStreamHeader)(Buffer.from(relay.header, 'base64'), this.flowCreationEnabled()).name ===
|
|
2138
|
+
actor_packet_relay_wire_1.ZLINK_REMOTE_ACTOR_SESSION_DISCONNECTED_PACKET) {
|
|
2139
|
+
return dispatch();
|
|
2140
|
+
}
|
|
2141
|
+
}
|
|
2142
|
+
return this.admission.run(meshName, operation, dispatch, onRejected);
|
|
2143
|
+
}
|
|
2068
2144
|
async dispatchMeshActorBinding(meshName, record, signal) {
|
|
2069
2145
|
if (record.kindData?.kind !== 'actorBinding') {
|
|
2070
2146
|
throw new ConfigurationException_1.ZLinkConfigurationException('MeshNode Actor binding record has no binding generation.');
|
|
@@ -2078,7 +2154,7 @@ class ZLinkFrameworkRuntimeHost {
|
|
|
2078
2154
|
};
|
|
2079
2155
|
const replyBindingSuccess = () => {
|
|
2080
2156
|
if (record.reply(Buffer.alloc(0)) !== runtime_values_1.SubmitResult.Ok) {
|
|
2081
|
-
throw
|
|
2157
|
+
throw (0, framework_errors_internal_1.createInternalFrameworkException)(framework_errors_internal_1.ZLinkFrameworkInternalErrorKind.ActorLocationStale, `MeshNode Actor binding target '${binding.actor.actorId}' acknowledgement failed.`);
|
|
2082
2158
|
}
|
|
2083
2159
|
};
|
|
2084
2160
|
const state = this.actorManager?.getState(binding.actor.actorId);
|
|
@@ -2128,7 +2204,8 @@ class ZLinkFrameworkRuntimeHost {
|
|
|
2128
2204
|
replyBindingFailure(framework_errors_internal_1.ZLinkFrameworkInternalErrorKind.ActorLocationStale);
|
|
2129
2205
|
return;
|
|
2130
2206
|
}
|
|
2131
|
-
|
|
2207
|
+
replyBindingSuccess();
|
|
2208
|
+
state.installBoundSessionBinding({
|
|
2132
2209
|
...target,
|
|
2133
2210
|
sessionNodeRid: binding.sessionNodeRid,
|
|
2134
2211
|
sessionRid: binding.sessionRid,
|
|
@@ -2137,11 +2214,6 @@ class ZLinkFrameworkRuntimeHost {
|
|
|
2137
2214
|
sessionOwnerLeaseGeneration: binding.sessionOwnerLeaseGeneration,
|
|
2138
2215
|
bindingGeneration: binding.bindingGeneration
|
|
2139
2216
|
});
|
|
2140
|
-
if (!installed) {
|
|
2141
|
-
replyBindingFailure(framework_errors_internal_1.ZLinkFrameworkInternalErrorKind.ActorLocationStale);
|
|
2142
|
-
return;
|
|
2143
|
-
}
|
|
2144
|
-
replyBindingSuccess();
|
|
2145
2217
|
return Promise.resolve();
|
|
2146
2218
|
}
|
|
2147
2219
|
submitLocalMeshRoute(meshName, sourceNodeRid, parts) {
|
|
@@ -2190,7 +2262,7 @@ class ZLinkFrameworkRuntimeHost {
|
|
|
2190
2262
|
}
|
|
2191
2263
|
return { status: submission_result_1.ZLinkSubmitStatus.Submitted };
|
|
2192
2264
|
}
|
|
2193
|
-
async dispatchMeshSpotRecord(meshName, owner, record) {
|
|
2265
|
+
async dispatchMeshSpotRecord(meshName, owner, record, admit) {
|
|
2194
2266
|
const envelope = (0, channel_envelope_1.decodeChannelEnvelope)(record.parts, undefined, this.flowCreationEnabled());
|
|
2195
2267
|
if (envelope.packetName === actors_1.ZLINK_REMOTE_ACTOR_PACKET_RELAY_PACKET) {
|
|
2196
2268
|
const payload = (0, channel_envelope_1.decodeChannelPayload)(envelope, {
|
|
@@ -2205,26 +2277,28 @@ class ZLinkFrameworkRuntimeHost {
|
|
|
2205
2277
|
correlationId: envelope.header.correlationId ?? undefined
|
|
2206
2278
|
};
|
|
2207
2279
|
try {
|
|
2208
|
-
const
|
|
2209
|
-
|
|
2210
|
-
record.
|
|
2211
|
-
|
|
2280
|
+
const dispatch = async () => {
|
|
2281
|
+
const response = await this.boundSessionRelay.actorPackets.receiveRemoteActorPacketRelay(payload, context);
|
|
2282
|
+
if (record.kind === service_runtime_contracts_1.ReceiveKind.SpotRequest)
|
|
2283
|
+
record.reply((0, channel_envelope_1.encodeChannelReplyParts)(envelope.header, response));
|
|
2284
|
+
};
|
|
2285
|
+
await (admit === undefined ? dispatch() : admit(dispatch));
|
|
2212
2286
|
}
|
|
2213
2287
|
catch (error) {
|
|
2214
2288
|
if (record.kind !== service_runtime_contracts_1.ReceiveKind.SpotRequest) {
|
|
2215
2289
|
throw error;
|
|
2216
2290
|
}
|
|
2217
|
-
record.reply((0, channel_envelope_1.encodeChannelErrorReplyParts)(envelope.header, error
|
|
2291
|
+
record.reply((0, channel_envelope_1.encodeChannelErrorReplyParts)(envelope.header, error));
|
|
2218
2292
|
}
|
|
2219
2293
|
return;
|
|
2220
2294
|
}
|
|
2221
|
-
if ((await this.spotNodeRuntime?.dispatchEntrySpotRecord(meshName, owner, record)) === true) {
|
|
2295
|
+
if ((await this.spotNodeRuntime?.dispatchEntrySpotRecord(meshName, owner, record, admit)) === true) {
|
|
2222
2296
|
return;
|
|
2223
2297
|
}
|
|
2224
2298
|
if (this.spotManager === undefined) {
|
|
2225
2299
|
throw new ConfigurationException_1.ZLinkConfigurationException('MeshNode Spot dispatch requires the Spot manager.');
|
|
2226
2300
|
}
|
|
2227
|
-
await this.spotManager.dispatchMeshSpot(meshName, owner, record);
|
|
2301
|
+
await this.spotManager.dispatchMeshSpot(meshName, owner, record, admit);
|
|
2228
2302
|
}
|
|
2229
2303
|
createDispatchErrorReporter(errorSink) {
|
|
2230
2304
|
const existing = this.dispatchErrorReporters.get(errorSink);
|
|
@@ -2255,7 +2329,7 @@ class ZLinkFrameworkRuntimeHost {
|
|
|
2255
2329
|
const mode = this.executionState === undefined
|
|
2256
2330
|
? (this.options.registration.dispatch?.diagnostics.messageFlow ?? 'errors')
|
|
2257
2331
|
: this.messageFlowModeCell.mode;
|
|
2258
|
-
return mode
|
|
2332
|
+
return (0, diagnostics_1.messageFlowTracingEnabled)(mode);
|
|
2259
2333
|
}
|
|
2260
2334
|
runLifecycle(operation) {
|
|
2261
2335
|
const current = (0, diagnostics_1.currentOrCreateFlow)('Lifecycle', false);
|
|
@@ -2324,7 +2398,7 @@ function hasConfiguredLocationStore(registration) {
|
|
|
2324
2398
|
return (registration.locations.useInMemoryStores || registration.locations.storeInstance !== undefined);
|
|
2325
2399
|
}
|
|
2326
2400
|
function hasExactPeerReadiness(descriptors, local, peers) {
|
|
2327
|
-
const replacementDescriptors = descriptors.filter((descriptor) => !(
|
|
2401
|
+
const replacementDescriptors = descriptors.filter((descriptor) => !((0, routing_id_1.routingIdsEqual)(descriptor.rid, (0, routing_id_1.toBackendRoutingId)(local.routingId)) &&
|
|
2328
2402
|
descriptor.lifecycleGeneration === local.lifecycleGeneration) &&
|
|
2329
2403
|
descriptor.state === contracts_1.ZLinkFrameworkRuntimeState.Serving &&
|
|
2330
2404
|
local.applicationVersion !== undefined &&
|
|
@@ -2333,7 +2407,7 @@ function hasExactPeerReadiness(descriptors, local, peers) {
|
|
|
2333
2407
|
(local.maintenanceWave === undefined || descriptor.maintenanceWave !== local.maintenanceWave));
|
|
2334
2408
|
return (replacementDescriptors.length > 0 &&
|
|
2335
2409
|
replacementDescriptors.some((descriptor) => peers.some((peer) => peer.routingId !== null &&
|
|
2336
|
-
|
|
2410
|
+
(0, routing_id_1.routingIdsEqual)((0, routing_id_1.toBackendRoutingId)(peer.routingId), descriptor.rid) &&
|
|
2337
2411
|
peer.lifecycleGeneration === descriptor.lifecycleGeneration &&
|
|
2338
2412
|
peer.state === service_runtime_contracts_1.MeshPeerRuntimeState.Serving)));
|
|
2339
2413
|
}
|
|
@@ -2500,7 +2574,7 @@ function isPlacementTargetReady(node, localStatus, descriptor) {
|
|
|
2500
2574
|
if (node === undefined)
|
|
2501
2575
|
return true;
|
|
2502
2576
|
if (localStatus !== undefined &&
|
|
2503
|
-
|
|
2577
|
+
(0, routing_id_1.routingIdsEqual)(localStatus.routingId, descriptor.rid) &&
|
|
2504
2578
|
localStatus.lifecycleGeneration === descriptor.lifecycleGeneration) {
|
|
2505
2579
|
return true;
|
|
2506
2580
|
}
|