We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
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
windows下使用版本为:Swoole 5.1.7 (cli) (built: Feb 22 2025 03:00:34) (NTS) 当开启一键协程时,通过PDO访问数据库在有并发时会程序崩溃,无任何输出信息。 简化测试程序如下:
<?php // 开启协程后,并发访问程序崩溃!不加这句不出错,无并发仅一个连接访问不出错。 Co::set(['hook_flags'=> SWOOLE_HOOK_ALL]); $server = new Swoole\Http\Server("0.0.0.0", 8081); $server->set([ 'worker_num'=>1 ]); $server->on('Request', function ($req, $res) { // 连接MySQL数据库操作 $dsn = "mysql:host=192.168.1.254;port=3306;dbname=jdcloud"; $cnn = new PDO($dsn, "yibo", "Yibo@2019"); $rv = $cnn->exec("INSERT INTO Ordr (amount, dscr, createTm, status) VALUES (128, 'test-set', '2025-2-21 19:00', 'CR')"); $id = $cnn->lastInsertId(); $res->end("[0,$id]"); }); $server->start();
测试时,可以使用apache自带的ab工具,如:ab -c10 -t2 http://127.0.0.1:8081/,-c10是开10个并发,-t2是持续2秒,基本上程序立即就死掉。 用-c1为1个并发,此时可正常运行。
ab -c10 -t2 http://127.0.0.1:8081/
The text was updated successfully, but these errors were encountered:
Refactor ReactorPoll, Fixed a crash caused by adding and removing eve…
e87afd4
…nts in the Poll event handler on the Cygwin platform. Fix GH-5760 GH-5759 GH-5758
No branches or pull requests
Uh oh!
There was an error while loading. Please reload this page.
windows下使用版本为:Swoole 5.1.7 (cli) (built: Feb 22 2025 03:00:34) (NTS)
当开启一键协程时,通过PDO访问数据库在有并发时会程序崩溃,无任何输出信息。
简化测试程序如下:
测试时,可以使用apache自带的ab工具,如:
ab -c10 -t2 http://127.0.0.1:8081/
,-c10是开10个并发,-t2是持续2秒,基本上程序立即就死掉。用-c1为1个并发,此时可正常运行。
The text was updated successfully, but these errors were encountered: