github swoole/swoole-src v6.2.0-rc1

pre-release14 hours ago

✨️ New Features

  • Added coroutine-based FTP client. By including the --enable-swoole-ftp option during compilation, coroutine support for FTP operations can be enabled, avoiding network blocking.
  • Added coroutine-based SSH client. By including the --enable-swoole-ssh option during compilation, coroutine support for SSH operations can be enabled, improving concurrency efficiency.
  • Added support for io_uring in the HTTP coroutine server. The HTTP coroutine server can now utilize the high-performance io_uring event mechanism. Enable it by adding the --enable-uring_socket option during compilation for better I/O performance.
  • Added the Swoole\RemoteObject\Server module, providing transparent coroutine operation support for MongoDB.
  • Added the Swoole\Coroutine::setTimeLimit() function to control coroutine execution timeout, preventing coroutines from occupying resources for extended periods.
  • Added URL rewriting support for the HTTP static file server.
  • Added coroutine support for pdo_firebird.
  • Added support for PHP 8.5.
  • Added coroutine support for the gethostbyname function.
  • Optimized the implementation of Server::shutdown(), replacing signal communication with pipe communication in Process mode.
  • In the callback functions of Swoole's HTTP servers (including Swoole\Http\Server, Swoole\Http2\Server, and Swoole\Coroutine\Http\Server), the server property of the Swoole\Http\Request object now includes the server_addr field, which identifies the server's IP address.

SSH and FTP coroutine clients cannot coexist with PHP's ext-ssh and ext-ftp. To enable these features, you must disable PHP's ssh and ftp extensions.

🐛 Bug Fixes

  • Fixed an issue where HTTP2 server sessions were released multiple times in a multi-threaded environment.
  • Fixed an issue in version 8.5 where refresh_memory_manager() must be executed after forking a child process or creating a child thread; otherwise, the program would crash.
  • Fixed an issue where the swoole_get_local_mac function could not work properly on macOS systems.
  • Fixed a crash issue that could occur when manually suspending coroutines in a multi-threaded environment.
  • Fixed a compilation error on Alpine systems.
  • Fixed a memory leak issue when function hooking failed.
  • Fixed thread safety issues during the coroutine conversion process for pdo_sqlite and pdo_oci.
  • Fixed the sw_php_print_backtrace function to ensure its output format matches the backtrace information of PHP's built-in functions.

🛠️ Optimizations

  • Running php --ri swoole now outputs the version information of libpq.
  • Optimized the io_uring related logic in file coroutine operations.
  • Added PHP call stack information output when event addition fails.
  • Optimized the implementation code for swoole_get_local_ip and swoole_get_local_mac functions.
  • Optimized the coroutine waiting time for file locks, avoiding exponentially increasing sleep times that made locks increasingly difficult to acquire.
  • Improved compatibility with the Android platform.

📢 Notes

  • Removed the --enable-openssl compilation option; support for OpenSSL is now included by default.
  • --enable-uring-socket requires explicitly specifying either --enable-iouring or --with-liburing-dir.
  • No longer supports PHP 8.1.
  • Swoole 6.2.0 RC1 is currently a release candidate version and can only be used in testing environments. It is prohibited to use it in production environments.

🧧 Lunar New Year greetings

Today is the first day of the Chinese Lunar New Year. At this moment of bidding farewell to the old and welcoming the new, the entire Swoole team extends our sincerest New Year blessings to you! We wish you good health, flourishing career, abundant wealth, and all your endeavors success in the new year! Thank you for your continued support and companionship. We look forward to joining hands with you to create an even more exciting future!

✨️ 新特性

  • 新增协程化FTP客户端,现通过编译时加入--enable-swoole-ftp选项,即可启用FTP操作的协程化支持,避免网络阻塞
  • 新增协程化SSH客户端,现通过编译时加入--enable-swoole-ssh选项,即可启用SSH操作的协程化支持,提升并发效率
  • 新增HTTP协程服务端支持io_uringHTTP协程服务端现可选用高性能的io_uring事件机制。在编译时加入--enable-uring_socket选项即可启用,以获得更优的 I/O 性能
  • 新增Swoole\RemoteObject\Server模块,为MongoDB提供透明化的协程操作支持
  • 新增Swoole\Coroutine::setTimeLimit()函数,用于控制协程执行超时时间,防止协程长时间占用资源
  • HTTP静态文件服务器添加URL重写支持
  • 新增对pdo_firebird的协程化支持
  • 支持PHP 8.5
  • 支持协程化 gethostbyname函数
  • 优化Server::shutdown()的实现,在Process模式下将信号通信替换为管道通信
  • 在 Swoole 的 HTTP 服务器(包括 Swoole\Http\Server、Swoole\Http2\Server 和 Swoole\Coroutine\Http\Server)的回调函数中,Swoole\Http\Request 对象的 server 属性新增了 server_addr 字段,该字段用于标识服务端的 IP 地址

SSHFTP协程客户端与PHPext-sshext-ftp无法共存,若要开启此项特性,需禁用PHPsshftp扩展

🐛 Bug修复

  • 修复 HTTP2 服务器会话(session)在多线程环境下发生多次释放的问题
  • 修复在8.5版本中,子进程fork或者子线程生成后需执行refresh_memory_manager(),否则将导致程序崩溃的问题
  • 修复macOS系统中swoole_get_local_mac函数无法正常工作的问题
  • 修复了在多线程环境下用户手动挂起协程时可能引发的崩溃问题
  • 修复在 Alpine 系统下的编译错误
  • 修复函数钩子(hook)调用失败时的内存泄漏问题
  • 修复pdo_sqlitepdo_oci协程化过程中的线程安全问题
  • 修复 sw_php_print_backtrace 函数,使其输出与 PHP 内置函数的回溯信息格式保持一致

🛠️ 优化

  • 执行php --ri swoole会输出libpq的版本信息
  • 优化文件协程化操作中的io_uring相关逻辑
  • 在添加事件失败时输出 PHP 调用堆栈信息
  • 优化 swoole_get_local_ipswoole_get_local_mac 函数的实现代码
  • 优化文件锁的协程化等待时间,避免指数递增的睡眠时间导致锁越来越难获取
  • 提升了对Android平台的兼容性

📢 注意

  • 移除了--enable-openssl编译选项,现在默认包含对OpenSSL的支持
  • --enable-uring-socket需要明确指定--enable-iouring或者--with-liburing-dir其中一个
  • 不再支持PHP8.1
  • Swoole6.2.0RC1目前是测试版本,只能在测试环境使用,禁止在生产环境使用

🧧 新春祝贺

今天是中国农历新年大年初一,在这辞旧迎新的美好时刻,Swoole团队全体成员向您致以最诚挚的新春祝福!愿新的一年里,您身体健康,事业蒸蒸日上,财源滚滚而来,万事顺遂,心想事成!感谢您一直以来的支持与陪伴,期待与您携手共创更加精彩的未来!

Don't miss a new swoole-src release

NewReleases is sending notifications on new releases.