-
Notifications
You must be signed in to change notification settings - Fork 375
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
Regression: MultiSubnetFailover is now case-sensitive in 5.10.0 #1406
Comments
Ignoring the SOCK_DGRAM stuff (which can be explained later) what I see is OK functionality with the SOCK_STREAM and connect having EINPROGRESS and the use of poll with multiple file descriptor fd arguments. If you set up odbcinst.ini with these options you can check if the SQLDriverConnectW looks ok I think that ODBC log an easier test artifact, along with using gdb with a breakpoint on SQLDriverConnectW to examine the arguments, because we don't have source code to the MSODBCSQL driver. I also examined the locals in the msphpsql source, and that looked ok too. So there is something else going on. I was testing in a VM and you were testing in a Docker Container. |
Upon further investigation, we found that I believe this regression may have been caused by this change to The issue description and title have been updated accordingly. |
Thanks for all the comments and investigation. I'll test and revert options back to case insensitive. |
Please check the FAQ (frequently-asked questions) first. If you have other questions or something to report, please address the following (skipping questions might delay our responses):
PHP version 8.1.7
PHP SQLSRV or PDO_SQLSRV version php-sqlsrv-5.10.0-1.el8.remi.8.1.x86_64
Microsoft ODBC Driver version msodbcsql17-17.8.1.2-1.x86_64
SQL Server version (Unknown)
Client operating system Rocky Linux 8.5 Docker image
Table schema (Unknown)
Problem description
The
MultiSubnetFailover
option no longer seems to do anything in version 5.10.0 when set toTrue
. It does work if set totrue
(lowercase) or1
, though.When connecting to a server with two IP addresses (one of which is offline) and
MultiSubnetFailover
is set toTrue
, we sometimes get this error:Fatal error: Uncaught PDOException: SQLSTATE[HYT00]: [Microsoft][ODBC Driver 17 for SQL Server]Login timeout expired in /app/public/test.php
. This does not occur when it's set totrue
or1
.Expected behavior and actual behavior
I would expect that this extension attempts to connect to all IPs in parallel when the option is set to
True
, like it did in version 5.9.0 on PHP 8.0.Instead, it only does this if we use
true
or1
in the connection string.Repro code or steps to reproduce
We ran the code below, both with and without the
MultiSubnetFailover=True;
option on two separate Docker images:somewhere.example.com
is a host that resolves to two different IP addresses, one of which is offline and therefore times out. Both IPs were checked with netcat to confirm that one always accepts connections and the other always times out.When running those four scenarios, only PHP 8.0 with
MultiSubnetFailover=True;
set works 100% of the time. All others only work occasionally.We also tried running the four combinations above with
strace
. Here's a diff of two traces - the left shows PHP 8.0 withMultiSubnetFailover=True;
and the right shows PHP 8.1 also withMultiSubnetFailover=True;
:Note how the left side shows an additional connection being made. The right side also looks virtually identical to removing the
MultiSubnetFailover
option on both 8.0 and 8.1, suggesting that theMultiSubnetFailover
option does nothing on 8.1.The text was updated successfully, but these errors were encountered: