#667 Something is borked in supybots threading wrappers

open
nobody
5
2012-12-31
2010-09-05
nanotube
No

So, it looks like something is borked in all the supybot's fancy built-in threading.

I had to resort to threading things "manually" by creating own threads using threading.Thread, to make it work, since neither threaded=True at plugin level, nor thread() trapping at method level worked.

Note the two attached versions of the "MarketMonitor" plugin. With the "nowork" version, what happened is that you could start it, and it would keep checking for data, but when you call stop, the insides of the function would not execute, not even the 'print "in stop function!" would print when calling stop (though the log would say "... stop called..."). once unload MarketMonitor is called, though, and the start() thread exits because of the closed telnet connection due to the die() method, the stop function start running and doing stuff (the messages get printed).

I could not understand what was going on... but when i got rid of supybot's threading wrappers, and used my own thread for the monitoring loop (see the "works" version), everything started working as expected, and I could call start, and then call stop at any point, and it would properly stop.

Please feel free to test and verify whether you're getting the same behavior. The testing was done with the latest git version, using python 2.6.5.

Unfortunately, I could not figure out what exactly was wrong, all I know is that it doesn't work...

Discussion

  • nanotube

    nanotube - 2010-09-05

    This version works, using manually-created thread.

     
  • nanotube

    nanotube - 2010-09-05

    This version doesn't work, using the threaded=True method. Same thing happens with method-level thread() wrapping.

     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.





No, thanks