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: Do not log wakeup error when app is in stopping state #2145

Merged
merged 3 commits into from
Nov 20, 2024
Merged
Show file tree
Hide file tree
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
7 changes: 5 additions & 2 deletions internal/pkg/service/appsproxy/dataapps/wakeup/wakeup.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,10 @@ import (

// Interval sets how often the proxy sends wakeup request to sandboxes service.
// If the last notification for the app was less than this Interval ago then the notification is skipped.
const Interval = time.Second
const (
Interval = time.Second
wakeupErrorToBeSkipped = `can't have desired state "running". Currently is in state: "stopping", desired state: "stopped"`
)

type Manager struct {
clock clock.Clock
Expand Down Expand Up @@ -68,7 +71,7 @@ func (l *Manager) Wakeup(ctx context.Context, appID api.AppID) error {
item.nextRequestAfter = now.Add(Interval)

// Send the notification
if _, err := l.api.WakeupApp(appID).Send(ctx); err != nil {
if _, err := l.api.WakeupApp(appID).Send(ctx); err != nil && err.Error() != wakeupErrorToBeSkipped {
Matovidlo marked this conversation as resolved.
Show resolved Hide resolved
l.logger.Errorf(ctx, `failed sending wakeup request to Sandboxes Service about for app "%s": %s`, appID, err.Error())
return err
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import (

const (
notifyRequestTimeout = 5 * time.Second
wakeupRequestTimeout = 15 * time.Second
wakeupRequestTimeout = 60 * time.Second
attrWakeupReason = "proxy.wakeup.reason"
attrWebsocket = "proxy.websocket"
)
Expand Down