Skip to content

Commit f35707a

Browse files
fix req timeout removing capability v2
1 parent 0c12f1f commit f35707a

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

server/job_rpc.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -595,8 +595,9 @@ func processJob(ctx context.Context, h *lphttp, w http.ResponseWriter, r *http.R
595595
resp, err := sendReqWithTimeout(req, time.Duration(jobReq.Timeout)*time.Second)
596596
if err != nil {
597597
clog.Errorf(ctx, "job not able to be processed err=%v ", err.Error())
598-
//if the request failed with an error, remove the capability
599-
if err != context.DeadlineExceeded && err != context.Canceled {
598+
//if the request failed with connection error, remove the capability
599+
//exclude deadline exceeded or context canceled errors does not indicate a fatal error all the time
600+
if err != context.DeadlineExceeded && !strings.Contains(err.Error(), "context canceled") {
600601
clog.Errorf(ctx, "removing capability %v due to error %v", jobReq.Capability, err.Error())
601602
h.orchestrator.RemoveExternalCapability(jobReq.Capability)
602603
}

0 commit comments

Comments
 (0)