Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 34 for HandleCrash (0.16 sec)

  1. staging/src/k8s.io/apimachinery/pkg/util/runtime/runtime_test.go

    	"strings"
    	"sync"
    	"testing"
    	"time"
    )
    
    func TestHandleCrash(t *testing.T) {
    	defer func() {
    		if x := recover(); x == nil {
    			t.Errorf("Expected a panic to recover from")
    		}
    	}()
    	defer HandleCrash()
    	panic("Test Panic")
    }
    
    func TestCustomHandleCrash(t *testing.T) {
    	old := PanicHandlers
    	defer func() { PanicHandlers = old }()
    	var result interface{}
    	PanicHandlers = []func(context.Context, interface{}){
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Tue Mar 26 16:28:45 UTC 2024
    - 4.5K bytes
    - Viewed (0)
  2. staging/src/k8s.io/apiserver/pkg/server/filters/wrap.go

    			// RST_STREAM, depending on the HTTP protocol. To abort a handler so
    			// the client sees an interrupted response but the server doesn't log
    			// an error, panic with the value ErrAbortHandler.
    			//
    			// Note that HandleCrash function is actually crashing, after calling the handlers
    			if info, err := resolver.NewRequestInfo(req); err != nil {
    				metrics.RecordRequestAbort(req, nil)
    			} else {
    				metrics.RecordRequestAbort(req, info)
    			}
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Tue Mar 26 16:28:45 UTC 2024
    - 3.3K bytes
    - Viewed (0)
  3. staging/src/k8s.io/apimachinery/pkg/util/wait/loop.go

    	// if immediate is true the condition is
    	// guaranteed to be executed at least once,
    	// if we haven't requested immediate execution, delay once
    	if immediate {
    		if ok, err := func() (bool, error) {
    			defer runtime.HandleCrash()
    			return condition(ctx)
    		}(); err != nil || ok {
    			return err
    		}
    	}
    
    	if sliding {
    		timeCh = t.C()
    	}
    
    	for {
    
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Thu Oct 19 02:47:00 UTC 2023
    - 2.8K bytes
    - Viewed (0)
  4. staging/src/k8s.io/apiserver/pkg/server/options/encryptionconfig/controller/controller.go

    func (d *DynamicEncryptionConfigContent) Run(ctx context.Context) {
    	defer utilruntime.HandleCrash()
    
    	klog.InfoS("Starting controller", "name", d.name)
    	defer klog.InfoS("Shutting down controller", "name", d.name)
    
    	var wg sync.WaitGroup
    
    	wg.Add(1)
    	go func() {
    		defer utilruntime.HandleCrash()
    		defer wg.Done()
    		defer d.queue.ShutDown()
    		<-ctx.Done()
    	}()
    
    	wg.Add(1)
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Sat May 04 18:33:12 UTC 2024
    - 9.5K bytes
    - Viewed (0)
  5. staging/src/k8s.io/apiserver/pkg/server/hooks.go

    }
    
    func runPostStartHook(name string, entry postStartHookEntry, context PostStartHookContext) {
    	var err error
    	func() {
    		// don't let the hook *accidentally* panic and kill the server
    		defer utilruntime.HandleCrash()
    		err = entry.hook(context)
    	}()
    	// if the hook intentionally wants to kill server, let it.
    	if err != nil {
    		klog.Fatalf("PostStartHook %q failed: %v", name, err)
    	}
    	close(entry.done)
    }
    
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Mon Apr 29 18:59:21 UTC 2024
    - 8K bytes
    - Viewed (0)
  6. pkg/controlplane/controller/systemnamespaces/system_namespaces_controller.go

    		systemNamespaces: systemNamespaces,
    		interval:         interval,
    	}
    }
    
    // Run starts one worker.
    func (c *Controller) Run(stopCh <-chan struct{}) {
    	defer utilruntime.HandleCrash()
    	defer klog.Infof("Shutting down system namespaces controller")
    
    	klog.Infof("Starting system namespaces controller")
    
    	if !cache.WaitForCacheSync(stopCh, c.namespaceSynced) {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Sat Apr 27 12:19:56 UTC 2024
    - 2.9K bytes
    - Viewed (0)
  7. staging/src/k8s.io/apiserver/pkg/storage/cacher/watch_progress.go

    	ctx := wait.ContextForChannel(stopCh)
    	if pr.contextMetadata != nil {
    		ctx = metadata.NewOutgoingContext(ctx, pr.contextMetadata)
    	}
    	go func() {
    		defer utilruntime.HandleCrash()
    		<-stopCh
    		pr.mux.Lock()
    		defer pr.mux.Unlock()
    		pr.stopped = true
    		pr.cond.Signal()
    	}()
    	timer := pr.clock.NewTimer(progressRequestPeriod)
    	defer timer.Stop()
    	for {
    		stopped := func() bool {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Fri May 24 09:56:38 UTC 2024
    - 3K bytes
    - Viewed (0)
  8. staging/src/k8s.io/apiextensions-apiserver/pkg/controller/establish/establishing_controller.go

    	ec.queue.AddAfter(key, timeout)
    }
    
    // Run starts the EstablishingController.
    func (ec *EstablishingController) Run(stopCh <-chan struct{}) {
    	defer utilruntime.HandleCrash()
    	defer ec.queue.ShutDown()
    
    	klog.Info("Starting EstablishingController")
    	defer klog.Info("Shutting down EstablishingController")
    
    	if !cache.WaitForCacheSync(stopCh, ec.crdSynced) {
    		return
    	}
    
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Sat May 04 18:33:12 UTC 2024
    - 4.4K bytes
    - Viewed (0)
  9. pkg/controller/validatingadmissionpolicystatus/controller.go

    	// Types of object are calculated from policy.Spec.MatchingConstraints
    	typeChecker *validatingadmissionpolicy.TypeChecker
    }
    
    func (c *Controller) Run(ctx context.Context, workers int) {
    	defer utilruntime.HandleCrash()
    
    	if !cache.WaitForNamedCacheSync(ControllerName, ctx.Done(), c.policySynced) {
    		return
    	}
    
    	defer c.policyQueue.ShutDown()
    	for i := 0; i < workers; i++ {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Sat May 04 18:33:12 UTC 2024
    - 5.3K bytes
    - Viewed (0)
  10. pkg/controlplane/controller/legacytokentracking/controller.go

    	})
    
    	return c
    }
    
    func (c *Controller) enqueue() {
    	c.queue.Add(queueKey)
    }
    
    // Run starts the controller sync loop.
    func (c *Controller) Run(stopCh <-chan struct{}) {
    	defer utilruntime.HandleCrash()
    	defer c.queue.ShutDown()
    
    	klog.Info("Starting legacy_token_tracking_controller")
    	defer klog.Infof("Shutting down legacy_token_tracking_controller")
    
    	go c.configMapInformer.Run(stopCh)
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Sat May 04 18:33:12 UTC 2024
    - 6K bytes
    - Viewed (0)
Back to top