Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(cache): Nil panic from elasticcache new endpoint #1849

Conversation

dee0
Copy link

@dee0 dee0 commented Aug 25, 2023

Description of your changes

Add a test case that replicates issue #1838 and a fix for same.
NOTE:
Test case is a little different from others because I wanted the mock to replicate as closely as possible the we saw from AWS when we encountered #1838. That is, I didn't want to fix the panic we saw only to find out there were other problems we weren't aware of. Anyhoo, this meant setting some fields in the mock that no other Observe tests are setting.

Fixes #1838

I have:

  • Read and followed Crossplane's [contribution process].
  • Run make reviewable test to ensure this PR is ready for review.

How has this code been tested

I added a test case that reproduces the issue to the Observe test.
I made my change and confirmed that my new test case passed.
I then confirmed that all existing cache tests still passed.

@dee0 dee0 force-pushed the 1838-nil-panic-from-elasticcache-newEndpoint branch from d500748 to 8ba21e9 Compare August 25, 2023 18:08
@MisterMX MisterMX changed the title 1838 nil panic from elasticcache new endpoint fix(cache): Nil panic from elasticcache new endpoint Aug 28, 2023
@MisterMX
Copy link
Collaborator

LGTM. Thank you very much @dee0. Can you solve the conflicts and squash your changes into a single commit?

@dee0 dee0 force-pushed the 1838-nil-panic-from-elasticcache-newEndpoint branch from 18ff591 to 210840a Compare August 28, 2023 16:32
@dee0
Copy link
Author

dee0 commented Aug 28, 2023

Hey @MisterMX
Thanks for looking at this.

Squashed my commits and merged the latest master into my branch to resolve the merge conflict.

While the merge conflicts are one and there is just 1 commit from me showing, the PR is saying there are 11 commits total. Think Github may be confused. :)

In any case, please let me know if there is something more for me to do.

@MisterMX
Copy link
Collaborator

@dee0 thanks for doing the fix. It is generally not recommended to use git merge to update a feature branch with master because it will create a merge commit that is probably confusing Git. It is better to use git rebase in such case.

To provide a clean history (only a single commit) can you do a clean rebase so you only have a single commit left? You can drop the other commits in an interactive rebase using git rebase -i. If that, for any reason, doesn't work you can delete the branch locally, create it anew, cherry pick the changes you need and push it again.

I hope that isn't too inconvenient to you, but I would like to keep the upstream repo as clean as possible.

@dee0sap
Copy link
Contributor

dee0sap commented Aug 29, 2023

Hey @MisterMX

No worries I'll try to sort out.

@dee0 dee0 force-pushed the 1838-nil-panic-from-elasticcache-newEndpoint branch from f6d9d9f to 6d03003 Compare August 29, 2023 18:07
@dee0 dee0 force-pushed the 1838-nil-panic-from-elasticcache-newEndpoint branch from 6d03003 to fd1cd2e Compare August 29, 2023 18:27
@dee0sap
Copy link
Contributor

dee0sap commented Aug 29, 2023

Hey @MisterMX
Now down to 1 commit.

Copy link
Collaborator

@MisterMX MisterMX left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thank you very much @dee0!

@MisterMX MisterMX merged commit 2e52b0a into crossplane-contrib:master Aug 30, 2023
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.

Crashloop - nil pointer panic from pkg/clients/elasticache.newEndpoint on enounter of unhealthy cachegroup
4 participants