[phpmyadmin/sql-parser] 541948: Fix #309 - Use stream_select instead of non-blocking STDIN

Branch: refs/heads/master Home: https://github.com/phpmyadmin/sql-parser Commit: 5419487eb14c96e729bc6b3cda1c6e215b5097af https://github.com/phpmyadmin/sql-parser/commit/5419487eb14c96e729bc6b3cda1c... Author: Sergio Durigan Junior <sergio.durigan@canonical.com> Date: 2020-08-27 (Thu, 08 August 2020) +02:00 Changed paths: M src/Utils/CLI.php Log Message: ----------- Fix #309 - Use stream_select instead of non-blocking STDIN The idiom used in the readStdin function from src/Utils/CLI.php is not entirely error-prone: marking stdin as non-blocking and then reading from it can lead to racy scenarios where we are not able to catch what's being fed to the program. This can be seen very frequently on s390x, where a loop like this: $ while echo "invalid query" | /usr/bin/php7.4 /path/to//highlight-query; do sleep 1; done; will lead to failures once on every few runs (as can be seen in the description of issue #309). This commit implements the more robust method which uses stream_select to wait for stdin to become available, but resorts to a sensible timeout value (0.2 seconds) which will prevent the blocking from happening. I tested this patch extensively on s390x and amd64, and noticed that the non-determinism is gone. Signed-off-by: Sergio Durigan Junior <sergio.durigan@canonical.com> Commit: c862a108b363c40fcc9d3ae03c0e0983f1a7d8ae https://github.com/phpmyadmin/sql-parser/commit/c862a108b363c40fcc9d3ae03c0e... Author: William Desportes <williamdes@wdes.fr> Date: 2020-08-27 (Thu, 08 August 2020) +02:00 Changed paths: M src/Utils/CLI.php Log Message: ----------- #309 - Set back PHP compatibility Signed-off-by: William Desportes <williamdes@wdes.fr> Commit: 0770895be14d06f3ee9df912e947d7774eb11872 https://github.com/phpmyadmin/sql-parser/commit/0770895be14d06f3ee9df912e947... Author: William Desportes <williamdes@wdes.fr> Date: 2020-08-27 (Thu, 08 August 2020) +02:00 Changed paths: M src/Utils/CLI.php Log Message: ----------- Merge #312 - Fix #309 - Use stream_select instead of non-blocking STDIN Pull-request: #312 Fixes: #309 Signed-off-by: William Desportes <williamdes@wdes.fr> Commit: e0da85e69f9eb3571982f161c831b68d6d537eb4 https://github.com/phpmyadmin/sql-parser/commit/e0da85e69f9eb3571982f161c831... Author: William Desportes <williamdes@wdes.fr> Date: 2020-08-27 (Thu, 08 August 2020) +02:00 Changed paths: M CHANGELOG.md Log Message: ----------- Add a ChangeLog entry for #309 Signed-off-by: William Desportes <williamdes@wdes.fr> Commit: 29ce64ec4421015fc0bd2f08a343786967cb5f5c https://github.com/phpmyadmin/sql-parser/commit/29ce64ec4421015fc0bd2f08a343... Author: William Desportes <williamdes@wdes.fr> Date: 2020-08-27 (Thu, 08 August 2020) +02:00 Changed paths: M CHANGELOG.md M src/Utils/CLI.php Log Message: ----------- Merge branch 'QA' Signed-off-by: William Desportes <williamdes@wdes.fr> Commit: 9ce26b93198e13c4505af6e50511865123e62db7 https://github.com/phpmyadmin/sql-parser/commit/9ce26b93198e13c4505af6e50511... Author: William Desportes <williamdes@wdes.fr> Date: 2020-08-27 (Thu, 08 August 2020) +02:00 Changed paths: M composer.json M phpstan-baseline.neon Log Message: ----------- Upgrade phpstan Signed-off-by: William Desportes <williamdes@wdes.fr> Commit: 39e1a300c876a6de3c6e447a621e6068bc2edce6 https://github.com/phpmyadmin/sql-parser/commit/39e1a300c876a6de3c6e447a621e... Author: William Desportes <williamdes@wdes.fr> Date: 2020-08-27 (Thu, 08 August 2020) +02:00 Changed paths: M .travis.yml Log Message: ----------- Allow "Backward compatibility check" to fail because of the repeated false positives Signed-off-by: William Desportes <williamdes@wdes.fr>
participants (1)
-
Sergio Durigan Junior