Deadlocks? Detect where your threads hang in Python with one import.
Project description
## The MIT License (MIT) ## ——————— ## ## Copyright (C) 2014 Nicco Kunzmann ## ## https://gist.github.com/niccokunzmann/6038331 ## ## Permission is hereby granted, free of charge, to any person obtaining ## a copy of this software and associated documentation files (the “Software”), ## to deal in the Software without restriction, including without limitation ## the rights to use, copy, modify, merge, publish, distribute, sublicense, ## and/or sell copies of the Software, and to permit persons to whom the ## Software is furnished to do so, subject to the following conditions: ## ## The above copyright notice and this permission notice shall be included ## in all copies or substantial portions of the Software. ## ## THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS ## OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ## FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE ## AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ## LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING ## FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS ## IN THE SOFTWARE.
Copy this code and do
import hanging_threads
If a thread is at the same place for SECONDS_FROZEN then the stacktrace is printed.
This script prints
- ——————– Thread 6628 ——————–
- File “hanging_threads.py”, line 70, in <module>
time.sleep(3) # TEST
- ——————– Thread 6628 ——————–
- File “hanging_threads.py”, line 70, in <module>
time.sleep(3) # TEST
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for hanging_threads-1.0.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ac671b1035c6a2318d7269f34cb609f1ace7f168afe22ef7a5621dd6f87d7d2f |
|
MD5 | 594a7be85f62c2da8bd191389097b982 |
|
BLAKE2b-256 | cfe7c73a139fc5c3ea286d45233d7f8a36e432e0c951c8fb8ebaef50d7cb20da |