sdk-python icon indicating copy to clipboard operation
sdk-python copied to clipboard

Include stack trace on deadlock detection exception

Open twin-drill opened this issue 1 year ago • 1 comments
trafficstars

Use the workflow tid to capture the workflow thread's frame at the time of deadlock.

Added current_thread_id: Optional[int] and get_worker_ident(self) -> Optional[int] to interfaces/implementations.

Currently I only set tid in _run_once for the standard implementation, if it's needed elsewhere please let me know. (This is mainly why it's marked as a draft)

Also, readability around the code in _workflow.py is (imo) suboptimal so I'd appreciate feedback/ideas on that.

twin-drill avatar Jul 26 '24 18:07 twin-drill