Opened 4 years ago

Last modified 22 months ago

#15593 accepted enhancement

Bring sanity to the tor side of the PT shutdown process.

Reported by: yawning Owned by: yawning
Priority: Medium Milestone: Tor: unspecified
Component: Obfuscation/Pluggable transport Version:
Severity: Normal Keywords: pt-wants tor-pt process-management technical-debt
Cc: asn, dcf Actual Points:
Parent ID: Points:
Reviewer: Sponsor:

Description

This is the final phase of my great PT shutdown process cleanup as a follow up to #15545.

Now that there's a portable mechanism to signal termination to PTs (close the stdin), we should change the PT shutdown process to allow graceful termination to look like this:

  1. Close stdin (and on U*IX, send a SIGTERM, PT behavior here is equivalent).
  2. Wait for a grace period (~1 sec?)
  3. If the child still is not dead, send a SIGKILL/TerminateProcess(). (Failsafe)

This fixes #9330 in that, PTs that wish to trap a graceful shutdown on Windows have a way to do so, despite the final stage of the process killing the PT in the most violent way possible as a failsafe (realistically, PTs should exit shortly after step 1).

Child Tickets

Change History (11)

comment:1 Changed 4 years ago by yawning

The main issue I see here after thinking about how the code would work is that on config reload the PT-relaunch process would need to be staggered to wait till after the existing PT instances are all dead. This should be relatively easy, I think, I'll poke at this in a branch unless people think this is a horrible idea.

comment:2 Changed 4 years ago by yawning

Keywords: TorCoreTeam201508 added

comment:3 Changed 4 years ago by yawning

Owner: changed from asn to yawning
Status: newaccepted

comment:4 Changed 4 years ago by nickm

Keywords: TorCoreTeam201509 added; TorCoreTeam201508 removed

comment:5 Changed 4 years ago by nickm

Milestone: Tor: 0.2.7.x-finalTor: 0.2.8.x-final

comment:6 Changed 3 years ago by nickm

Milestone: Tor: 0.2.8.x-finalTor: 0.2.???

Move a few tickets out of 0.2.8. I would take a good patch for most of these if somebody writes one. (If you do, please make the ticket needs_review and move it back into maint-0.2.8 milestone. :) )

comment:7 Changed 3 years ago by nickm

Keywords: TorCoreTeam201509 removed

Removing TorCoreTeam201509 from these tickets, since we do not own a time machine.

comment:8 Changed 2 years ago by teor

Milestone: Tor: 0.2.???Tor: 0.3.???

Milestone renamed

comment:9 Changed 2 years ago by nickm

Keywords: tor-03-unspecified-201612 added
Milestone: Tor: 0.3.???Tor: unspecified

Finally admitting that 0.3.??? was a euphemism for Tor: unspecified all along.

comment:10 Changed 22 months ago by nickm

Keywords: tor-03-unspecified-201612 removed

Remove an old triaging keyword.

comment:11 Changed 22 months ago by nickm

Keywords: tor-pt process-management technical-debt added
Severity: Normal
Note: See TracTickets for help on using tickets.