[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [tor-bugs] #27053 [Core Tor/Stem]: Check controller's event error handling



#27053: Check controller's event error handling
---------------------------+------------------------
 Reporter:  atagar         |          Owner:  atagar
     Type:  defect         |         Status:  new
 Priority:  Very High      |      Milestone:
Component:  Core Tor/Stem  |        Version:
 Severity:  Major          |     Resolution:
 Keywords:                 |  Actual Points:
Parent ID:                 |         Points:
 Reviewer:                 |        Sponsor:
---------------------------+------------------------

Comment (by atagar):

 Hi Mike. When our caller's handler raises an exception it should be
 ignored by Stem. Presently it breaks the event thread and that is
 **definitely** wrong.

 Stem intends to provide the following contract...

 * Users should not need to know about Stem's internal event thread and it
 should **never** fail. If it does that's my bug.

 * When a listener is subscribed it should **always** be invoked when a
 validly formatted event of that type is received.

 * What the listener does (and if it fails) is of no interest to Stem.

 Unfortunately I need to carve out one exception for that last point: if
 the called function hangs then that **will** break our event thread. To
 protect us from that I could invoke handlers in subthreads like we do for
 status changed listeners...

 https://stem.torproject.org/api/control.html#stem.control.BaseController.add_status_listener

 ... but unlike status changes events are numerous enough that guardrails
 like that would be costly.

--
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/27053#comment:2>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online
_______________________________________________
tor-bugs mailing list
tor-bugs@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-bugs