diff --git a/worker/task.go b/worker/task.go index e0877db9e71..a6c2fd9d012 100644 --- a/worker/task.go +++ b/worker/task.go @@ -1855,6 +1855,12 @@ func (w *grpcWorker) ServeTask(ctx context.Context, q *pb.Query) (*pb.Result, er return &pb.Result{}, ctx.Err() } + // It could be possible that the server isn't ready but a peer sends a + // request. In that case we should check for the health here. + if err := x.HealthCheck(); err != nil { + return nil, err + } + gid, err := groups().BelongsToReadOnly(q.Attr, q.ReadTs) switch { case err != nil: