Skip to content
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

Fix loading statusfile error checking #1198

Merged
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion pkg/workceptor/workceptor.go
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,10 @@
if !ok {
statusFilename := path.Join(unitdir, "status")
sfd := &StatusFileData{}
_ = sfd.Load(statusFilename)
err := sfd.Load(statusFilename)
if err != nil {
w.nc.GetLogger.Error("Error loading %s: %s", statusFilename, err)

Check failure on line 342 in pkg/workceptor/workceptor.go

View workflow job for this annotation

GitHub Actions / go test coverage

w.nc.GetLogger.Error undefined (type func() *logger.ReceptorLogger has no field or method Error)

Check failure on line 342 in pkg/workceptor/workceptor.go

View workflow job for this annotation

GitHub Actions / go test coverage

w.nc.GetLogger.Error undefined (type func() *logger.ReceptorLogger has no field or method Error)

Check failure on line 342 in pkg/workceptor/workceptor.go

View workflow job for this annotation

GitHub Actions / receptor (Go 1.20)

w.nc.GetLogger.Error undefined (type func() *logger.ReceptorLogger has no field or method Error)

Check failure on line 342 in pkg/workceptor/workceptor.go

View workflow job for this annotation

GitHub Actions / lint-receptor

w.nc.GetLogger.Error undefined (type func() *logger.ReceptorLogger has no field or method Error)

Check failure on line 342 in pkg/workceptor/workceptor.go

View workflow job for this annotation

GitHub Actions / lint-receptor

w.nc.GetLogger.Error undefined (type func() *logger.ReceptorLogger has no field or method Error)

Check failure on line 342 in pkg/workceptor/workceptor.go

View workflow job for this annotation

GitHub Actions / lint-receptor

w.nc.GetLogger.Error undefined (type func() *logger.ReceptorLogger has no field or method Error)

Check failure on line 342 in pkg/workceptor/workceptor.go

View workflow job for this annotation

GitHub Actions / lint-receptor

w.nc.GetLogger.Error undefined (type func() *logger.ReceptorLogger has no field or method Error)

Check failure on line 342 in pkg/workceptor/workceptor.go

View workflow job for this annotation

GitHub Actions / receptor (Go 1.21)

w.nc.GetLogger.Error undefined (type func() *logger.ReceptorLogger has no field or method Error)
}
w.workTypesLock.RLock()
wt, ok := w.workTypes[sfd.WorkType]
w.workTypesLock.RUnlock()
Expand All @@ -352,7 +355,7 @@

return
}
err := worker.Load()

Check failure on line 358 in pkg/workceptor/workceptor.go

View workflow job for this annotation

GitHub Actions / go test coverage

no new variables on left side of :=

Check failure on line 358 in pkg/workceptor/workceptor.go

View workflow job for this annotation

GitHub Actions / go test coverage

no new variables on left side of :=

Check failure on line 358 in pkg/workceptor/workceptor.go

View workflow job for this annotation

GitHub Actions / receptor (Go 1.20)

no new variables on left side of :=

Check failure on line 358 in pkg/workceptor/workceptor.go

View workflow job for this annotation

GitHub Actions / lint-receptor

no new variables on left side of :=

Check failure on line 358 in pkg/workceptor/workceptor.go

View workflow job for this annotation

GitHub Actions / lint-receptor

no new variables on left side of :=

Check failure on line 358 in pkg/workceptor/workceptor.go

View workflow job for this annotation

GitHub Actions / lint-receptor

no new variables on left side of :=

Check failure on line 358 in pkg/workceptor/workceptor.go

View workflow job for this annotation

GitHub Actions / receptor (Go 1.21)

no new variables on left side of :=
if err != nil {
w.nc.GetLogger().Warning("Failed to restart worker %s due to read error: %s", unitdir, err)
worker.UpdateBasicStatus(WorkStateFailed, fmt.Sprintf("Failed to restart: %s", err), stdoutSize(unitdir))
Expand Down
Loading