Skip to content

[shim] Fix DCGMWrapperInterface nil check #2980

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 13, 2025

Conversation

un-def
Copy link
Collaborator

@un-def un-def commented Aug 13, 2025

Fixes: #2979

@un-def un-def requested a review from r4victor August 13, 2025 10:41
@@ -24,7 +25,7 @@ func (s *ShimServer) HealthcheckHandler(w http.ResponseWriter, r *http.Request)
func (s *ShimServer) InstanceHealthHandler(w http.ResponseWriter, r *http.Request) (interface{}, error) {
ctx := r.Context()
response := InstanceHealthResponse{}
if s.dcgmWrapper != nil {
if !reflect.ValueOf(s.dcgmWrapper).IsNil() {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should work, but I suppose if implementation changes so that dcgmWrapper is a struct and not a struct pointer, this will panic?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Apparently, yes. But we specifically use a pointer to distinguish between cases when DCGM is available and when it's not, it's unlikely that we will change this.

@un-def un-def merged commit 5fb7af3 into master Aug 13, 2025
26 checks passed
@un-def un-def deleted the issue_2979_shim_fix_nil_dcgmwrapperinterface branch August 13, 2025 11:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: Shim fails on /api/instance/health if libdcgm.so is not installed
2 participants