Bug 16307 - protect method calls in NetworkThread.notify
: protect method calls in NetworkThread.notify
Status: CLOSED FIXED
Product: SqueezePlay
Classification: Unclassified
Component: Networking
: 7.5.x
: PC Other
: -- normal (vote)
: 7.6.0
Assigned To: Ben Klaas
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2010-06-18 13:54 UTC by Ben Klaas
Modified: 2011-05-18 15:33 UTC (History)
3 users (show)

See Also:
Category: Bug


Attachments
use pcall() to send protected calls to applet notification methods (642 bytes, patch)
2010-06-18 13:54 UTC, Ben Klaas
Details | Diff
use pcall() to send protected calls to applet notification methods (630 bytes, patch)
2010-06-18 13:58 UTC, Ben Klaas
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ben Klaas 2010-06-18 13:54:24 UTC
Created attachment 6886 [details]
use pcall() to send protected calls to applet notification methods

This was discovered while looking for the root cause of bug 16303

NetworkThread's notify method should not be making unprotected method calls to
applets. Instead encapsulate them with a pcall() so if one applet method fails
the rest don't fail.

This has been subjected to basic tests and appears to do exactly as specified,
and method args are passing through with Lua's '...' correctly.
Comment 1 Ben Klaas 2010-06-18 13:58:05 UTC
Created attachment 6887 [details]
use pcall() to send protected calls to applet notification methods

updated patch with better error logging
Comment 2 Ben Klaas 2010-06-18 14:44:23 UTC
Correspondence from Richard Titmuss on the issue:
"[Patch] Looks good. I think the reason is historical, NetworkThread was part of the first code Fred wrote, long before we learned of the advantages of pcall :). I'm surprised it's taken so long to expose the problem!"
Comment 3 SVN Bot 2010-06-21 13:42:23 UTC
 == Auto-comment from SVN commit #8902 to the jive repo by bklaas ==
 == http://svn.slimdevices.com/jive?view=revision&revision=8902 ==

Fixed Bug: 16307
Description: Encapsulate calls to notify_* methods in applets in pcall()s so one failure doesn't kill all the rest of the applet method calls.
Comment 4 Chris Owens 2010-09-13 12:01:47 UTC
Since these are fixed, they must not be patch_waiting after all
Comment 5 Bradley D. Wall 2011-05-18 15:33:30 UTC
Closing due to fix