superfly / flyctl

Command line tools for fly.io services
https://fly.io
Apache License 2.0
1.37k stars 226 forks source link

fix(bluegreen): fix bug preventing rollbacks on failed green machine creations #3599

Closed gwuah closed 1 month ago

gwuah commented 1 month ago

Change Summary

This PR properly handles aborts during green machine creations and fixes the rollback bug.

The bug was being caused by the fact that greenMachines array was only being updated if an error didn't happen across all creations. And so in cases where an error happened, the greenMachines array was empty and rollback logic couldn't see any machines to delete.

I narrowed this down by looking at the trace for the failed deployment, which showed that the rollback fn was actually called. All the tracing we have helped me narrow down my search area

.

Screenshot 2024-06-05 at 22 41 05