From 0f0aa9c8f1b230cf279aec222343bd1f918ef8e2 Mon Sep 17 00:00:00 2001 From: RainbowMango Date: Fri, 19 Jul 2019 16:00:00 +0800 Subject: [PATCH] Update misleading comemnts for HandleCrash --- staging/src/k8s.io/apimachinery/pkg/util/runtime/runtime.go | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/staging/src/k8s.io/apimachinery/pkg/util/runtime/runtime.go b/staging/src/k8s.io/apimachinery/pkg/util/runtime/runtime.go index 3c886f46c3f..c7348129ae8 100644 --- a/staging/src/k8s.io/apimachinery/pkg/util/runtime/runtime.go +++ b/staging/src/k8s.io/apimachinery/pkg/util/runtime/runtime.go @@ -40,11 +40,7 @@ var PanicHandlers = []func(interface{}){logPanic} // called in case of panic. HandleCrash actually crashes, after calling the // handlers and logging the panic message. // -// TODO: remove this function. We are switching to a world where it's safe for -// apiserver to panic, since it will be restarted by kubelet. At the beginning -// of the Kubernetes project, nothing was going to restart apiserver and so -// catching panics was important. But it's actually much simpler for monitoring -// software if we just exit when an unexpected panic happens. +// E.g., you can provide one or more additional handlers for something like shutting down go routines gracefully. func HandleCrash(additionalHandlers ...func(interface{})) { if r := recover(); r != nil { for _, fn := range PanicHandlers {