fix: preserve unique machine IDs during provider sync in list query#203
Open
fix: preserve unique machine IDs during provider sync in list query#203
Conversation
ListMachinesHandler.execute_query() used synced_machines[0] after syncing with AWS, always picking the first instance in the reservation regardless of which machine was being iterated. This caused return --all to send the same instance ID repeated N times instead of N unique IDs. Match synced machine by ID instead of blindly taking the first element.
Contributor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
ListMachinesHandler.execute_query()usedsynced_machines[0]after syncing with AWS, always picking the first instance in the reservation regardless of which machine was being iterated. This causedorb machines return --allto send the same instance ID repeated N times instead of N unique IDs — only 1 instance was actually terminated. Affected all code paths usingListMachinesQuery: return, list, stop, start (CLI, SDK, API, MCP).Type of Change
Related Issues
How Has This Been Tested?
tests/unit/application/queries/test_list_machines_sync_unique_ids.pyorb machines return --all --forcewas sending duplicate IDsTest Configuration
Checklist
Additional Notes
Root cause:
fetch_provider_machines()returns all instances in a reservation (not just the one being iterated). The code then blindly tooksynced_machines[0], overwriting every machine in the loop with the same instance. Fix: match the synced machine back to the current machine by ID.Performance Impact
Security Considerations
Dependencies
None.
Reviewers
@awslabs/orb-maintainers