@sentio/runtime 3.1.0-rc.1 → 3.1.0-rc.3

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sentio/runtime",
3
- "version": "3.1.0-rc.1",
3
+ "version": "3.1.0-rc.3",
4
4
  "license": "Apache-2.0",
5
5
  "type": "module",
6
6
  "exports": {
@@ -7,12 +7,6 @@ try {
7
7
  console.error('Failed to parse worker number', e)
8
8
  }
9
9
 
10
- let serverNum = 1
11
-
12
- if (process.env['PROCESSOR_SERVER_NUM']) {
13
- serverNum = parseInt(process.env['PROCESSOR_SERVER_NUM']!.trim())
14
- }
15
-
16
10
  function myParseInt(value: string, dummyPrevious: number): number {
17
11
  // parseInt takes a string and a radix
18
12
  const parsedValue = parseInt(value, 10)
@@ -38,7 +32,7 @@ export const program = new Command('processor-runner')
38
32
  .option('--debug', 'Enable debug mode')
39
33
  .option('--otlp-debug', 'Enable OTLP debug mode')
40
34
  .option('--start-action-server', 'Start action server instead of processor server')
41
- .option('--worker <number>', 'Number of worker threads(V2 only, deprecated) ', myParseInt, workerNum)
35
+ .option('--worker <number>', 'Number of processor worker threads ', myParseInt, workerNum)
42
36
  .option('--process-timeout <seconds>', 'Process timeout in seconds', myParseInt, 60)
43
37
  .option(
44
38
  '--worker-timeout <seconds>',
@@ -51,7 +45,6 @@ export const program = new Command('processor-runner')
51
45
  'Enable binding data partition',
52
46
  process.env['SENTIO_ENABLE_BINDING_DATA_PARTITION'] === 'true'
53
47
  )
54
- .option('--multi-server <number>', 'Enable multi-server mode for processor runtime', myParseInt, serverNum)
55
48
 
56
49
  export type ProcessorRuntimeOptions = ReturnType<typeof program.opts> & { target: string }
57
50
 
@@ -20,7 +20,6 @@ import { setupLogger } from './logger.js'
20
20
 
21
21
  import { setupOTLP } from './otlp.js'
22
22
  import { ActionServer } from './action-server.js'
23
- import { ServiceManager } from './service-manager.js'
24
23
  import { ProcessorV3Definition } from '@sentio/protos'
25
24
  import { ProcessorServiceImplV3 } from './service-v3.js'
26
25
  import { dirname, join } from 'path'
@@ -50,13 +49,13 @@ console.debug('Starting Server', options)
50
49
  const isChildProcess = process.env['SENTIO_MULTI_SERVER_CHILD'] === 'true'
51
50
  const childServerPort = process.env['SENTIO_CHILD_SERVER_PORT']
52
51
 
53
- // Multi-server mode: spawn child processes for additional servers
54
- if (options.multiServer > 1 && !isChildProcess) {
52
+ // Multi-worker mode: spawn child processes for additional servers
53
+ if (options.worker > 1 && !isChildProcess) {
55
54
  const childProcesses: ChildProcess[] = []
56
55
  const basePort = parseInt(options.port)
57
56
 
58
57
  // Spawn child processes for ports basePort+1 to basePort+(multiServer-1)
59
- for (let i = 1; i < options.multiServer; i++) {
58
+ for (let i = 1; i < options.worker; i++) {
60
59
  const childPort = basePort + i
61
60
  const child = fork(fileURLToPath(import.meta.url), process.argv.slice(2), {
62
61
  env: {
@@ -94,7 +93,7 @@ if (options.multiServer > 1 && !isChildProcess) {
94
93
  const actualPort = isChildProcess && childServerPort ? childServerPort : options.port
95
94
 
96
95
  let server: any
97
- let baseService: ProcessorServiceImpl | ServiceManager
96
+ let baseService: ProcessorServiceImpl
98
97
  let httpServer: http.Server | undefined
99
98
 
100
99
  const loader = async () => {
@@ -116,13 +115,8 @@ if (options.startActionServer) {
116
115
  // .use(openTelemetryServerMiddleware())
117
116
  .use(errorDetailsServerMiddleware)
118
117
 
119
- // for V2
120
- if (options.worker > 1) {
121
- baseService = new ServiceManager(loader, options, server.shutdown)
122
- } else {
123
- baseService = new ProcessorServiceImpl(loader, options, server.shutdown)
124
- }
125
-
118
+ // for V2
119
+ baseService = new ProcessorServiceImpl(loader, options, server.shutdown)
126
120
  const service = new FullProcessorServiceImpl(baseService)
127
121
 
128
122
  server.add(ProcessorDefinition, service)