Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 19 for ErrAbortHandler (0.24 sec)

  1. staging/src/k8s.io/apiserver/pkg/server/filters/wrap.go

    func WithPanicRecovery(handler http.Handler, resolver request.RequestInfoResolver) http.Handler {
    	return withPanicRecovery(handler, func(w http.ResponseWriter, req *http.Request, err interface{}) {
    		if err == http.ErrAbortHandler {
    			// Honor the http.ErrAbortHandler sentinel panic value
    			//
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Tue Mar 26 16:28:45 UTC 2024
    - 3.3K bytes
    - Viewed (0)
  2. staging/src/k8s.io/apiserver/pkg/server/filters/timeout_test.go

    		}
    	case <-time.After(30 * time.Second):
    		t.Fatalf("expected to see a handler panic, but didn't")
    	}
    
    	// Panics with http.ErrAbortHandler
    	ctx = context.Background()
    	doPanic <- http.ErrAbortHandler
    	res, err = http.Get(ts.URL)
    	if err != nil {
    		t.Fatal(err)
    	}
    	if res.StatusCode != http.StatusInternalServerError {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Tue Mar 26 16:28:45 UTC 2024
    - 18.4K bytes
    - Viewed (0)
  3. staging/src/k8s.io/apimachinery/pkg/util/runtime/runtime_test.go

    func TestHandleCrashLogSilenceHTTPErrAbortHandler(t *testing.T) {
    	log, err := captureStderr(func() {
    		defer func() {
    			if r := recover(); r != http.ErrAbortHandler {
    				t.Fatalf("expected to recover from http.ErrAbortHandler")
    			}
    		}()
    		defer HandleCrash()
    		panic(http.ErrAbortHandler)
    	})
    	if err != nil {
    		t.Fatalf("%v", err)
    	}
    	if len(log) > 0 {
    		t.Fatalf("expected no stderr log, got: %s", log)
    	}
    }
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Tue Mar 26 16:28:45 UTC 2024
    - 4.5K bytes
    - Viewed (0)
  4. staging/src/k8s.io/apiserver/pkg/endpoints/handlers/finisher/finisher_test.go

    		},
    		{
    			name:    "http.ErrAbortHandler panic is propagated without wrapping with stack",
    			timeout: timeoutFunc,
    			fn: func() (runtime.Object, error) {
    				panic(http.ErrAbortHandler)
    			},
    			expectedObj:      nil,
    			expectedErr:      nil,
    			expectedPanic:    http.ErrAbortHandler.Error(),
    			expectedPanicObj: http.ErrAbortHandler,
    		},
    	}
    	for i, tc := range testcases {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Fri May 07 14:20:33 UTC 2021
    - 8.2K bytes
    - Viewed (0)
  5. staging/src/k8s.io/apimachinery/pkg/util/runtime/runtime.go

    func logPanic(ctx context.Context, r interface{}) {
    	if r == http.ErrAbortHandler {
    		// honor the http.ErrAbortHandler sentinel panic value:
    		//   ErrAbortHandler is a sentinel panic value to abort a handler.
    		//   While any panic from ServeHTTP aborts the response to the client,
    		//   panicking with ErrAbortHandler also suppresses logging of a stack trace to the server's error log.
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Tue Mar 26 16:28:45 UTC 2024
    - 9.9K bytes
    - Viewed (0)
  6. staging/src/k8s.io/apiserver/pkg/server/filters/timeout.go

    		// the client sees an interrupted response but the server doesn't log
    		// an error, panic with the value ErrAbortHandler.
    		//
    		// We are throwing http.ErrAbortHandler deliberately so that a client is notified and to suppress a not helpful stacktrace in the logs
    		panic(http.ErrAbortHandler)
    	}
    }
    
    func (tw *baseTimeoutWriter) CloseNotify() <-chan bool {
    	tw.mu.Lock()
    	defer tw.mu.Unlock()
    
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Tue Mar 26 16:28:45 UTC 2024
    - 8.9K bytes
    - Viewed (0)
  7. staging/src/k8s.io/apiserver/pkg/endpoints/handlers/finisher/finisher.go

    		// panics don't cross goroutine boundaries, so we have to handle ourselves
    		defer func() {
    			reason := recover()
    			if reason != nil {
    				// do not wrap the sentinel ErrAbortHandler panic value
    				if reason != http.ErrAbortHandler {
    					// Same as stdlib http server code. Manually allocate stack
    					// trace buffer size to prevent excessively large logs
    					const size = 64 << 10
    					buf := make([]byte, size)
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Fri May 07 14:20:33 UTC 2021
    - 6K bytes
    - Viewed (0)
  8. staging/src/k8s.io/apiserver/pkg/server/filters/priority-and-fairness.go

    		// dedicated goroutine and the actual watch handler in the main one.
    		go func() {
    			defer func() {
    				err := recover()
    				// do not wrap the sentinel ErrAbortHandler panic value
    				if err != nil && err != http.ErrAbortHandler {
    					// Same as stdlib http server code. Manually allocate stack
    					// trace buffer size to prevent excessively large logs
    					const size = 64 << 10
    					buf := make([]byte, size)
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Mon Oct 30 12:18:35 UTC 2023
    - 15.3K bytes
    - Viewed (0)
  9. src/net/http/httputil/reverseproxy.go

    		// is abort the request. Issue 23643: ReverseProxy should use ErrAbortHandler
    		// on read error while copying body.
    		if !shouldPanicOnCopyError(req) {
    			p.logf("suppressing panic for copyResponse error in test; copy error: %v", err)
    			return
    		}
    		panic(http.ErrAbortHandler)
    	}
    	res.Body.Close() // close now, instead of defer, to populate res.Trailer
    
    	if len(res.Trailer) > 0 {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Feb 27 23:37:42 UTC 2024
    - 24.9K bytes
    - Viewed (0)
  10. src/net/http/clientserver_test.go

    		t.Run("nil", func(t *testing.T) { t.Setenv("GODEBUG", "panicnil=1"); testInterruptWithPanic(t, mode, nil) })
    		t.Run("ErrAbortHandler", func(t *testing.T) { testInterruptWithPanic(t, mode, ErrAbortHandler) })
    	}, testNotParallel)
    }
    func testInterruptWithPanic(t *testing.T, mode testMode, panicValue any) {
    	const msg = "hello"
    
    	testDone := make(chan struct{})
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 01:00:11 UTC 2024
    - 46.6K bytes
    - Viewed (0)
Back to top