Skip to content

Commit fb2d42a

Browse files
spraveenioy2kenny-amd
authored andcommitted
remove pulse from base images, add timeout grpc req
1 parent 7ccad63 commit fb2d42a

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

internal/pkg/exporter/health.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ import (
2323
"fmt"
2424
"os"
2525
"strings"
26+
"time"
2627
"github.com/ROCm/k8s-device-plugin/internal/pkg/exporter/metricssvc"
2728
"google.golang.org/grpc"
2829
"google.golang.org/grpc/credentials/insecure"
@@ -33,6 +34,7 @@ import (
3334

3435
const (
3536
healthSocket = "/var/lib/amd-metrics-exporter/amdgpu_device_metrics_exporter_grpc.socket"
37+
queryTimeout = 5 * time.Second
3638
)
3739

3840
// getGPUHealth returns device id map with health state if the metrics service
@@ -61,7 +63,10 @@ func getGPUHealth() (hMap map[string]string, err error) {
6163

6264
defer conn.Close()
6365

64-
resp, err := client.List(context.Background(), &emptypb.Empty{})
66+
ctx, cancel := context.WithTimeout(context.Background(), queryTimeout)
67+
defer cancel()
68+
69+
resp, err := client.List(ctx, &emptypb.Empty{})
6570
if err != nil {
6671
glog.Errorf("Error getting health info svc : %v", err)
6772
return

ubi-dp.Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,4 +48,4 @@ RUN mkdir -p /licenses && \
4848
ADD ./LICENSE /licenses/LICENSE
4949
WORKDIR /root/
5050
COPY --from=builder /go/bin/k8s-device-plugin .
51-
CMD ["./k8s-device-plugin", "-logtostderr=true", "-stderrthreshold=INFO", "-v=5", "-pulse=30"]
51+
CMD ["./k8s-device-plugin", "-logtostderr=true", "-stderrthreshold=INFO", "-v=5"]

0 commit comments

Comments
 (0)