mirror of
https://github.com/whyour/qinglong.git
synced 2026-09-22 10:32:40 +08:00
feat(ql3): gate remote cancellation delivery
This commit is contained in:
@@ -903,6 +903,9 @@ export async function bootstrapClusterControlRuntime(
|
||||
workerRuntime: createClusterWorkerRuntimePort(
|
||||
database.pool,
|
||||
options.workerRuntime,
|
||||
{
|
||||
cancellationDispatchOwnerId: recoveryRuntime.ownerId,
|
||||
},
|
||||
),
|
||||
}),
|
||||
});
|
||||
|
||||
@@ -75,6 +75,7 @@ import {
|
||||
createClusterControlCopilotFailureDiagnosisCancellationRoute,
|
||||
type ClusterCopilotFailureDiagnosisCancellationCapability,
|
||||
} from '../copilot/failure-diagnosis/failureDiagnosisCancellationRoute';
|
||||
import type { ClusterRemoteWorkerCancellationDispatchObservation } from '../remote-execution/remoteWorkerCancellationDispatchControl';
|
||||
|
||||
export const PRODUCTION_CLUSTER_CONTROL_ROUTE_OPERATIONS = Object.freeze([
|
||||
'task.get',
|
||||
@@ -150,6 +151,12 @@ export interface ProductionClusterWorkerIngressOptions {
|
||||
readonly artifactStore: ClusterRemoteWorkerArtifactStore;
|
||||
readonly secretProvider?: RemoteWorkerSecretValueProvider;
|
||||
readonly onDiagnostic?: (error: unknown) => void | Promise<void>;
|
||||
readonly onCancellationDispatch?: (
|
||||
observation: ClusterRemoteWorkerCancellationDispatchObservation,
|
||||
) => void | Promise<void>;
|
||||
readonly onCancellationDispatchDiagnostic?: (
|
||||
error: unknown,
|
||||
) => void | Promise<void>;
|
||||
}
|
||||
|
||||
export interface ProductionClusterControlApplicationOptions
|
||||
@@ -439,6 +446,28 @@ export function startProductionClusterControlApplication(
|
||||
...(workerIngress.secretProvider === undefined
|
||||
? {}
|
||||
: { secretProvider: workerIngress.secretProvider }),
|
||||
...(
|
||||
workerIngress.onCancellationDispatch === undefined &&
|
||||
workerIngress.onCancellationDispatchDiagnostic === undefined
|
||||
? {}
|
||||
: {
|
||||
cancellationDispatch: {
|
||||
...(workerIngress.onCancellationDispatch === undefined
|
||||
? {}
|
||||
: {
|
||||
onObservation:
|
||||
workerIngress.onCancellationDispatch,
|
||||
}),
|
||||
...(workerIngress.onCancellationDispatchDiagnostic ===
|
||||
undefined
|
||||
? {}
|
||||
: {
|
||||
onDiagnostic:
|
||||
workerIngress.onCancellationDispatchDiagnostic,
|
||||
}),
|
||||
},
|
||||
}
|
||||
),
|
||||
},
|
||||
}),
|
||||
...database,
|
||||
|
||||
Reference in New Issue
Block a user