[tor-bugs] #17946 [Stem]: launch_tor should kill process on exception while bootstrapping (for example, on KeyboardInterrupt)

Tor Bug Tracker & Wiki blackhole at torproject.org
Wed Dec 30 16:00:16 UTC 2015


#17946: launch_tor should kill process on exception while bootstrapping (for
example, on KeyboardInterrupt)
-----------------------------------+------------------------
 Reporter:  germn                  |          Owner:  atagar
     Type:  defect                 |         Status:  closed
 Priority:  Medium                 |      Milestone:
Component:  Stem                   |        Version:
 Severity:  Normal                 |     Resolution:  fixed
 Keywords:  launch_tor, bootstrap  |  Actual Points:
Parent ID:                         |         Points:
  Sponsor:                         |
-----------------------------------+------------------------
Changes (by atagar):

 * status:  new => closed
 * resolution:   => fixed


Comment:

 > If KeyboardInterrupt (or asyncio.CancelledError, or other) was raised,
 we should reraise exactly this error after resources cleanup, we shouldn't
 raise our type of error instead. Top-level code might want to know if
 exactly KeyboardInterrupt happened.

 Yup, I can see an argument for this. Reason I did this was because
 launch_tor() is only documented as raising OSErrors. I'm unfamiliar with
 asyncio.CancelledError, but you're right that KeyboardInterrupt is an
 interesting critter. If the caller explicity invokes an exception within
 us then I could see an argument for re-raising that.
 [https://gitweb.torproject.org/stem.git/commit/?id=ae9d81b279bb51b2f1c3d088b86c7aa310b9db11
 Changed].

 > One another little thing is about line 141:

 I removed a couple tor_process.kill() calls since they're now covered by
 our except block. No need to kill the process twice. :)

 Feel free to reopen if ya spot anything else.

--
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/17946#comment:3>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online


More information about the tor-bugs mailing list