-
-
Notifications
You must be signed in to change notification settings - Fork 977
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Python script deadlocked when threads call get_torrent_status #7599
Comments
the python callback requires that libtorrent locks the GIL, which is questional to begin with. This is probably the reason for the deadlock when using multiple threads. In your example, you just return |
Thanks @arvidn for the reply. Yes there are ways to circumvent this and I did, though "not specify it" is signature mismatch from python side. I used to have production servers all stall every few hours and days and without knowing why had to script to reset them, and now I can confirm this deadlock is indeed the casue. fyi, regarding the deadlock, what I see is that say there are 3 threads of concern: a) python, b) python and c) session, v1.2.19
|
ways to circumvent are use |
version
libtorrent: v1.2.19
python: 3.8.10
platform: ubuntu 20.04 (5.4.0-169-generic)
compiler: g++ (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0
Call
get_torrent_status
repeatedly in two python threads stalls the program.I would expect the program does not block.
It appeared to me that threads are calling
get_torrent_status
but the callback function get called from the session thread.The calling threads block on
libtorrent::aux::torrent_wait
.Script to reproduce
Server spec
Run the script gives four LWP's
strace output of the first
strace of others
gdb backtrace of first thread
The text was updated successfully, but these errors were encountered: