#2930: Potential issue with using inspect in log.get_plugin_logger
-------------------+---------------------------
 Reporter:  Cas    |      Owner:
     Type:  bug    |     Status:  new
 Priority:  major  |  Milestone:  2.0
Component:  Core   |    Version:  develop (git)
 Keywords:         |
-------------------+---------------------------
 When using a third-party plugin such as Autoshutdown in this trace below
 and it seems to be due to the use of inspect.stack() which can potentially
 crash on shutdown. This is legacy plugin logging code but if it crashes
 deluge then it is no good releasing it.

 There is a good SO question with alternatives to using `inspect`:
 http://stackoverflow.com/q/5067604/175584
 {{{
 [ERROR   ][deluge.pluginmanagerbase           :215 ] Error when disabling
 plugin 'AutoShutdown'
 [ERROR   ][deluge.pluginmanagerbase           :1200] Traceback (most
 recent call last):
   File "deluge/core/pluginmanager.py", line 43, in stop
     self.disable_plugins()
   File "deluge/pluginmanagerbase.py", line 79, in disable_plugins
     self.disable_plugin(key)
   File "deluge/core/pluginmanager.py", line 72, in disable_plugin
     d = deluge.pluginmanagerbase.PluginManagerBase.disable_plugin(self,
 name)
   File "deluge/pluginmanagerbase.py", line 206, in disable_plugin
     d = defer.maybeDeferred(self.plugins[name].disable)
 --- <exception caught here> ---
   File "/usr/lib/python2.7/dist-packages/twisted/internet/defer.py", line
 150, in maybeDeferred
     result = f(*args, **kw)
   File "deluge/plugins/init.py", line 28, in disable
     return self.plugin.disable()
   File "build/bdist.linux-x86_64/egg/autoshutdown/core.py", line 111, in
 disable

   File "deluge/log.py", line 286, in __getattribute__
     stack = inspect.stack()
   File "/usr/lib/python2.7/inspect.py", line 1060, in stack
     return getouterframes(sys._getframe(1), context)
   File "/usr/lib/python2.7/inspect.py", line 1038, in getouterframes
     framelist.append((frame,) + getframeinfo(frame, context))
   File "/usr/lib/python2.7/inspect.py", line 1013, in getframeinfo
     lines, lnum = findsource(frame)
   File "/usr/lib/python2.7/inspect.py", line 580, in findsource
     if pat.match(lines[lnum]): break
 exceptions.IndexError: list index out of range
 Traceback (most recent call last):
   File "/usr/lib/python2.7/dist-packages/twisted/internet/defer.py", line
 1128, in _inlineCallbacks
     result = g.send(result)
 StopIteration
 }}}

--
Ticket URL: <http://dev.deluge-torrent.org/ticket/2930>
Deluge <http://deluge-torrent.org/>
Deluge Project

-- 
You received this message because you are subscribed to the Google Groups 
"Deluge Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/deluge-dev.
For more options, visit https://groups.google.com/d/optout.

Reply via email to