I have a python script which is threaded and runs on our server node . The Problem is that the script gets stuck/hanged without any trace. How to check where the script is hanging as it doesn't print anything
Asked
Active
Viewed 247 times
-3
-
Without your code, we can only theorise. Update your original post with the code. – PL200 Jan 17 '19 at 05:36
-
But the code is company property so I cannot post it But I can tell the functionality of it – ISHAAN SATHE Jan 17 '19 at 05:39
-
1Change variable names and post the code, nobody can be much of a help without the actual code – Sushant Jan 17 '19 at 05:41
-
1Plent of answers on this site on how to debug. Research some answers here: https://stackoverflow.com/questions/3443607/how-can-i-tell-where-my-python-script-is-hanging – PL200 Jan 17 '19 at 05:42
-
Thanks I saw these links but my problem is the code works fine for 3-4 days in continuously but it hangs in between and debugging it very difficult as it has 2000 lines of code – ISHAAN SATHE Jan 17 '19 at 05:48
-
"debugging is very difficult". Welcome to programming. Actually guess what: It's even harder when we don't have the code. – Julien Jan 17 '19 at 06:00
-
yes I understand but I cannot put my code otherwise i will lose my job – ISHAAN SATHE Jan 17 '19 at 06:04
1 Answers
0
Take a look at the hanging_threads module (available from PyPI) - It might give you some pointers on where your code gets stuck. However it is prone to false positives (e.g. if your script waits for a network connection).

Torben Klein
- 2,943
- 1
- 19
- 24