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(init) rework wait-for-db socket workaround #508

Merged
merged 1 commit into from
Dec 1, 2021
Merged

Conversation

rainest
Copy link
Contributor

@rainest rainest commented Dec 1, 2021

What this PR does / why we need it:

Use a temporary KONG_PREFIX for wait-for-db, rather than using the standard prefix and removing leftover files. This avoids the general class of issue described in #295. As that issue is still present on versions of Kong after 2.3, it looks like we'll need to keep the workaround indefinitely, unless we can figure out why we're still leaking socket files despite the upstream fix.

Which issue this PR fixes

(optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close that issue when PR gets merged)

Special notes for your reviewer:

Found while testing the 2.7 nightly. This adds an additional socket (and somehow makes the existing rm not work): Kong/kubernetes-testing-framework#168 (comment)

Checklist

[Place an '[x]' (no spaces) in all applicable fields. Please remove unrelated fields.]

Use a temporary prefix directory for wait-for-db instead of removing
problem files.

For unclear reasons, versions of Kong that should include
https://trac.nginx.org/nginx/ticket/753 are still leaving old socket
files behind in the prefix after wait-for-db completes. Additional
sockets in newer Kong versions result in a new variant of
#295, preventing startup when using
Postgres. Since we don't actually need anything wait-for-db writes to
the prefix, we can write to a temporary prefix instead to avoid this
class of issue entirely.
Copy link
Member

@shaneutt shaneutt left a comment

Choose a reason for hiding this comment

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

This seems like a reasonable way to deal with the problem to me. I can't think of any gotchas for this, and given that it's for the wait-for-db container where the end-user is highly unlikely to need to do anything in the prefix directory I feel confident about it.

I would only say maybe give this a couple more cycles and some extra special care testing, but LGTM ✔️

@rainest rainest merged commit 4b902db into next Dec 1, 2021
@rainest rainest deleted the fix/discard-prefix branch December 1, 2021 20:39
@rainest
Copy link
Contributor Author

rainest commented Dec 1, 2021

Effectively it's just starting Kong from a clean slate same as it would in DB-less mode. Existing tests are fine for this since any issue with it would prevent the Postgres-backed instance from starting at all (either wait-for-db would never succeed or proxy would try to start in some environment where that was impossible).

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.

None yet

2 participants