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(core): rename unix sockets to shorter names to avoid exceeding socket name limit #13557

Merged
merged 2 commits into from
Aug 26, 2024

Conversation

brentos
Copy link
Contributor

@brentos brentos commented Aug 22, 2024

Summary

Unix domain sockets have a hard length limit of around 108 characters. When Kong is configured in a deeply nested directory structure, this can cause Kong to fail to start. Reducing the file name length will help alleviate this issue.

Checklist

  • The Pull Request has tests
  • A changelog file has been created under changelog/unreleased/kong or skip-changelog label added on PR if changelog is unnecessary. README.md
  • There is a user-facing docs PR against https://github.com/Kong/docs.konghq.com - PUT DOCS PR HERE

Issue reference

Fix: KAG-5136

…cket name limit

Unix domain sockets have a hard length limit of around 108 characters. When Kong is
configured in a deeply nested directory structure, this can cause Kong to fail to start.
Reducing the file name length will help alleviate this issue.

Fix: KAG-5136
@brentos brentos force-pushed the fix/kag-5136-shorten-unix-domain-sockets branch from 1d56fdb to 5ab75a8 Compare August 23, 2024 20:46
@brentos brentos marked this pull request as ready for review August 23, 2024 20:50
@brentos brentos requested a review from flrgh August 23, 2024 21:05
Copy link
Contributor

@locao locao left a comment

Choose a reason for hiding this comment

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

Just a doc fix, otherwise lgtm

Copy link
Contributor

Choose a reason for hiding this comment

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

IIRC this is a fix for an unreleased feature, right? A changelog entry is not needed in such cases.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes and no? It is still a possible problem even before the unreleased fix. The new feature just makes it more likely to happen, since the path to the sockets has become longer by adding the subdirectory /sockets/

kong/global.lua Outdated Show resolved Hide resolved
@@ -83,7 +83,7 @@ stream {

> if cluster_ssl_tunnel then
server {
listen unix:${{SOCKET_PATH}}/cluster_proxy_ssl_terminator.sock;
listen unix:${{SOCKET_PATH}}/${{CLUSTER_PROXY_SSL_TERMINATOR_SOCK}};
Copy link
Contributor

Choose a reason for hiding this comment

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

The fact that these are no longer hard-coded strings ❤️

Copy link
Contributor

@flrgh flrgh left a comment

Choose a reason for hiding this comment

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

👍 well done

This will need backporting everywhere that #13409 is slated for backport (just 3.8 in OSS but many more versions in EE). If you can take care of 3.8 I will take care of all of the pre-3.8 versions myself.

@locao locao added this to the 3.8.0 milestone Aug 26, 2024
@locao locao merged commit 2dc36f2 into master Aug 26, 2024
31 checks passed
@locao locao deleted the fix/kag-5136-shorten-unix-domain-sockets branch August 26, 2024 15:20
github-actions bot pushed a commit that referenced this pull request Aug 26, 2024
@team-gateway-bot
Copy link
Collaborator

@team-gateway-bot
Copy link
Collaborator

Successfully created cherry-pick PR for master:

flrgh pushed a commit that referenced this pull request Aug 26, 2024
…cket name limit (#13557) (#13571)

(cherry picked from commit 2dc36f2)

Co-authored-by: Brent Yarger <brent.yarger@konghq.com>
curiositycasualty pushed a commit that referenced this pull request Oct 15, 2024
…cket name limit (#10114)

* fix(core): rename unix sockets to shorter names to avoid exceeding socket name limit (#13557)

(cherry picked from commit 2dc36f2)

* Renamed kong_debug socket to shorter name

* update changelog, add kong_debug socket to ee_constants, update test

* use pairs instead of ipairs

---------

Co-authored-by: Brent Yarger <brent.yarger@konghq.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants