Issue Details (XML | Word | Printable)

Key: PYFB-46
Type: Bug Bug
Status: Closed Closed
Resolution: Cannot Reproduce
Priority: Major Major
Assignee: Pavel Cisar
Reporter: Rajko Thon
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Firebird driver for Python

Transaction hangs when multiple threads execute same procedure very frequently

Created: 02/Jan/15 10:41 PM   Updated: 29/May/15 12:10 PM
Component/s: None
Affects Version/s: 1.4.3
Fix Version/s: 1.4.6

File Attachments: 1. Zip Archive fdb_test.zip (5 kB)

Environment: Windows 7 / Linux Debian Jessie / Firebird 2.5.3


 Description  « Hide
For a database stress test we run a python script which spawns multiple threads with multiple connections per thread.
After some short time all threads stop working (hang).
See attached python script which reproduces the error reliably.
The issue seems to occur for multiple threads only. One thread alone is working fine.
A similar program using freepascal does not have any problem with the same database.
So we think it is a problem in the python driver which also only occurs under high load.

For 4 threads: See faulthandler traceback-output on Linux after: kill -USR1 <pid>.
Surprisingly one thread suddenly seems to jump from __XSQLDA2Tuple into the destructor.
The subsequent close seems to block all other threads.

Faulthandler output:

Thread 0x00007f3039020700 (most recent call first):
  File "/usr/local/lib/python3.4/dist-packages/fdb/fbcore.py", line 3028 in _close
  File "/usr/local/lib/python3.4/dist-packages/fdb/fbcore.py", line 3149 in __del__
  File "/usr/local/lib/python3.4/dist-packages/fdb/fbcore.py", line 2383 in __XSQLDA2Tuple
  File "/usr/local/lib/python3.4/dist-packages/fdb/fbcore.py", line 3070 in _execute
  File "/usr/local/lib/python3.4/dist-packages/fdb/fbcore.py", line 3353 in execute
  File "fbcall.py", line 70 in run
  File "/usr/lib/python3.4/threading.py", line 920 in _bootstrap_inner
  File "/usr/lib/python3.4/threading.py", line 888 in _bootstrap

Thread 0x00007f3039821700 (most recent call first):
  File "/usr/local/lib/python3.4/dist-packages/fdb/fbcore.py", line 3062 in _execute
  File "/usr/local/lib/python3.4/dist-packages/fdb/fbcore.py", line 3353 in execute
  File "fbcall.py", line 70 in run
  File "/usr/lib/python3.4/threading.py", line 920 in _bootstrap_inner
  File "/usr/lib/python3.4/threading.py", line 888 in _bootstrap

Thread 0x00007f303a022700 (most recent call first):
  File "/usr/local/lib/python3.4/dist-packages/fdb/fbcore.py", line 3062 in _execute
  File "/usr/local/lib/python3.4/dist-packages/fdb/fbcore.py", line 3353 in execute
  File "fbcall.py", line 70 in run
  File "/usr/lib/python3.4/threading.py", line 920 in _bootstrap_inner
  File "/usr/lib/python3.4/threading.py", line 888 in _bootstrap

Thread 0x00007f303a823700 (most recent call first):
  File "/usr/local/lib/python3.4/dist-packages/fdb/fbcore.py", line 3062 in _execute
  File "/usr/local/lib/python3.4/dist-packages/fdb/fbcore.py", line 3353 in execute
  File "fbcall.py", line 70 in run
  File "/usr/lib/python3.4/threading.py", line 920 in _bootstrap_inner
  File "/usr/lib/python3.4/threading.py", line 888 in _bootstrap

Current thread 0x00007f303eaa2700 (most recent call first):
  File "/usr/lib/python3.4/threading.py", line 1076 in _wait_for_tstate_lock
  File "/usr/lib/python3.4/threading.py", line 1060 in join
  File "fbcall.py", line 226 in <module>


 All   Comments   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Pavel Cisar added a comment - 29/May/15 12:10 PM
Cannot reproduce with 1.4.6