# Deadlocked threads

**URL:** <https://forum.inductiveautomation.com/t/deadlocked-threads/7949>\
**Category:** General Discussion\
**Created:** [February 4, 2014, 3:27pm UTC](https://forum.inductiveautomation.com/t/deadlocked-threads/7949 "2014-02-04T15:27:45Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dan\_Bridgeman](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/dan_bridgeman/32/3610_2.png) [@Dan\_Bridgeman](https://forum.inductiveautomation.com/u/Dan_Bridgeman)\
**Post date:** [February 4, 2014, 3:27pm UTC](https://forum.inductiveautomation.com/t/deadlocked-threads/7949/1 "2014-02-04T15:27:45Z")

</div>

Is there any way to deal with deadlocked threads, short of restarting the Ignition service? I had a situation yesterday where a gateway timer script was caught in a deadlock, and it would have been handy to be able to just kill its thread and restart it later. I did try disabling the script and saving the project, but this didn’t clear up the deadlock.

So is it possible to just kill one of the blocking threads in such a scenario? And if so, how?

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [February 4, 2014, 4:15pm UTC](https://forum.inductiveautomation.com/t/deadlocked-threads/7949/2 "2014-02-04T16:15:54Z")

</div>

There’s no way to kill those threads. How did a timer script get caught in a deadlock? Do you have a thread dump?

---

<div class="post-metadata">

**Author:** ![Dan\_Bridgeman](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/dan_bridgeman/32/3610_2.png) [@Dan\_Bridgeman](https://forum.inductiveautomation.com/u/Dan_Bridgeman)\
**Post date:** [February 4, 2014, 4:45pm UTC](https://forum.inductiveautomation.com/t/deadlocked-threads/7949/3 "2014-02-04T16:45:12Z")

</div>

No, unfortunately I didn’t think to grab the thread dump until after I’d already restarted the service.

The script posts http requests to a lab device every 30 seconds to see if there are any new test results, and then posts follow-up requests to retrieve those results and stores them in the database. The device has some issues, and would occasionally stop responding to these requests. I used to have to stop and start that script every time the device failed to respond to a specific post, but since a timeout was added to system.net.httpPost() that hasn’t been a problem.

Then yesterday the users reported that they’d had to reboot the device and it hadn’t given them results since. I did the usually stop and start of the script, and when that didn’t work I went over to the thread console and saw the deadlock. I believe the blocked threads were the DedicatedScriptTimer, one of the http-80 threads, and Timer-0.

If it ever happens again, I’ll be sure to download the thread dump before restarting. And if the users can wait a bit, I’ll call support before resorting to the restart.

Thanks,  
Dan
