Skip to content

Commit

Permalink
fix(errors): report scheduling errors
Browse files Browse the repository at this point in the history
  • Loading branch information
philwinder committed Oct 15, 2024
1 parent 6a937c0 commit 9a1380b
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions api/pkg/openai/helix_openai_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,21 @@ func (c *InternalHelixServer) GetNextLLMInferenceRequest(ctx context.Context, fi

// If we can't retry, write an error to the request and continue so it takes it off
// the queue
// TODO(Phil): Not sure how to write an error back as a response
log.Error().Err(err).Str("id", work.ID()).Msg("error scheduling")
resp := &types.RunnerLLMInferenceResponse{
RequestID: req.RequestID,
OwnerID: req.OwnerID,
Error: err.Error(),
Done: true,
}
bts, err := json.Marshal(resp)
if err != nil {
log.Error().Err(err).Str("id", work.ID()).Msg("error marshalling runner response")
}

err = c.pubsub.Publish(ctx, pubsub.GetRunnerResponsesQueue(resp.OwnerID, resp.RequestID), bts)
if err != nil {
log.Error().Err(err).Str("id", work.ID()).Msg("error publishing runner response")
}
}
taken++
}
Expand Down

0 comments on commit 9a1380b

Please sign in to comment.