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

PHPC-512: Disable async stream connections #166

Closed
wants to merge 1 commit into from

Conversation

bjori
Copy link
Contributor

@bjori bjori commented Dec 14, 2015

Fixes: #133, #112. See: https://jira.mongodb.org/browse/PHPC-512

When doing async connections we can't properly determine if we should connect over IPv6 or IPv4. PHP will unfortunately default to connecting over IPv6 (when compiled in support, with minor runtime check), while mongod does not support IPv6 by default.

When then creating the IPv6 connection asynchronously, PHP hits EINPROGRESS and will happily return the socket as valid.

There currently is no way to configure these functions to prefer IPv4. The best we can do for now is to not connect asynchronously as then we'll properly discover that the IPv6 socket failed, and then continue through the list of addrinfo and next pickup the IPv4 address which works.

When doing async connections we can't properly determine if we
should connect over IPv6 or IPv4. PHP will unfortunately default
to connecting over IPv6 (when compiled in support, with minor
runtime check), while mongod does not support IPv6 by default.

When then creating the IPv6 connection asyncronously, PHP hits
EINPROGRESS and will happily return the socket as valid.

There currently is no way to configure these functions to prefer IPv4.
The best we can do for now is to not connect asyncronously as then
we'll properly discover that the IPv6 socket failed, and then continue
through the list of addrinfo and next pickup the IPv4 address which
works.
@jmikola jmikola changed the title Workaround for issue #133 PHPC-512: Disable async stream connections Dec 14, 2015
jmikola added a commit that referenced this pull request Dec 14, 2015
@jmikola
Copy link
Member

jmikola commented Dec 14, 2015

Merged in 7dad72f.

@jmikola jmikola closed this Dec 14, 2015
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