File tree 1 file changed +17
-1
lines changed
1 file changed +17
-1
lines changed Original file line number Diff line number Diff line change @@ -31,6 +31,15 @@ async def bench_activity(name: str) -> str:
31
31
return f"Hello, { name } !"
32
32
33
33
34
+ @workflow .defn
35
+ class DeadlockInterruptibleWorkflow :
36
+ @workflow .run
37
+ async def run (self ) -> None :
38
+ # Infinite loop, which is interruptible via PyThreadState_SetAsyncExc
39
+ while True :
40
+ pass
41
+
42
+
34
43
async def main ():
35
44
logging .basicConfig (
36
45
format = "%(asctime)s.%(msecs)03d %(levelname)-8s %(message)s" ,
@@ -93,6 +102,13 @@ async def report_mem():
93
102
task_queue = task_queue ,
94
103
)
95
104
for i in range (args .workflow_count )
105
+ ] + [
106
+ await env .client .start_workflow (
107
+ DeadlockInterruptibleWorkflow .run ,
108
+ id = f"deadlock-interruptible-workflow-{ i } -{ uuid .uuid4 ()} " ,
109
+ task_queue = task_queue ,
110
+ )
111
+ for i in range (args .workflow_count )
96
112
]
97
113
start_seconds = time .monotonic () - pre_start_seconds
98
114
@@ -101,7 +117,7 @@ async def report_mem():
101
117
async with Worker (
102
118
env .client ,
103
119
task_queue = task_queue ,
104
- workflows = [BenchWorkflow ],
120
+ workflows = [BenchWorkflow , DeadlockInterruptibleWorkflow ],
105
121
activities = [bench_activity ],
106
122
workflow_runner = SandboxedWorkflowRunner ()
107
123
if args .sandbox
You can’t perform that action at this time.
0 commit comments