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: bind admin server to the same host #3512

Closed
wants to merge 4 commits into from

Conversation

develop7
Copy link
Collaborator

@develop7 develop7 commented May 13, 2024

Reuse main socket address to bind admin socket there too by resolving the address main socket is bound at and binding admin socket to it explicitly.

Introduces extra dependency to iproute for HostAddress -> IP -> String conversions, following the reference in https://www.stackage.org/haddock/lts-22.21/network-3.1.4.0/src/Network.Socket.Info.html#line-415

Fixes #3508

@develop7 develop7 marked this pull request as ready for review May 14, 2024 10:17
@laurenceisla
Copy link
Member

laurenceisla commented May 17, 2024

Since this will use the same host, then it would log this when the same port is used, right?

postgrest: Network.Socket.bind: resource busy (Address already in use)

It solves the issue of not allowing the same ports, but I think it's better/simpler to just not execute when server-port and admin-server-port are the same, as it was mentioned in #3508 (comment) (perhaps that comment wasn't addressed yet in this PR?)

@develop7
Copy link
Collaborator Author

Closing this in favor of #3559

@develop7 develop7 closed this Jun 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Server port and admin server port can end up with the same value
2 participants