Commit Graph

4 Commits

Author SHA1 Message Date
Steffen Butzer a7fe5c1211 windows/svc: workaround-exit mechanism that works for signal-less binaries
Kubernetes-commit: afdfe8d558c17a4e3ea4f6c7f066897b47bbf989
2019-02-01 19:16:11 +01:00
Steffen Butzer d8d9c927dd windows/service: implement graceful shutdown when run as windows service
- Fixes https://github.com/kubernetes/kubernetes/issues/72900
The issue here originally is that os.Exit() is called which exits
the process too early (before svc.Execute updates the status to stopped).
This is picked up as service error and leads to restarting,
if restart-on-fail is configured for the windows service.
svc.Execute already guarantees that the application is exited after,
so that os.Exit call would be unnecessary.

This rework also adds graceful shutdown, which also resolves the
underlying root cause. The graceful shutdown is not guaranteed
to succeed, since the service controller can decide to kill
the service any time after exceeding a shutdown timeout.

Kubernetes-commit: f243c8877978cf3d328c536b36cdf0ef5ca08a37
2019-01-25 00:34:42 +01:00
Zhenguo Niu fbe89f5f9b Remove useless named return value
This cleans up the useless named return value stopCh at
SetupSignalHandler().

Kubernetes-commit: 2e560e797e22c44ac628581486d847c2d5bdbd59
2018-08-02 19:28:17 +08:00
Dr. Stefan Schimanski 86ef841256 apiservers: add synchronous shutdown mechanism on SIGTERM+INT
Kubernetes-commit: 11b25366bc7bfe2ad273c8bf9c332fd9d233bffc
2017-08-29 13:16:11 +00:00