github swoole/swoole-src v6.2.0-rc2

pre-releaseone hour 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.
  • Swoole\Coroutine::cancel now supports canceling all iouring operations.

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.
  • Fixed compilation failures caused by enabling --enable-uring-socket, --enable-trace-log, and --enable-error-log.
  • Fixed the issue where pdo_firebird could not be compiled due to undefined macros.

🛠️ 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 RC2 is currently a release candidate version and can only be used in testing environments. It is prohibited to use it in production environments.

🎉 Chinese Lantern Festival greetings

Today is the Chinese Lantern Festival. All members of Swoole wish you: good health, all the best; may you keep improving, have a bright future, achieve your dreams, and enjoy smooth success in everything!

✨️ 新特性

  • 新增协程化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 地址
  • Swoole\Coroutine::cancel 现支持取消所有iouring操作

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 内置函数的回溯信息格式保持一致
  • 修复因启用 --enable-uring-socket、--enable-trace-log 和 --enable-error-log 导致的编译失败问题
  • 修复因为宏定义不存在的问题,导致pdo_firebird无法编译的问题

🛠️ 优化

  • 执行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.0RC2目前是测试版本,只能在测试环境使用,禁止在生产环境使用

🎉 元宵节祝贺

今天是中国元宵佳节,Swoole全体成员祝您:身体健康,万事如意;步步高升,前程似锦,心想事成,万事顺遂!

Don't miss a new swoole-src release

NewReleases is sending notifications on new releases.