Tribler / tribler

Privacy enhanced BitTorrent client with P2P content discovery
https://www.tribler.org
GNU General Public License v3.0
4.73k stars 445 forks source link

[7.14] Slow coroutine step execution (34.290 seconds): BandwidthDatabase.get_total_taken #8032

Closed kozlovsky closed 1 month ago

kozlovsky commented 1 month ago

The Sentry issue: https://sentry.tribler.org/organizations/tribler/issues/2752/events/8d70ebb8a60549d6a28120edcb669201/

  File "C:\Users\<relief>\AppData\Local\Programs\Python\Python38\lib\site-packages\ipv8\taskmanager.py", line 24, in delay_runner (function started 34.290 seconds ago)
  File "C:\Users\<relief>\AppData\Local\Programs\Python\Python38\lib\site-packages\ipv8\util.py", line 35, in call_async (function started 34.290 seconds ago)
  File "C:\Users\<relief>\AppData\Local\Programs\Python\Python38\lib\site-packages\ipv8\requestcache.py", line 251, in _on_timeout (function started 34.290 seconds ago)
  File "C:\Users\<relief>\AppData\Local\Programs\Python\Python38\lib\site-packages\ipv8\messaging\anonymization\caches.py", line 70, in on_timeout (function started 34.290 seconds ago)
  File "src\<relief>\core\components\tunnel\community\tunnel_community.py", line 409, in remove_circuit (function started 34.290 seconds ago)
  File "src\<relief>\core\components\tunnel\community\tunnel_community.py", line 325, in do_payout (function started 34.290 seconds ago)
  File "<string>", line 2, in insert (function started 33.504 seconds ago)
  File "C:\Users\<relief>\AppData\Local\Programs\Python\Python38\lib\site-packages\pony\orm\core.py", line 519, in new_func (function started 33.504 seconds ago), 
  File "src\<relief>\core\components\bandwidth_accounting\db\transaction.py", line 167, in insert (function started 33.500 seconds ago), 
  File "src\<relief>\core\components\bandwidth_accounting\db\database.py", line 153, in get_my_balance (function started 33.248 seconds ago)
  File "<string>", line 2, in get_balance (function started 33.248 seconds ago)
  File "C:\Users\<relief>\AppData\Local\Programs\Python\Python38\lib\site-packages\pony\orm\core.py", line 506, in new_func (function started 33.248 seconds ago)
  File "src\<relief>\core\components\bandwidth_accounting\db\database.py", line 146, in get_balance (function started 33.248 seconds ago)
  File "<string>", line 2, in get_total_taken (function started 27.501 seconds ago)
  File "C:\Users\<relief>\AppData\Local\Programs\Python\Python38\lib\site-packages\pony\orm\core.py", line 506, in new_func (function started 27.501 seconds ago)
  File "src\<relief>\core\components\bandwidth_accounting\db\database.py", line 126, in get_total_taken (function started 27.501 seconds ago)

It looks like BandwidthCommunity has some inefficient queries.

kozlovsky commented 1 month ago

We can consider the issue fixed as BandwidthCommunity was removed in #7336.