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: cases where opamp agent send disconnect message as a first messa… #1577

Merged
merged 2 commits into from
Oct 9, 2024
Merged
Changes from all commits
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
6 changes: 5 additions & 1 deletion opampserver/pkg/server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,11 @@ func StartOpAmpServer(ctx context.Context, logger logr.Logger, mgr ctrl.Manager,
}

if isAgentDisconnect {
logger.Info("Agent disconnected", "workloadNamespace", connectionInfo.Workload.Namespace, "workloadName", connectionInfo.Workload.Name, "workloadKind", connectionInfo.Workload.Kind)

// This may occurs when Odiglet restarts, and a previously connected pod sends a disconnect message right after reconnecting.
if connectionInfo != nil {
logger.Info("Agent disconnected", "workloadNamespace", connectionInfo.Workload.Namespace, "workloadName", connectionInfo.Workload.Name, "workloadKind", connectionInfo.Workload.Kind)
}
// if agent disconnects, remove the connection from the cache
// as it is not expected to send additional messages
connectionCache.RemoveConnection(instanceUid)
Expand Down
Loading