Skip to content

fix: workload log streaming follows pod rollouts#375

Merged
nadaverell merged 1 commit intomainfrom
fix/workload-logs-pod-rollover
Mar 28, 2026
Merged

fix: workload log streaming follows pod rollouts#375
nadaverell merged 1 commit intomainfrom
fix/workload-logs-pod-rollover

Conversation

@nadaverell
Copy link
Copy Markdown
Contributor

Summary

During a deployment rollout, the workload log viewer would sometimes show "No logs available" after pods rolled over. Two independent bugs:

  • Frontend: The pod_added and pod_removed SSE events (already sent by the backend) were never listened to. When the old pod terminated, its log entries were filtered out before new pod logs arrived — leaving the viewer empty.
  • Backend: If a new pod wasn't ready when the 5-second discovery tick fired, streamPodLogs failed and was never retried — the pod was already in knownPods so future ticks skipped it.

Changes

  • useLogStream.ts: Added pod_added/pod_removed event listeners with optional callbacks
  • WorkloadLogsViewer.tsx: Handles pod lifecycle events — adds new pods to the filter and auto-selects them; keeps old log entries visible during transitions
  • workload_logs.go: Discovery tick now calls startPodStreams for all current pods (not just new ones), safely retrying failed streams since the function already skips active ones

Closes #355

@nadaverell nadaverell requested a review from hisco as a code owner March 28, 2026 20:47
During a deployment rollout, the workload log viewer would sometimes show
"No logs available" because:

1. The frontend removed terminated pods from the selected filter, hiding
   all existing log entries before new pod logs arrived
2. The backend never retried failed log streams — if a new pod wasn't
   ready when first discovered, its stream silently failed and was never
   restarted

Frontend now handles pod_added/pod_removed SSE events (already sent by
backend but previously ignored), keeps old log entries visible during
transitions, and auto-selects new pods. Backend now retries stream
connections for all current pods on each discovery tick, with a retry
limit of 5 attempts per pod/container to avoid unbounded retries for
permanently broken pods.

Closes #355
@nadaverell nadaverell force-pushed the fix/workload-logs-pod-rollover branch from 782f4a0 to 89d22b4 Compare March 28, 2026 20:59
@nadaverell nadaverell merged commit 4d82256 into main Mar 28, 2026
5 of 6 checks passed
@nadaverell nadaverell deleted the fix/workload-logs-pod-rollover branch March 28, 2026 21:04
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.

New Pod Auto-Update in logs section

1 participant