You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to understand how cancellation scopes work, and for that I am looking at HelloCancellationScope and HelloDetachedCancellationScope
Describe the bug
I was looking at the code in the HelloCancellationScope class.
If I run the example through the main method, this is the output:
Activity for Oi going to take 23 seconds
Activity for Привет going to take 8 seconds
Activity for Hallo going to take 16 seconds
Activity for Bye going to take 28 seconds
Activity for Hola going to take 11 seconds
Activity for Hello going to take 19 seconds
Activity for Привет completed
Activity for Oi was cancelled. Cleanup is expected to take 2 seconds.
Activity for Hallo was cancelled. Cleanup is expected to take 4 seconds.
Activity for Bye was cancelled. Cleanup is expected to take 1 seconds.
Activity for Hola was cancelled. Cleanup is expected to take 2 seconds.
Activity for Hello was cancelled. Cleanup is expected to take 1 seconds.
Activity for Bye finished cancellation
13:26:44.374 {HelloCancellationScopeWorkflow dd9e08dd-9b26-3f67-a226-396d0fa9c2df} [Activity Executor taskQueue="HelloCancellationScopeTaskQueue", namespace="default": 4] INFO i.t.i.a.ActivityTaskExecutors$ActivityTaskExecutor - Activity canceled. ActivityId=dd9e08dd-9b26-3f67-a226-396d0fa9c2df, activityType=ComposeGreeting, attempt=1
Activity for Hello finished cancellation
13:26:44.387 {HelloCancellationScopeWorkflow be5eaced-ee7f-34ee-9e18-1bc0de1bc344} [Activity Executor taskQueue="HelloCancellationScopeTaskQueue", namespace="default": 6] INFO i.t.i.a.ActivityTaskExecutors$ActivityTaskExecutor - Activity canceled. ActivityId=be5eaced-ee7f-34ee-9e18-1bc0de1bc344, activityType=ComposeGreeting, attempt=1
Activity for Oi finished cancellation
13:26:45.355 {HelloCancellationScopeWorkflow 42c07d6b-7f8d-3638-b408-6045e5eee15d} [Activity Executor taskQueue="HelloCancellationScopeTaskQueue", namespace="default": 1] INFO i.t.i.a.ActivityTaskExecutors$ActivityTaskExecutor - Activity canceled. ActivityId=42c07d6b-7f8d-3638-b408-6045e5eee15d, activityType=ComposeGreeting, attempt=1
Activity for Hola finished cancellation
13:26:45.383 {HelloCancellationScopeWorkflow 7c33e886-500d-3711-8d81-8c0d84d6291e} [Activity Executor taskQueue="HelloCancellationScopeTaskQueue", namespace="default": 5] INFO i.t.i.a.ActivityTaskExecutors$ActivityTaskExecutor - Activity canceled. ActivityId=7c33e886-500d-3711-8d81-8c0d84d6291e, activityType=ComposeGreeting, attempt=1
Activity for Hallo finished cancellation
13:26:47.366 {HelloCancellationScopeWorkflow b1ec9997-52bc-3c81-8a4c-2be9f2506e41} [Activity Executor taskQueue="HelloCancellationScopeTaskQueue", namespace="default": 3] INFO i.t.i.a.ActivityTaskExecutors$ActivityTaskExecutor - Activity canceled. ActivityId=b1ec9997-52bc-3c81-8a4c-2be9f2506e41, activityType=ComposeGreeting, attempt=1
Привет World!
After the first activity is completed all the remaining activities are cancelled as expected.
If I run the test (HelloCancellationScopeTest), this is the output:
Activity for Hello going to take 9 seconds
Activity for Hola going to take 16 seconds
Activity for Bye going to take 9 seconds
Activity for Hallo going to take 11 seconds
Activity for Привет going to take 8 seconds
Activity for Oi going to take 16 seconds
Activity for Привет completed
Activity for Bye completed
Activity for Hello completed
Activity for Hallo completed
Activity for Hola completed
Activity for Oi completed
After the first activity is completed all the remaining activities are not cancelled.
Minimal Reproduction
Environment/Versions
OS and processor: [e.g. M1 Mac, x86 Windows, Linux]
Temporal Version: [e.g. 1.14.0?] and/or SDK version
Are you using Docker or Kubernetes or building Temporal from source?
Additional context
The text was updated successfully, but these errors were encountered:
What are you really trying to do?
I am trying to understand how cancellation scopes work, and for that I am looking at
HelloCancellationScope
andHelloDetachedCancellationScope
Describe the bug
I was looking at the code in the HelloCancellationScope class.
If I run the example through the main method, this is the output:
After the first activity is completed all the remaining activities are cancelled as expected.
If I run the test (
HelloCancellationScopeTest
), this is the output:After the first activity is completed all the remaining activities are not cancelled.
Minimal Reproduction
Environment/Versions
Additional context
The text was updated successfully, but these errors were encountered: