Skip to content

Conversation

@jeredfloyd
Copy link
Contributor

Since the removal of traffic_cop, it appears that there is no way to cause traffic_manager to exit cleanly. SIGTERM causes the cleanup of child processes and a graceful shutdown, however still exits with code 15. We can ignore this in the systemd unit file, but it's cleaner to have some path to a clean exit of traffic_manager.

@jeredfloyd
Copy link
Contributor Author

jeredfloyd commented Apr 18, 2022

It might also be desirable to add a "--manager" option to traffic_ctl server stop, to be parallel with restart? I'm not entirely clear on the intended operation, however both the init.d file and the systemd unit use signals today, so a clean way to exit traffic_manager via signal is always valuable.

ETA: Looking through the code further, the command traffic_ctl server restart --manager actually leads (confusingly) to a clean shutdown of traffic_manager (and not a restart, as suggested). There's no way that a TS API command could restart the traffic_manager process without the cooperation of the outside starting mechanism (init or systemd), so this traffic_ctl command should be removed.

The underlying state enum "MGMT_PENDING_RESTART" could be renamed to "MGMT_PENDING_EXIT" (STOP is used for stopping the traffic_server process only) and the plumbing then corrected on the traffic_ctl side to move the "--manager" option from the restart command to the stop command. This would fix the confusing behavior for that command today -- I can do that in another PR.

The above commentary is independent of this PR -- a signal is still desired!

@bryancall bryancall added the Core label Apr 18, 2022
@bryancall
Copy link
Contributor

@jeredfloyd We do plan to get rid of traffic_manager in the next major release (10.0.0).

@bryancall bryancall merged commit dfc686a into apache:master Apr 18, 2022
@randall randall added this to the 10.0.0 milestone Apr 18, 2022
@jeredfloyd jeredfloyd deleted the tm-clean-exit branch April 19, 2022 01:44
@jeredfloyd
Copy link
Contributor Author

@bryancall Thanks! Once I have 9.x in Fedora I will try to follow future plans a little more closely.

zwoop pushed a commit that referenced this pull request Apr 20, 2022
@zwoop
Copy link
Contributor

zwoop commented Apr 20, 2022

Cherry-picked to v9.2.x

@zwoop zwoop modified the milestones: 10.0.0, 9.2.0 Apr 20, 2022
moonchen pushed a commit to moonchen/trafficserver that referenced this pull request May 26, 2022
* asf/9.2.x:
  Updated ChangeLog
  HttpSM, HttpTunnel, and Http2Stream debug logging updates (apache#8788)
  Fix plugin parent_select failover (apache#8676)
  Adds new plugin, http_stats (apache#8797)
  SIGTERM should cause traffic_manager to exit with status 0 as a shutdown method (apache#8798)
  Avoid allocation when matching hosts for vol lookup (apache#8762)
  Check bounds before accessing Vol::evacuate array (apache#8716)
  Adds a simple tool to generate new escape tables (apache#8783)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants