Force temporary server to use unix socket only #443
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Consider this an official "request for comments" 😅
(If your comment amounts to "I agree with this change" please just leave a thumbs up on this comment -- please don't make "+1" comments. 🙏)
This better matches the "initdb" behavior of the various SQL images, and avoids issues like running two instances in the same pod on different ports (and thus one of them failing to bind to 127.0.0.1:27017).
This is supported as of MongoDB 3.5+, and was discovered via https://stackoverflow.com/a/39901199/433558 -> https://jira.mongodb.org/browse/SERVER-9383 -> https://jira.mongodb.org/browse/SERVER-29403 (which was closed/fixed/implemented in 3.5.9).
Closes #440
Closes #437
This has implications for #437, #246, and probably many others, but for implementations like the one in #246 (comment), this would actually make things better because the second container wouldn't even be able to connect until the first initialization is fully complete (as seen in "proper" external setup solutions like https://gist.github.com/crapthings/71fb6156a8e9b31a2fa7946ebd7c4edc).
For reference, here's the output of
rs.initiate()
on a daemon that's listening on the unix socket only:(Although IMO this isn't a huge deal because the real "conclusion" from #246 is that it's not really reasonable to do
rs.initiate
from our initdb scripts anyhow and that users should be using external setup solutions like https://gist.github.com/crapthings/71fb6156a8e9b31a2fa7946ebd7c4edc instead.)