Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

hanging_threads-1.0.1.zip (6.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

hanging_threads-1.0.1-py3-none-any.whl (5.9 kB view details)

Uploaded Python 3

File details

Details for the file hanging_threads-1.0.1.zip.

File metadata

  • Download URL: hanging_threads-1.0.1.zip
  • Upload date:
  • Size: 6.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for hanging_threads-1.0.1.zip
Algorithm Hash digest
SHA256 cd566848b1c72e203aa7532e6cba45fdd39866ae84b3b467bcbe9ec0c8915c02
MD5 2ace3edffc95d21e8e0e5a64d2be7672
BLAKE2b-256 755f504dd673bdba6852d51d95a0d61474cbda475cc64c656e4cf5672f38e5ab

See more details on using hashes here.

File details

Details for the file hanging_threads-1.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for hanging_threads-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 0f04064f38c3e8b3f897d04c6098e6bbd54c11d723bda7cc1385d42f7a3fec42
MD5 e813fc3cf7241a5596f4dddaa26b42c9
BLAKE2b-256 ea1921d46627dd338c231f072c41afa6ff714beb17fed485092fa5818a96d345

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page