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

Leftover socket file interferes with startup when wait-for-db initContainer is enabled #295

Open
rainest opened this issue Feb 25, 2021 · 2 comments
Labels
bug Something isn't working

Comments

@rainest
Copy link
Contributor

rainest commented Feb 25, 2021

The Kong container within our Deployment uses the same prefix emptyDir volume as its wait-for-db initContainer.

Because of Kong/kong#6827, wait-for-db will leave a stream_rpc.sock file in the prefix, which prevents the Kong container from starting.

We can work around this by manually removing the file at the end of wait-for-db, but want to remove the workaround once the underlying bug is fixed.

@rainest rainest added the bug Something isn't working label Feb 25, 2021
rainest pushed a commit that referenced this issue Feb 25, 2021
#295 requires a workaround that
behaves differently depending on whether a DB-backed instance has or
does not have stream listens configured.

At the end of wait-for-db, this workaround removes the problem socket
file if it exists, or does nothing if it does not.

test5-values.yaml is a new DB-backed test that does not include stream
listens, as the only existing DB-backed test did include stream listens.
rainest pushed a commit that referenced this issue Feb 25, 2021
#295 requires a workaround that
behaves differently depending on whether a DB-backed instance has or
does not have stream listens configured.

At the end of wait-for-db, this workaround removes the problem socket
file if it exists, or does nothing if it does not.

test5-values.yaml is a new DB-backed test that does not include stream
listens, as the only existing DB-backed test did include stream listens.
rainest pushed a commit that referenced this issue Feb 26, 2021
#295 requires a workaround that
behaves differently depending on whether a DB-backed instance has or
does not have stream listens configured.

At the end of wait-for-db, this workaround removes the problem socket
file if it exists, or does nothing if it does not.

test5-values.yaml is a new DB-backed test that does not include stream
listens, as the only existing DB-backed test did include stream listens.
rainest pushed a commit that referenced this issue Mar 1, 2021
#295 requires a workaround that
behaves differently depending on whether a DB-backed instance has or
does not have stream listens configured.

At the end of wait-for-db, this workaround removes the problem socket
file if it exists, or does nothing if it does not.

test5-values.yaml is a new DB-backed test that does not include stream
listens, as the only existing DB-backed test did include stream listens.
@rainest
Copy link
Contributor Author

rainest commented Mar 18, 2021

Per the latest comment upstream, Kong 2.4 will fix this. We may be a bit stuck though, since removing the workaround would break 2.3 compatibility, and it seems a bit early to do that.

ubergesundheit pushed a commit to giantswarm/kong-app that referenced this issue Jun 14, 2021
Kong/charts#295 requires a workaround that
behaves differently depending on whether a DB-backed instance has or
does not have stream listens configured.

At the end of wait-for-db, this workaround removes the problem socket
file if it exists, or does nothing if it does not.

test5-values.yaml is a new DB-backed test that does not include stream
listens, as the only existing DB-backed test did include stream listens.
rainest pushed a commit that referenced this issue Dec 1, 2021
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.
rainest pushed a commit that referenced this issue Dec 1, 2021
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.
@rainest
Copy link
Contributor Author

rainest commented Dec 1, 2021

Somehow, we still experience this even with versions that should include the fix in https://trac.nginx.org/nginx/ticket/753 aka nginx/nginx@9c3ac44: newer versions will fail without the workaround.

Not sure why sockets are still left behind by the init container, since manually SIGQUITing a process does not leave these around anymore. It's possible that the init container is getting SIGKILLed for some reason.

rainest pushed a commit that referenced this issue Dec 1, 2021
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant