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

Resolve panic in gateway validation client #6260

Merged
merged 8 commits into from
Apr 7, 2022
Merged

Conversation

sam-heilbron
Copy link
Contributor

@sam-heilbron sam-heilbron commented Apr 7, 2022

Description

Ensure that the gateway validation client is never set to nil

Context

We encountered this bug in tests that would occasionally panic, however the bug itself could impact customers

Verification

I wrote a test first, and add that as the first commit. If you checkout just that test (no other changes) it will panic in the way that we noticed in some e2e tests. If you then checkout my fix and re-run the same test, it will pass.

General Thoughts

I believe this issue arises because we have a local variable for clientReinstantiateError and a class variable for constructorClient. This means that we can ensure that on a clientReinstantiateError we do not retry, but we do set the client to nil which could be picked up on the subsequent request.

Checklist:

  • I included a concise, user-facing changelog (for details, see https://github.com/solo-io/go-utils/tree/master/changelogutils) which references the issue that is resolved.
  • If I updated APIs (our protos) or helm values, I ran make -B install-go-tools generated-code to ensure there will be no code diff
  • I followed guidelines laid out in the Gloo Edge contribution guide
  • I opened a draft PR or added the work in progress label if my PR is not ready for review
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works

BOT NOTES:
resolves #6237

@solo-changelog-bot
Copy link

Issues linked to changelog:
#6237

@github-actions github-actions bot added the keep pr updated signals bulldozer to keep pr up to date with base branch label Apr 7, 2022
@sam-heilbron sam-heilbron marked this pull request as ready for review April 7, 2022 16:25
Copy link
Contributor

@kdorosh kdorosh left a comment

Choose a reason for hiding this comment

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

seems reasonable to me

Co-authored-by: Kevin Dorosh <kevin.dorosh@solo.io>
@github-actions
Copy link

github-actions bot commented Apr 7, 2022

Visit the preview URL for this PR (updated for commit 4db0b08):

https://gloo-edge--pr6260-test-flakes-6237-ug3745ow.web.app

(expires Thu, 14 Apr 2022 17:19:55 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

Copy link
Contributor

@gunnar-solo gunnar-solo left a comment

Choose a reason for hiding this comment

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

Nice fix! The null guard makes sense to me, per the original issue hitting a nil on robust_client.go:66.

The patched line is the only place (I can see) where c.validationClient is set

@soloio-bulldozer soloio-bulldozer bot merged commit 1d72050 into master Apr 7, 2022
@soloio-bulldozer soloio-bulldozer bot deleted the test-flakes/6237 branch April 7, 2022 17:42
sam-heilbron added a commit that referenced this pull request Apr 11, 2022
* add test

* add fix for panicing test

* unfocus test

* add changelog

* goimports -w

* Update changelog/v1.12.0-beta2/robust-client-panic.yaml

Co-authored-by: Kevin Dorosh <kevin.dorosh@solo.io>

Co-authored-by: Kevin Dorosh <kevin.dorosh@solo.io>
Co-authored-by: soloio-bulldozer[bot] <48420018+soloio-bulldozer[bot]@users.noreply.github.com>
soloio-bulldozer bot added a commit that referenced this pull request Apr 11, 2022
* Reduce test flakes (#6211)

* First pass of cleanup

* more

* Fixup gateway e2e tests

* add changelog

* fix route options tests?

* cleanup comments in assertions

* Just after each to match just before

* re-add config

Co-authored-by: soloio-bulldozer[bot] <48420018+soloio-bulldozer[bot]@users.noreply.github.com>

* Resolve panic in gateway validation client (#6260)

* add test

* add fix for panicing test

* unfocus test

* add changelog

* goimports -w

* Update changelog/v1.12.0-beta2/robust-client-panic.yaml

Co-authored-by: Kevin Dorosh <kevin.dorosh@solo.io>

Co-authored-by: Kevin Dorosh <kevin.dorosh@solo.io>
Co-authored-by: soloio-bulldozer[bot] <48420018+soloio-bulldozer[bot]@users.noreply.github.com>

* Resolve consul plugin data race (#6271)

* use dependency injectio to handle fallback resolution

* add changelog

* fixup dns resolvers and test

* Resolve data race in setup syncer test (#6282)

* add changelogs

* delete duplicate changelogs

Co-authored-by: soloio-bulldozer[bot] <48420018+soloio-bulldozer[bot]@users.noreply.github.com>
Co-authored-by: Kevin Dorosh <kevin.dorosh@solo.io>
sam-heilbron added a commit that referenced this pull request Apr 11, 2022
* Reduce test flakes (#6211)

* First pass of cleanup

* more

* Fixup gateway e2e tests

* add changelog

* fix route options tests?

* cleanup comments in assertions

* Just after each to match just before

* re-add config

Co-authored-by: soloio-bulldozer[bot] <48420018+soloio-bulldozer[bot]@users.noreply.github.com>

* Resolve panic in gateway validation client (#6260)

* add test

* add fix for panicing test

* unfocus test

* add changelog

* goimports -w

* Update changelog/v1.12.0-beta2/robust-client-panic.yaml

Co-authored-by: Kevin Dorosh <kevin.dorosh@solo.io>

Co-authored-by: Kevin Dorosh <kevin.dorosh@solo.io>
Co-authored-by: soloio-bulldozer[bot] <48420018+soloio-bulldozer[bot]@users.noreply.github.com>

* Resolve consul plugin data race (#6271)

* use dependency injectio to handle fallback resolution

* add changelog

* fixup dns resolvers and test

* Resolve data race in setup syncer test (#6282)

* add changelogs

* delete duplicate changelogs

Co-authored-by: soloio-bulldozer[bot] <48420018+soloio-bulldozer[bot]@users.noreply.github.com>
Co-authored-by: Kevin Dorosh <kevin.dorosh@solo.io>
@sam-heilbron sam-heilbron mentioned this pull request Apr 11, 2022
8 tasks
sam-heilbron added a commit that referenced this pull request Apr 11, 2022
* add test

* add fix for panicing test

* unfocus test

* add changelog

* goimports -w

* Update changelog/v1.12.0-beta2/robust-client-panic.yaml

Co-authored-by: Kevin Dorosh <kevin.dorosh@solo.io>

Co-authored-by: Kevin Dorosh <kevin.dorosh@solo.io>
Co-authored-by: soloio-bulldozer[bot] <48420018+soloio-bulldozer[bot]@users.noreply.github.com>
soloio-bulldozer bot added a commit that referenced this pull request Apr 11, 2022
* Reduce test flakes (#6211)

* First pass of cleanup

* more

* Fixup gateway e2e tests

* add changelog

* fix route options tests?

* cleanup comments in assertions

* Just after each to match just before

* re-add config

Co-authored-by: soloio-bulldozer[bot] <48420018+soloio-bulldozer[bot]@users.noreply.github.com>

* Resolve panic in gateway validation client (#6260)

* add test

* add fix for panicing test

* unfocus test

* add changelog

* goimports -w

* Update changelog/v1.12.0-beta2/robust-client-panic.yaml

Co-authored-by: Kevin Dorosh <kevin.dorosh@solo.io>

Co-authored-by: Kevin Dorosh <kevin.dorosh@solo.io>
Co-authored-by: soloio-bulldozer[bot] <48420018+soloio-bulldozer[bot]@users.noreply.github.com>

* Resolve consul plugin data race (#6271)

* use dependency injectio to handle fallback resolution

* add changelog

* fixup dns resolvers and test

* Resolve data race in setup syncer test (#6282)

* add changelogs

* delete duplicate changelogs

Co-authored-by: soloio-bulldozer[bot] <48420018+soloio-bulldozer[bot]@users.noreply.github.com>
Co-authored-by: Kevin Dorosh <kevin.dorosh@solo.io>

Co-authored-by: soloio-bulldozer[bot] <48420018+soloio-bulldozer[bot]@users.noreply.github.com>
Co-authored-by: Kevin Dorosh <kevin.dorosh@solo.io>
soloio-bulldozer bot added a commit that referenced this pull request Apr 12, 2022
* Reduce test flakes (#6211)

* First pass of cleanup

* more

* Fixup gateway e2e tests

* add changelog

* fix route options tests?

* cleanup comments in assertions

* Just after each to match just before

* re-add config

Co-authored-by: soloio-bulldozer[bot] <48420018+soloio-bulldozer[bot]@users.noreply.github.com>

* Resolve panic in gateway validation client (#6260)

* add test

* add fix for panicing test

* unfocus test

* add changelog

* goimports -w

* Update changelog/v1.12.0-beta2/robust-client-panic.yaml

Co-authored-by: Kevin Dorosh <kevin.dorosh@solo.io>

Co-authored-by: Kevin Dorosh <kevin.dorosh@solo.io>
Co-authored-by: soloio-bulldozer[bot] <48420018+soloio-bulldozer[bot]@users.noreply.github.com>

* Resolve consul plugin data race (#6271)

* use dependency injectio to handle fallback resolution

* add changelog

* fixup dns resolvers and test

* Resolve data race in setup syncer test (#6282)

* move changelog

* fixup registry

* de duplicate changelogs

* delete dynamic forward proxy test

* delete hybrid test

* undo kube2e changes, panic occurring with gomega

* update changelog

* undo delete

Co-authored-by: soloio-bulldozer[bot] <48420018+soloio-bulldozer[bot]@users.noreply.github.com>
Co-authored-by: Kevin Dorosh <kevin.dorosh@solo.io>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
keep pr updated signals bulldozer to keep pr up to date with base branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

gateway_test: invalid memory address or nil pointer dereference
3 participants