Skip to content

Commit d7f3686

Browse files
authored
Fix worker option typo (#772)
1 parent 0356cc6 commit d7f3686

File tree

6 files changed

+19
-19
lines changed

6 files changed

+19
-19
lines changed

internal/internal_worker.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -386,7 +386,7 @@ func newSessionWorker(service workflowserviceclient.Interface,
386386
params workerExecutionParameters,
387387
overrides *workerOverrides,
388388
env *hostEnvImpl,
389-
maxConCurrentSessionExecutionSize int,
389+
maxConcurrentSessionExecutionSize int,
390390
) Worker {
391391
if params.Identity == "" {
392392
params.Identity = getWorkerIdentity(params.TaskList)
@@ -395,7 +395,7 @@ func newSessionWorker(service workflowserviceclient.Interface,
395395
if params.SessionResourceID == "" {
396396
params.SessionResourceID = uuid.New()
397397
}
398-
sessionEnvironment := newSessionEnvironment(params.SessionResourceID, maxConCurrentSessionExecutionSize)
398+
sessionEnvironment := newSessionEnvironment(params.SessionResourceID, maxConcurrentSessionExecutionSize)
399399

400400
creationTasklist := getCreationTasklist(params.TaskList)
401401
params.UserContext = context.WithValue(params.UserContext, sessionEnvironmentContextKey, sessionEnvironment)
@@ -1200,7 +1200,7 @@ func newAggregatedWorker(
12001200
workerParams,
12011201
nil,
12021202
hostEnv,
1203-
wOptions.MaxConCurrentSessionExecutionSize,
1203+
wOptions.MaxConcurrentSessionExecutionSize,
12041204
)
12051205
}
12061206

@@ -1393,8 +1393,8 @@ func augmentWorkerOptions(options WorkerOptions) WorkerOptions {
13931393
if options.DataConverter == nil {
13941394
options.DataConverter = getDefaultDataConverter()
13951395
}
1396-
if options.MaxConCurrentSessionExecutionSize == 0 {
1397-
options.MaxConCurrentSessionExecutionSize = defaultMaxConcurrentSessionExecutionSize
1396+
if options.MaxConcurrentSessionExecutionSize == 0 {
1397+
options.MaxConcurrentSessionExecutionSize = defaultMaxConcurrentSessionExecutionSize
13981398
}
13991399

14001400
// if the user passes in a tracer then add a tracing context propagator

internal/internal_workflow_testsuite.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -383,8 +383,8 @@ func (env *testWorkflowEnvironmentImpl) setWorkerOptions(options WorkerOptions)
383383
// if options.SessionResourceID != "" {
384384
// env.workerOptions.SessionResourceID = options.SessionResourceID
385385
// }
386-
if options.MaxConCurrentSessionExecutionSize != 0 {
387-
env.workerOptions.MaxConCurrentSessionExecutionSize = options.MaxConCurrentSessionExecutionSize
386+
if options.MaxConcurrentSessionExecutionSize != 0 {
387+
env.workerOptions.MaxConcurrentSessionExecutionSize = options.MaxConcurrentSessionExecutionSize
388388
}
389389
if len(options.ContextPropagators) > 0 {
390390
env.workerOptions.ContextPropagators = options.ContextPropagators
@@ -1465,7 +1465,7 @@ func (env *testWorkflowEnvironmentImpl) newTestActivityTaskHandler(taskList stri
14651465
params.UserContext = context.Background()
14661466
}
14671467
if env.sessionEnvironment == nil {
1468-
env.sessionEnvironment = newTestSessionEnvironment(env, &params, wOptions.MaxConCurrentSessionExecutionSize)
1468+
env.sessionEnvironment = newTestSessionEnvironment(env, &params, wOptions.MaxConcurrentSessionExecutionSize)
14691469
}
14701470
params.UserContext = context.WithValue(params.UserContext, sessionEnvironmentContextKey, env.sessionEnvironment)
14711471

internal/session.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ var (
133133
// SessionResourceID: The identifier of the resource consumed by sessions.
134134
// It's the user's responsibility to ensure there's only one worker using this resourceID.
135135
// This option is not available for now as automatic session reestablishing is not implemented.
136-
// MaxConCurrentSessionExecutionSize: the maximum number of concurrently sessions the resource
136+
// MaxConcurrentSessionExecutionSize: the maximum number of concurrently sessions the resource
137137
// support. By default, 1000 is used.
138138

139139
// CreateSession creates a session and returns a new context which contains information
@@ -144,7 +144,7 @@ var (
144144
// 1. The context passed in already contains a session which is still open
145145
// (not closed and failed).
146146
// 2. All the workers are busy (number of sessions currently running on all the workers have reached
147-
// MaxConCurrentSessionExecutionSize, which is specified when starting the workers) and session
147+
// MaxConcurrentSessionExecutionSize, which is specified when starting the workers) and session
148148
// cannot be created within a specified timeout.
149149
//
150150
// If an activity is executed using the returned context, it's regarded as part of the

internal/session_test.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -279,15 +279,15 @@ func (s *SessionTestSuite) TestRecreation() {
279279
}
280280

281281
func (s *SessionTestSuite) TestMaxConcurrentSession_CreationOnly() {
282-
maxConCurrentSessionExecutionSize := 3
282+
maxConcurrentSessionExecutionSize := 3
283283
workflowFn := func(ctx Context) error {
284284
ao := ActivityOptions{
285285
ScheduleToStartTimeout: time.Minute,
286286
StartToCloseTimeout: time.Minute,
287287
HeartbeatTimeout: time.Second * 20,
288288
}
289289
ctx = WithActivityOptions(ctx, ao)
290-
for i := 0; i != maxConCurrentSessionExecutionSize+1; i++ {
290+
for i := 0; i != maxConcurrentSessionExecutionSize+1; i++ {
291291
if _, err := s.createSessionWithoutRetry(ctx); err != nil {
292292
return err
293293
}
@@ -298,7 +298,7 @@ func (s *SessionTestSuite) TestMaxConcurrentSession_CreationOnly() {
298298
RegisterWorkflow(workflowFn)
299299
env := s.NewTestWorkflowEnvironment()
300300
env.SetWorkerOptions(WorkerOptions{
301-
MaxConCurrentSessionExecutionSize: maxConCurrentSessionExecutionSize,
301+
MaxConcurrentSessionExecutionSize: maxConcurrentSessionExecutionSize,
302302
})
303303
env.ExecuteWorkflow(workflowFn)
304304

@@ -307,7 +307,7 @@ func (s *SessionTestSuite) TestMaxConcurrentSession_CreationOnly() {
307307
}
308308

309309
func (s *SessionTestSuite) TestMaxConcurrentSession_WithRecreation() {
310-
maxConCurrentSessionExecutionSize := 3
310+
maxConcurrentSessionExecutionSize := 3
311311
workflowFn := func(ctx Context) error {
312312
ao := ActivityOptions{
313313
ScheduleToStartTimeout: time.Minute,
@@ -324,7 +324,7 @@ func (s *SessionTestSuite) TestMaxConcurrentSession_WithRecreation() {
324324
return errors.New("Returned session info should not be nil")
325325
}
326326

327-
for i := 0; i != maxConCurrentSessionExecutionSize; i++ {
327+
for i := 0; i != maxConcurrentSessionExecutionSize; i++ {
328328
if i%2 == 0 {
329329
_, err = s.createSessionWithoutRetry(ctx)
330330
} else {
@@ -340,7 +340,7 @@ func (s *SessionTestSuite) TestMaxConcurrentSession_WithRecreation() {
340340
RegisterWorkflow(workflowFn)
341341
env := s.NewTestWorkflowEnvironment()
342342
env.SetWorkerOptions(WorkerOptions{
343-
MaxConCurrentSessionExecutionSize: maxConCurrentSessionExecutionSize,
343+
MaxConcurrentSessionExecutionSize: maxConcurrentSessionExecutionSize,
344344
})
345345
env.ExecuteWorkflow(workflowFn)
346346

internal/worker.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ type (
206206

207207
// Optional: Sets the maximum number of concurrently running sessions the resource support.
208208
// default: 1000
209-
MaxConCurrentSessionExecutionSize int
209+
MaxConcurrentSessionExecutionSize int
210210

211211
// Optional: Sets ContextPropagators that allows users to control the context information passed through a workflow
212212
// default: no ContextPropagators

workflow/session.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ var ErrSessionFailed = internal.ErrSessionFailed
4747
// Note: Worker should be configured to process session. To do this, set the following
4848
// fields in WorkerOptions:
4949
// EnableSessionWorker: true
50-
// MaxConCurrentSessionExecutionSize: the maximum number of concurrently sessions the resource
50+
// MaxConcurrentSessionExecutionSize: the maximum number of concurrently sessions the resource
5151
// support. By default, 1000 is used.
5252

5353
// CreateSession creates a session and returns a new context which contains information
@@ -58,7 +58,7 @@ var ErrSessionFailed = internal.ErrSessionFailed
5858
// 1. The context passed in already contains a session which is still open
5959
// (not closed and failed).
6060
// 2. All the workers are busy (number of sessions currently running on all the workers have reached
61-
// MaxConCurrentSessionExecutionSize, which is specified when starting the workers) and session
61+
// MaxConcurrentSessionExecutionSize, which is specified when starting the workers) and session
6262
// cannot be created within a specified timeout.
6363
//
6464
// If an activity is executed using the returned context, it's regarded as part of the

0 commit comments

Comments
 (0)