Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

alpha9 takes 90 seconds to stop #1911

Closed
1 task
mooncaptain108 opened this issue Apr 22, 2024 · 7 comments
Closed
1 task

alpha9 takes 90 seconds to stop #1911

mooncaptain108 opened this issue Apr 22, 2024 · 7 comments
Labels
bug Something isn't working
Milestone

Comments

@mooncaptain108
Copy link

mooncaptain108 commented Apr 22, 2024

Bug description

After upgrading from alpha8 to alpha9 I found that the stop increased from almost instantly to 90 seconds.
systemctl stop headscale
here's the journalctl log

Apr 22 12:05:09 headscale systemd[1]: Stopping headscale coordination server for Tailscale...
Apr 22 12:05:09 headscale headscale[4098]: 2024-04-22T12:05:09-05:00 INF Received signal to stop, shutting down gracefully signal=terminated
Apr 22 12:06:39 headscale systemd[1]: headscale.service: State 'stop-sigterm' timed out. Killing.
Apr 22 12:06:39 headscale systemd[1]: headscale.service: Killing process 4098 (headscale) with signal SIGKILL.
Apr 22 12:06:39 headscale systemd[1]: headscale.service: Killing process 4099 (headscale) with signal SIGKILL.
Apr 22 12:06:39 headscale systemd[1]: headscale.service: Killing process 4100 (headscale) with signal SIGKILL.
Apr 22 12:06:39 headscale systemd[1]: headscale.service: Killing process 4101 (headscale) with signal SIGKILL.
Apr 22 12:06:39 headscale systemd[1]: headscale.service: Killing process 4102 (headscale) with signal SIGKILL.
Apr 22 12:06:39 headscale systemd[1]: headscale.service: Killing process 4103 (headscale) with signal SIGKILL.
Apr 22 12:06:39 headscale systemd[1]: headscale.service: Killing process 4104 (headscale) with signal SIGKILL.
Apr 22 12:06:39 headscale systemd[1]: headscale.service: Killing process 4105 (headscale) with signal SIGKILL.
Apr 22 12:06:39 headscale systemd[1]: headscale.service: Main process exited, code=killed, status=9/KILL
Apr 22 12:06:39 headscale systemd[1]: headscale.service: Failed with result 'timeout'.
Apr 22 12:06:39 headscale systemd[1]: Stopped headscale coordination server for Tailscale.
Apr 22 12:06:39 headscale systemd[1]: headscale.service: Consumed 33.940s CPU time.

Environment

  • OS: ubuntu 22.04
  • Headscale version: v0.23.0-alpha9
  • Tailscale version: 1.64.0
  • [x ] Headscale is behind a (reverse) proxy
  • Headscale runs in a container

To Reproduce

  1. a running alpha8 release - which I could stop and start quickly
  2. download the alpha9.deb
  3. apt install headscale.deb
  4. start headscale
  5. I was doing some testing from a remote node and noticed that not all nodes were showing up in my tailscale status list.
  6. made some changes to the acl and restarted headscale.
  7. Noticed the delay - it finally came back and I started to dig in.
    My tailscale status problem was resolved after the restart.
  8. I reverted my acl changes and that didn't make difference.
  9. I copied my backup db back in. and that didn't help.
  10. I did just: systemctl stop headscale and found that the stop was where the delay occurred
  11. described the problem on discord.

Logs and attachments

See above for journalctl output

@mooncaptain108 mooncaptain108 added the bug Something isn't working label Apr 22, 2024
@mooncaptain108 mooncaptain108 changed the title alpha8 takes 90 seconds to stop alpha9 takes 90 seconds to stop Apr 22, 2024
@cy1der
Copy link

cy1der commented Apr 23, 2024

+1 on this, same issue

@remisharrock
Copy link

same here

@kradalby kradalby added this to the v0.23.0 milestone Apr 30, 2024
@kradalby
Copy link
Collaborator

kradalby commented May 2, 2024

@mooncaptain108, I'm struggling to replicate this in my own setup, could you try #1922 and post the shutdown log?

@mooncaptain108
Copy link
Author

mooncaptain108 commented May 2, 2024 via email

@kradalby
Copy link
Collaborator

kradalby commented May 2, 2024

I just released https://github.com/juanfont/headscale/releases/tag/v0.23.0-alpha11, the change is in there.

@mooncaptain108
Copy link
Author

The problem is not present in alpha11.
I did a systemctl stop headscale
and here's what I got in journalctl.

May 02 09:44:43 headscale systemd[1]: Stopping headscale coordination server for Tailscale...
May 02 09:44:43 headscale headscale[5935]: 2024-05-02T09:44:43-05:00 INF Received signal to stop, shutting down gracefully signal=terminated
May 02 09:44:43 headscale headscale[5935]: 2024-05-02T09:44:43-05:00 INF Headscale stopped
May 02 09:44:43 headscale headscale[5935]: 2024-05-02T09:44:43-05:00 FTL ../../../home/runner/work/headscale/headscale/cmd/headscale/cli/server.go:26 > Error starting server error="http: Server closed"
May 02 09:44:43 headscale systemd[1]: headscale.service: Main process exited, code=exited, status=1/FAILURE
May 02 09:44:43 headscale systemd[1]: headscale.service: Failed with result 'exit-code'.
May 02 09:44:43 headscale systemd[1]: Stopped headscale coordination server for Tailscale.

headscale stopped immediately and I was able also to do restart and have it immediately startup again.

Just so you know when I installed alpha11 the install script had to wait 90 seconds to shutdown alpha10.

@mooncaptain108
Copy link
Author

this problem is closed for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants