consul icon indicating copy to clipboard operation
consul copied to clipboard

Add deep copies to API Gateway controller

Open sarahalsmiller opened this issue 1 year ago • 2 comments

Description

  • While debugging an issue with the acceptance test it was pointed out that the gateway controller was making changes directly to the pointer returned from the storage layer. This PR adds deep copy functionality everywhere possible in the controller, as well as fixes a small pointer issue caught by making this update.

Testing & Reproduction steps

  • CI tests pass, no behavior change should come from this update.

Links

-->

PR Checklist

  • [ ] updated test coverage
  • [ ] external facing docs updated
  • [ X ] appropriate backport labels added
  • [ ] not a security concern

sarahalsmiller avatar Nov 01 '23 18:11 sarahalsmiller

In general this seems to be yet another place where I want to shore up our storage contract to not bleed implementation details. This and having to magically know to discard any held pointers during a restore operation are kind of crazy from a usability perspective. Really I would much prefer we just always return copies during any read operation against the store, especially since mutating any pointers returned from the underlying storage layer automatically voids any sort of thread safety within the store 😞, but that's definitely a bigger issue...

andrewstucki avatar Nov 01 '23 20:11 andrewstucki

This pull request has been automatically flagged for inactivity because it has not been acted upon in the last 60 days. It will be closed if no new activity occurs in the next 30 days. Please feel free to re-open to resurrect the change if you feel this has happened by mistake. Thank you for your contributions.

github-actions[bot] avatar Jan 28 '24 01:01 github-actions[bot]

Closing due to inactivity. If you feel this was a mistake or you wish to re-open at any time in the future, please leave a comment and it will be re-surfaced for the maintainers to review.

github-actions[bot] avatar Feb 28 '24 01:02 github-actions[bot]