Skip to content

A stale HTTP 207 response can mark an unsent group as accepted. #554

Description

@akinross

Ansible Version

n/a

Ansible Collection Versions

n/a

Ansible Collection Module

Cisco Nexus Dashboard Version

n/a

Cisco NX-OS Version

Cisco ACI Version

Expected Behavior

If a normalize request fails before receiving a response, every interface in that request should remain in _pending_normalizes. The failure-path finalizer must not deploy those interfaces because their normalization was never accepted.

Actual Behavior

_dequeue_accepted_normalizes() reads rest_send.response_current. If the current request raises inside sender.commit() before response_current is updated, it still contains the previous request’s HTTP 207 response.
When both groups contain the same interface name on different switches, the stale success result matches the unsent group by name. That group is removed from _pending_normalizes and can subsequently be deployed even though its normalize request was never sent successfully.

Ansible Playbook

n/a

Steps to Reproduce

1. Queue the same interface name on two switches:
[
    ("Ethernet1/31", "FDO11111AAA"),
    ("Ethernet1/31", "FDO22222BBB"),
]
2. Return HTTP 207 with Ethernet1/31: success for the first switch’s normalize request.
3. For the second request, make sender.commit() raise before assigning a new response.
4. Call _normalize_interfaces().
5. Observe that _dequeue_accepted_normalizes() reads the first request’s stale 207 response.
6. The second switch’s pair is incorrectly removed from _pending_normalizes.
7. deploy_accepted_mutations() may then deploy both switches instead of only the first.
The existing HTTP-500 test does not reproduce this because the 500 response replaces response_current; the second request specifically needs to fail before response assignment.

Relevant Debug Output

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions