[tor-bugs] #10088 [Tor]: Allow tor helpers to use JobObjects by setting CREATE_BREAKAWAY_FROM_JOB (Windows-only)

Tor Bug Tracker & Wiki blackhole at torproject.org
Tue Nov 12 15:24:05 UTC 2013


#10088: Allow tor helpers to use JobObjects by setting CREATE_BREAKAWAY_FROM_JOB
(Windows-only)
------------------------+--------------------------------
     Reporter:  asn     |      Owner:
         Type:  defect  |     Status:  new
     Priority:  normal  |  Milestone:  Tor: 0.2.4.x-final
    Component:  Tor     |    Version:
   Resolution:          |   Keywords:  tor-pt
Actual Points:          |  Parent ID:
       Points:          |
------------------------+--------------------------------

Comment (by infinity0):

 Yay! OK, so the takeaway from this, is that a process P should always set
 `CREATE_BREAKAWAY_FROM_JOB` when creating child processes that are later
 assigned to a new `JobObject`. (Also, to be nice to others, the JobObject
 itself should have `JOB_OBJECT_LIMIT_BREAKAWAY_OK` unless you have a
 specific reason not to.)

 As a corollary, there is no point setting the flag, if P itself does not
 do anything with JobObjects, so the original point of this ticket is
 unnecessary.

 We have two options going forwards:

 1. amend this ticket to set the flag **and** to implement the kill-
 children-on-parent-death behaviour, but in C in tor itself.
   a. this behaviour includes grandchildren.
   b. can be done together with (2) below - the combination of
 `CREATE_BREAKAWAY_FROM_JOB` and `JOB_OBJECT_LIMIT_BREAKAWAY_OK` makes
 things play nicely with each other.

 2. keep the kill-children-on-parent-death behaviour in pyptlib and push it
 to master, so that we can deploy it.

 For purposes of #10006 we only need (2) and it's the easier option because
 the code is already written and tested and reviewed. For general tor
 purposes we could do (1), but it would be less effort to jump straight to
 #10047 since that is cross-platform.

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


More information about the tor-bugs mailing list