Commit 481e422
committed
hscontrol: cancel tailsql on graceful shutdown
Serve stored a Background context for tailsql and called
context.Done() during signal shutdown. Done only returns the
done channel and does not cancel, so tailsql never stopped
when Headscale shut down.
Create a cancellable child of the Serve context, run
`runTailSQLService` in the listener errgroup so its error is
surfaced, and call the cancel func on shutdown - tailsql
unblocks on ctx.Done.1 parent cfd845c commit 481e422
1 file changed
Lines changed: 8 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
737 | 737 | | |
738 | 738 | | |
739 | 739 | | |
740 | | - | |
| 740 | + | |
741 | 741 | | |
742 | 742 | | |
743 | 743 | | |
| |||
752 | 752 | | |
753 | 753 | | |
754 | 754 | | |
755 | | - | |
| 755 | + | |
| 756 | + | |
756 | 757 | | |
757 | | - | |
| 758 | + | |
| 759 | + | |
| 760 | + | |
758 | 761 | | |
759 | 762 | | |
760 | 763 | | |
| |||
833 | 836 | | |
834 | 837 | | |
835 | 838 | | |
836 | | - | |
| 839 | + | |
837 | 840 | | |
838 | | - | |
| 841 | + | |
839 | 842 | | |
840 | 843 | | |
841 | 844 | | |
| |||
0 commit comments