Skip to content

Check if oldMachine is nil when updating process group#4180

Merged
somtochiama merged 3 commits into
masterfrom
fix-panic
Jan 21, 2025
Merged

Check if oldMachine is nil when updating process group#4180
somtochiama merged 3 commits into
masterfrom
fix-panic

Conversation

@somtochiama
Copy link
Copy Markdown
Contributor

@somtochiama somtochiama commented Jan 21, 2025

Change Summary

Sometimes, the oldMachine field in the MachineTuple during deploys is nil and we don't check for this when loading from the healthCheckPassed sync map.

machineTuples = append(machineTuples, machinePairing{oldMachine: nil, newMachine: newMachine})
.

What and Why:
This fixes a panic that users occasionally encounter during deploy

How:

Related to:


Documentation

  • Fresh Produce
  • In superfly/docs, or asked for help from docs team
  • n/a

@somtochiama somtochiama requested review from DAlperin and kzys January 21, 2025 12:30
@DAlperin
Copy link
Copy Markdown
Contributor

I still don't love that I don't know why that is sometimes nil but this is a good defensive programming change anyway 🤷🏼

@somtochiama somtochiama merged commit 0e171f4 into master Jan 21, 2025
@somtochiama somtochiama deleted the fix-panic branch January 21, 2025 18:30
Lucais11 added a commit that referenced this pull request May 27, 2026
When updateMachineWChecks returns an error for a scale-up pairing
(oldMachine=nil), the error-formatting line dereferenced oldMachine.ID
and panicked inside an errgroup goroutine, crashing the deploy. Use the
locally-scoped machineID variable that already handles the nil-oldMachine
case.

The originally-reported panic in #4528 (at the now-removed
healthChecksPassed.Load(machPair.oldMachine.ID) site) was patched in
#4180; this closes the remaining oldMachine.ID deref in the same
function. Sibling fix to #4750.

Fixes #4528
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.

3 participants