mirror of
https://github.com/shumaiOne/shumai.git
synced 2026-12-01 05:14:25 +00:00
fix(runner): enforce ownership and safe reconnects
Gate dispatch on reconciliation, retain cancellations across disconnects, and stop replaced clients. Guard the single-server runner topology with a database lease. Restage missing generated inputs, report signal exits, and bound generated-file cleanup.
This commit is contained in:
@@ -81,6 +81,16 @@ if (regenCmdIndex !== -1) {
|
||||
|
||||
async function run() {
|
||||
validateArchiveStorageConfig()
|
||||
const runnerLease = await runnerService.startServerTopology()
|
||||
runnerLease.addEventListener(
|
||||
'abort',
|
||||
() => {
|
||||
console.error('Lost the runner server lease:', runnerLease.reason)
|
||||
process.exit(1)
|
||||
},
|
||||
{ once: true },
|
||||
)
|
||||
runnerLease.throwIfAborted()
|
||||
// Initialize workflows and activities for local executor mode
|
||||
initAgentWorkflows()
|
||||
initTranscodeWorkflows()
|
||||
@@ -222,6 +232,7 @@ async function run() {
|
||||
await workflowService.shutdownWorkers().catch(() => {})
|
||||
assetService.stopCleanupJob()
|
||||
server.stop(true)
|
||||
await runnerService.stopServerTopology().catch(console.error)
|
||||
process.exit(0)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user