This repository has been archived by the owner on Jul 24, 2024. It is now read-only.
BR won't clean up the environment when exit by SIGTERM #557
Labels
difficulty/1-easy
Easy issue
Priority/P0
Top priority issue. Must have an associated milestone
type/bug
Something isn't working
Please answer these questions before submitting your issue. Thanks!
If possible, provide a recipe for reproducing the error.
--remove-schedulers
)What did you expect to see?
The cluster config changed by BR should be undone, since SIGTERM allows us to gracefully stop.
What did you see instead?
The cluster has stuck in the config that BR has set. (For current master, PD schedulers could be reset due to scheduler: use pause instead of remove schedulers #551 )
v4.0.7
Note:
We listen to signals here:
br/main.go
Lines 34 to 39 in d2d5bba
Canceling the context could make other goroutines eventually exit and clean up, but we leave no time for them.
Add aremove thosetime.Sleep(30 * time.Second)
os.Exit
s could help. But there are still some problems:br/pkg/task/backup.go
Lines 222 to 227 in d2d5bba
We use the global context to do the cleanup tasks, which will always fail if the outer context is canceled. We should change it to a new context with a timeout, the timeout could be the same as the sleep time before stopping.
The text was updated successfully, but these errors were encountered: