Skip to content

Update the embedded library to swoole/library 6.2.x (3892f45) - #6257

Merged
matyhtf merged 2 commits into
swoole:6.2from
deminy:update-library-5aeb8b3
Sep 29, 2026
Merged

matyhtf merged 2 commits into
swoole:6.2from
deminy:update-library-5aeb8b3

Conversation

@deminy

@deminy deminy commented Sep 27, 2026 •

Copy link
Copy Markdown
Member

Rebuild ext-src/php_swoole_library.h via tools/build-library.php from branch 6.2.x of swoole/library (swoole/library@26e2e98 → swoole/library@3892f45).

Library changes included

From the 6.2.4 (unreleased) section of swoole/library's CHANGELOG.md:

Added:

  • PR add http2 request library#185: Added \Swoole\Coroutine\Http2\MultiplexClient, an HTTP/2 client that multiplexes requests from many coroutines over one shared connection, reconnects on demand, and closes an idle connection after a configurable period (options heartbeat_check_interval and heartbeat_idle_time) (by @tw2066).
  • PR Support array authentication in RedisConfig for ACL library#187: \Swoole\Database\RedisConfig::withAuth() now also accepts a [username, password] array for Redis ACL authentication (by @catchem88). A class extending RedisConfig that overrides withAuth() or redeclares $auth has to widen its string type to string|array.
  • PR Support CURLOPT_PREREQFUNCTION in coroutine curl handler library#190: Support the CURLOPT_PREREQFUNCTION option in the coroutine curl handler; on PHP versions without the native constants, use \Swoole\Curl\CURLOPT_PREREQFUNCTION, \Swoole\Curl\CURL_PREREQFUNC_OK and \Swoole\Curl\CURL_PREREQFUNC_ABORT (by @lazerg).
  • PR add http2_max_headers option library#191: Support the http2_max_headers server option, with the constant \Swoole\Constant::OPTION_HTTP2_MAX_HEADERS; it takes effect on Swoole 6.3.0 and later (by @NathanFreeman).
  • \Swoole\Database\MysqliProxy::inTransaction() and reset(), which report and forget the transaction state the proxy tracks. \Swoole\Database\MysqliPool::get() hands out a connection with that state reset.
  • \Swoole\RemoteObject\Exception::getRemoteClass() and getRemoteCode(), which give the class and the code of an exception thrown on the server.

Changed:

  • \Swoole\Server\Helper uses the \Swoole\Constant::OPTION_* constants instead of string literals in its option tables and lookups.
  • The FastCGI Params record encodes and decodes its parameters in linear time, about 2.5 and 8 times faster than before; the bytes produced and the parameters read are the same.
  • \Swoole\ArrayObject::lastIndexOf() and remove() with $loop find their keys in one array_keys() call instead of walking the array in PHP, with the same results.
  • \Swoole\StringObject::endsWith() uses str_ends_with() and no longer scans the whole string, with the same results.

Removed:

  • Dropped support for PHP below 8.2 and Swoole below 6.2.

Fixed:

  • PR Report fatal Coroutine Server accept failures library#192: Report fatal \Swoole\Coroutine\Server accept failures through start() and errCode (by @binaryfire).
  • PR Fix memory leak library#193: Fixed a memory leak in \Swoole\RemoteObject\Client, present since 6.2.0, where every client was kept alive for the lifetime of the process (issue Every hooked dns_get_record()/network function leaks a Swoole\RemoteObject\Client (swoole_get_default_remote_object_client never memoises) #6191). \Swoole\RemoteObject\Client::getInstance() now returns null for a client that is gone, and a client can no longer be cloned.
  • Fixed a startup race in the default remote object server that let a coroutine see the server as ready while another one was still starting it (commit).
  • A failed reconnect left a database statement proxy wrapping false (commit).
  • \Swoole\RemoteObject\Client now throws a \Swoole\RemoteObject\Exception on a response that does not unserialize.
  • An empty FastCGI response is now reported as 502 Invalid FastCGI Response.
  • A \Swoole\RemoteObject\Client used from several coroutines at once ended the process with a fatal "Socket has already been bound to another coroutine"; calls through one client are now serialized.
  • swoole_container_cpu_num() ignored the CPU quota of cgroup v2 containers.
  • The mysqli proxies did not reconnect after a lost connection under the default mysqli report mode of PHP 8.1+, where failures are thrown as \mysqli_sql_exception.
  • The mysqli proxies no longer reconnect inside a transaction, and report a lost connection in a method they do not retry, such as store_result(), where they returned false.
  • \Swoole\Database\MysqliStatementProxy did not re-bind the bind_result() variables correctly after a reconnect, and retried fetch() on a statement that was prepared again but never executed.
  • \Swoole\Database\MysqliStatementProxy did not recover from a second lost connection on the same statement.
  • \Swoole\Database\PDOStatementProxy turned a connection lost while reading rows into an empty result, and did not recover from a second lost connection on the same statement. It now retries execute() only, and reports a lost connection in any other method.
  • The database proxies recognise more lost-connection errors: SSL failures during a query, PostgreSQL's canceling statement due to conflict with recovery, and the PlanetScale PostgreSQL / pg_bouncer messages, in line with Laravel's list.
  • \Swoole\Database\RedisPool passed the connect() arguments in the wrong positions when only some of the connect timeout, retry interval and read timeout were configured.
  • \Swoole\Coroutine\Server never backed off when a coroutine could not be created for an accepted connection.
  • A FastCGI request body of "0" was dropped as empty.
  • An exception the remote object server caught became a TypeError on the client when its code was not an integer, as with a \PDOException, and so did the server's own errors such as an invalid API key. Both now arrive as a \Swoole\RemoteObject\Exception.
  • \Swoole\NameResolver\Nacos::getCluster() threw a TypeError, because Nacos reports the weight of a node as a float.
  • \Swoole\ConnectionPool::close() failed with an Error when called twice, and fill() on a closed pool made connections only to drop them.
  • \Swoole\Database\PDOProxy: query() and prepare() failed with a TypeError outside the exception error mode.
  • \Swoole\ArrayObject and swoole_array_default_value() raised a deprecation on PHP 8.5 when given a null key, which still stands for the empty string.
  • The mysqli proxies raised a warning on prepare(query: ...), with the query passed by name, and could not prepare that statement again after a reconnect.
  • \Swoole\Database\PDOStatementProxy: after a reconnect, a statement used the value a variable had when bindParam() was called, not its present one, and no longer filled the variables of bindColumn().
  • \Swoole\Database\PDOStatementProxy::bindColumn() threw a TypeError when called without a type.

Testing

  • The Build Swoole workflow of swoole/library passed for swoole/library@3892f45: it compiles the library into the extension, built from branch 6.2 of swoole-src, on PHP 8.2 to 8.5, and runs the library's unit tests against the embedded copy on PHP 8.2 and 8.5.
  • The Tests workflow of swoole/library passed for the same commit, on the phpswoole/swoole images of Swoole 6.2 with branch 6.2 of swoole-src compiled on top.

🤖 Generated with Claude Code

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@codecov

codecov Bot commented Sep 27, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 85.57%. Comparing base (bd718f1) to head (4efbbb6).
⚠️ Report is 36 commits behind head on 6.2.

Additional details and impacted files
@@            Coverage Diff             @@
##              6.2    #6257      +/-   ##
==========================================
+ Coverage   85.48%   85.57%   +0.08%     
==========================================
  Files         112      112              
  Lines       17549    17566      +17     
  Branches     3094     3095       +1     
==========================================
+ Hits        15002    15032      +30     
+ Misses       2547     2534      -13     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@deminy deminy changed the title Update the embedded library to swoole/library 6.2.x (5aeb8b3) Update the embedded library to swoole/library 6.2.x (3892f45) Sep 29, 2026

@matyhtf matyhtf left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verified against swoole/library@3892f45: rebuilding with tools/build-library.php leaves the PR worktree completely clean, all embedded PHP sources pass the generator's syntax checks, and git diff --check is clean. The generated update is reproducible and appropriately scoped to the 6.2 library branch.

@matyhtf
matyhtf merged commit 022123b into swoole:6.2 Sep 29, 2026
9 of 17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants