# How to debug Workflows without PotentialDeadLockException

**URL:** <https://community.temporal.io/t/how-to-debug-workflows-without-potentialdeadlockexception/2977>\
**Category:** Community Support\
**Tags:** java-sdk\
**Created:** [September 20, 2021, 5:51pm UTC](https://community.temporal.io/t/how-to-debug-workflows-without-potentialdeadlockexception/2977 "2021-09-20T17:51:38Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Vikas\_NS](https://sea2.discourse-cdn.com/flex016/user_avatar/community.temporal.io/vikas_ns/32/1210_2.png) [@Vikas\_NS](https://community.temporal.io/u/Vikas_NS)\
**Post date:** [September 20, 2021, 5:51pm UTC](https://community.temporal.io/t/how-to-debug-workflows-without-potentialdeadlockexception/2977/1 "2021-09-20T17:51:39Z")

</div>

While debugging a workflow, everything works fine untill I reach the activity execution.  
Right when I step over the activity method call inside the workflow, I get PotentialDeadLockException stating that Potential DeadLock Detected : workflow thread “workflow-method” didn’t yield control for over a second.

How do I disable this when debugging in local.?

---

<div class="post-metadata">

**Author:** ![tihomir](https://sea2.discourse-cdn.com/flex016/user_avatar/community.temporal.io/tihomir/32/6580_2.png) [@tihomir](https://community.temporal.io/u/tihomir)\
**Post date:** [September 20, 2021, 5:56pm UTC](https://community.temporal.io/t/how-to-debug-workflows-without-potentialdeadlockexception/2977/2 "2021-09-20T17:56:59Z")

</div>

> **[Testing and Debugging | Temporal documentation](https://docs.temporal.io/docs/java/testing-and-debugging/)**
>
> Overview

---

<div class="post-metadata">

**Author:** ![Vikas\_NS](https://sea2.discourse-cdn.com/flex016/user_avatar/community.temporal.io/vikas_ns/32/1210_2.png) [@Vikas\_NS](https://community.temporal.io/u/Vikas_NS)\
**Post date:** [September 20, 2021, 5:59pm UTC](https://community.temporal.io/t/how-to-debug-workflows-without-potentialdeadlockexception/2977/3 "2021-09-20T17:59:33Z")

</div>

Thanks tihomir.

**Gist from the link for Others**

To alleviate this issue, you can set the `TEMPORAL_DEBUG` environment variable to true before debugging your Workflow code. Make sure to set `TEMPORAL_DEBUG` to true only during debugging.

---

<div class="post-metadata">

**Author:** ![tihomir](https://sea2.discourse-cdn.com/flex016/user_avatar/community.temporal.io/tihomir/32/6580_2.png) [@tihomir](https://community.temporal.io/u/tihomir)\
**Post date:** [September 20, 2021, 6:00pm UTC](https://community.temporal.io/t/how-to-debug-workflows-without-potentialdeadlockexception/2977/4 "2021-09-20T18:00:05Z")

</div>

Make sure the TEMPORAL\_DEBUG is only set during debugging, as it can mask serious workflow issues (in integration tests for example).
