Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cmd/queue/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ func buildServer(ctx context.Context, env config, healthState *health.State, rp
composedHandler = tracing.HTTPSpanMiddleware(composedHandler)
}

composedHandler = health.ProbeHandler(healthState, rp.ProbeContainer, rp.IsAggressive(), tracingEnabled, composedHandler)
composedHandler = health.ProbeHandler(healthState, rp.ProbeContainer, tracingEnabled, composedHandler)
composedHandler = network.NewProbeHandler(composedHandler)
// We might want sometimes capture the probes/healthchecks in the request
// logs. Hence we need to have RequestLogHandler to be the first one.
Expand Down
2 changes: 1 addition & 1 deletion cmd/queue/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ func TestQueueTraceSpans(t *testing.T) {
h := queue.ProxyHandler(breaker, network.NewRequestStats(time.Now()), true /*tracingEnabled*/, proxy)
h(writer, req)
} else {
h := health.ProbeHandler(healthState, tc.prober, true /* isAggressive*/, true /*tracingEnabled*/, nil)
h := health.ProbeHandler(healthState, tc.prober, true /*tracingEnabled*/, nil)
req.Header.Set(network.ProbeHeaderName, tc.requestHeader)
h(writer, req)
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/queue/health/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ const badProbeTemplate = "unexpected probe header value: "

// ProbeHandler returns a http.HandlerFunc that responds to health checks if the
// knative network probe header is passed, and otherwise delegates to the next handler.
func ProbeHandler(healthState *State, prober func() bool, isAggressive bool, tracingEnabled bool, next http.Handler) http.HandlerFunc {
func ProbeHandler(healthState *State, prober func() bool, tracingEnabled bool, next http.Handler) http.HandlerFunc {
return func(w http.ResponseWriter, r *http.Request) {
ph := network.KnativeProbeHeader(r)

Expand Down
2 changes: 1 addition & 1 deletion pkg/queue/health/handler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ func TestProbeHandler(t *testing.T) {
req.Header.Set(network.ProbeHeaderName, tc.requestHeader)
}

h := ProbeHandler(healthState, tc.prober, true /* isAggressive*/, true /*tracingEnabled*/, incHandler)
h := ProbeHandler(healthState, tc.prober, true /*tracingEnabled*/, incHandler)
h(writer, req)

if got, want := writer.Code, tc.wantCode; got != want {
Expand Down
6 changes: 3 additions & 3 deletions pkg/queue/readiness/probe.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,8 @@ func NewProbeWithHTTP2AutoDetection(v1p *corev1.Probe) *Probe {
}
}

// IsAggressive indicates whether the Knative probe with aggressive retries should be used.
func (p *Probe) IsAggressive() bool {
// shouldProbeAggressively indicates whether the Knative probe with aggressive retries should be used.
func (p *Probe) shouldProbeAggressively() bool {
return p.PeriodSeconds == 0
}

Expand Down Expand Up @@ -155,7 +155,7 @@ func (p *Probe) probeContainerImpl() bool {
}

func (p *Probe) doProbe(probe func(time.Duration) error) error {
if !p.IsAggressive() {
if !p.shouldProbeAggressively() {
return probe(time.Duration(p.TimeoutSeconds) * time.Second)
}

Expand Down