[Deluge] #3326: Unhandled error in deferred handle_alerts

7 views
Skip to first unread message

Deluge

unread,
Nov 17, 2019, 2:31:20 PM11/17/19
to delug...@googlegroups.com
#3326: Unhandled error in deferred handle_alerts
----------------------------+-------------------
Reporter: pLurium | Type: bug
Status: new | Priority: major
Milestone: needs verified | Component: Core
Version: 2.0.3 | Keywords:
----------------------------+-------------------
{{{
[CRITICAL][twisted :154 ] Unhandled error in
Deferred:
[CRITICAL][deluge.log :93 ] twisted.internet.defer
[Failure instance: Traceback: <class 'UnicodeDecodeError'>: 'utf-8' codec
can't decode byte 0xce in position 0: invalid continuation byte
/usr/local/lib/python3.7/dist-packages/twisted/internet/base.py:1283:run
/usr/local/lib/python3.7/dist-
packages/twisted/internet/base.py:1292:mainLoop
/usr/local/lib/python3.7/dist-
packages/twisted/internet/base.py:913:runUntilCurrent
/usr/local/lib/python3.7/dist-
packages/twisted/internet/task.py:239:__call__
--- <exception caught here> ---
/usr/local/lib/python3.7/dist-
packages/twisted/internet/defer.py:151:maybeDeferred
/usr/lib/python3/dist-packages/deluge/core/alertmanager.py:70:update
/usr/lib/python3/dist-
packages/deluge/core/alertmanager.py:140:handle_alerts
/usr/lib/python3/dist-packages/deluge/core/alertmanager.py:141:<dictcomp>
}}}

Deluge doesn't completely crash but at least stops updating the user
interfaces.

A simple workaround for now is catching the exception:
{{{#!python
diff --git a/deluge/core/alertmanager.py b/deluge/core/alertmanager.py
index 2fe42224d..fedc48322 100644
--- a/deluge/core/alertmanager.py
+++ b/deluge/core/alertmanager.py
@@ -131,17 +131,20 @@ def handle_alerts(self):
# Call any handlers for this alert type
if alert_type in self.handlers:
for handler in self.handlers[alert_type]:
- if log.isEnabledFor(logging.DEBUG):
- log.debug('Handling alert: %s', alert_type)
- # Copy alert attributes
- alert_copy = SimpleNamespace(
- **{
- attr: getattr(alert, attr)
- for attr in dir(alert)
- if not attr.startswith('__')
- }
- )
- self.delayed_calls.append(reactor.callLater(0,
handler, alert_copy))
+ try:
+ if log.isEnabledFor(logging.DEBUG):
+ log.debug('Handling alert: %s', alert_type)
+ # Copy alert attributes
+ alert_copy = SimpleNamespace(
+ **{
+ attr: getattr(alert, attr)
+ for attr in dir(alert)
+ if not attr.startswith('__')
+ }
+ )
+ self.delayed_calls.append(reactor.callLater(0,
handler, alert_copy))
+ except:
+ pass

def set_alert_queue_size(self, queue_size):
"""Sets the maximum size of the libtorrent alert queue"""
}}}

--
Ticket URL: <https://dev.deluge-torrent.org/ticket/3326>
Deluge <https://deluge-torrent.org/>
Deluge Project

Deluge

unread,
Nov 28, 2019, 9:39:24 AM11/28/19
to delug...@googlegroups.com
#3326: Unhandled error in deferred handle_alerts
----------------------+-------------------
Reporter: pLurium | Owner:
Type: bug | Status: new
Priority: major | Milestone: 2.0.4
Component: Core | Version: 2.0.3
Resolution: | Keywords:
----------------------+-------------------
Changes (by Cas):

* milestone: needs verified => 2.0.4


Comment:

Can you provide any details on how to replicate this error?

--
Ticket URL: <https://dev.deluge-torrent.org/ticket/3326#comment:1>

Deluge

unread,
Nov 28, 2019, 3:53:35 PM11/28/19
to delug...@googlegroups.com
#3326: Unhandled error in deferred handle_alerts
----------------------+-------------------
Reporter: pLurium | Owner:
Type: bug | Status: new

Priority: major | Milestone: 2.0.4
Component: Core | Version: 2.0.3
Resolution: | Keywords:
----------------------+-------------------

Comment (by pLurium):

I had lots of
{{{
[WARNING ][deluge.core.torrentmanager :1624] on_alert_performance:
SomeTörrentNäme: performance warning: max outstanding piece requests
reached, outstanding_request_limit_reached
}}}
and I think the name in one of them triggered the !UnicodeDecodeError.
I've upgraded earlier from Deluge 1.3 but didn't immediately run into
this.

--
Ticket URL: <https://dev.deluge-torrent.org/ticket/3326#comment:2>

Reply all
Reply to author
Forward
0 new messages