Skip to content

Commit f3e3646

Browse files
committed
#53: * Upgrade LibUV to version 1.45 due to a timer bug that causes the application to hang
1 parent 09bc2b8 commit f3e3646

File tree

6 files changed

+26
-25
lines changed

6 files changed

+26
-25
lines changed

.github/workflows/build-linux.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ jobs:
9898
libxslt1-dev \
9999
libicu-dev
100100
101-
# Build LibUV from source (need >= 1.44.0)
101+
# Build LibUV from source (need >= 1.45.0)
102102
sudo apt-get install -y cmake ninja-build
103103
104104
# Download and build LibUV 1.48.0

.github/workflows/build.yml

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -70,40 +70,40 @@ jobs:
7070
firebird-dev \
7171
valgrind cmake
7272
73-
# Cache LibUV 1.44.0 installation to avoid rebuilding
74-
- name: Cache LibUV 1.44.0
73+
# Cache LibUV 1.45.0 installation to avoid rebuilding
74+
- name: Cache LibUV 1.45.0
7575
id: cache-libuv
7676
uses: actions/cache@v4
7777
with:
7878
path: |
7979
/usr/local/lib/libuv*
8080
/usr/local/include/uv*
8181
/usr/local/lib/pkgconfig/libuv.pc
82-
key: ${{ runner.os }}-libuv-1.44.0-release
82+
key: ${{ runner.os }}-libuv-1.45.0-release
8383

84-
- name: Install LibUV >= 1.44.0
84+
- name: Install LibUV >= 1.45.0
8585
run: |
86-
# Check if we have cached LibUV 1.44.0
86+
# Check if we have cached LibUV 1.45.0
8787
if [ "${{ steps.cache-libuv.outputs.cache-hit }}" == "true" ]; then
88-
echo "Using cached LibUV 1.44.0 installation"
88+
echo "Using cached LibUV 1.45.0 installation"
8989
sudo ldconfig
9090
echo "LibUV version: $(pkg-config --modversion libuv)"
9191
# Check if system libuv meets requirements
92-
elif pkg-config --exists libuv && pkg-config --atleast-version=1.44.0 libuv; then
92+
elif pkg-config --exists libuv && pkg-config --atleast-version=1.45.0 libuv; then
9393
echo "System libuv version: $(pkg-config --modversion libuv)"
9494
sudo apt-get install -y libuv1-dev
9595
else
96-
echo "Installing LibUV 1.44.0 from source"
97-
wget https://github.com/libuv/libuv/archive/v1.44.0.tar.gz
98-
tar -xzf v1.44.0.tar.gz
99-
cd libuv-1.44.0
96+
echo "Installing LibUV 1.45.0 from source"
97+
wget https://github.com/libuv/libuv/archive/v1.45.0.tar.gz
98+
tar -xzf v1.45.0.tar.gz
99+
cd libuv-1.45.0
100100
mkdir build && cd build
101101
cmake .. -DCMAKE_BUILD_TYPE=Release
102102
make -j$(nproc)
103103
sudo make install
104104
sudo ldconfig
105105
cd ../..
106-
echo "LibUV 1.44.0 compiled and installed"
106+
echo "LibUV 1.45.0 compiled and installed"
107107
fi
108108
109109
- name: Configure PHP

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
3434
- Optimized `network_async_accept_incoming` to try `accept()` before waiting
3535
- Enhanced stream_select functionality with event-driven architecture
3636
- Improved blocking operation handling with boolean return values
37+
- Upgrade `LibUV` to version `1.45` due to a timer bug that causes the application to hang
3738

3839
## [0.3.0] - 2025-07-16
3940

README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,9 @@ docker run --rm true-async-php php -m | grep true_async
4747
### Requirements
4848

4949
- **PHP 8.5.0+**
50-
- **LibUV ≥ 1.44.0** (required) - Fixes critical `UV_RUN_ONCE` busy loop issue that could cause high CPU usage
50+
- **LibUV ≥ 1.45.0** (required) - Fixes critical `UV_RUN_ONCE` busy loop issue that could cause high CPU usage
5151

52-
### Why LibUV 1.44.0+ is Required
52+
### Why LibUV 1.45.0+ is Required
5353

5454
Prior to libuv 1.44, there was a critical issue in `uv__io_poll()`/`uv__run_pending` logic that could cause the event loop to "stick" after the first callback when running in `UV_RUN_ONCE` mode, especially when new ready events appeared within callbacks. This resulted in:
5555

@@ -95,17 +95,17 @@ The fix in libuv 1.44 ensures that `UV_RUN_ONCE` properly returns after processi
9595
9696
4. **Install LibUV:**:
9797
98-
**IMPORTANT:** LibUV version 1.44.0 or later is required.
98+
**IMPORTANT:** LibUV version 1.45.0 or later is required.
9999
100100
For Debian/Ubuntu:
101101
```bash
102-
# Check if system libuv meets requirements (≥1.44.0)
102+
# Check if system libuv meets requirements (≥1.45.0)
103103
pkg-config --modversion libuv
104104
105105
# If version is too old, install from source:
106-
wget https://github.com/libuv/libuv/archive/v1.44.0.tar.gz
107-
tar -xzf v1.44.0.tar.gz
108-
cd libuv-1.44.0
106+
wget https://github.com/libuv/libuv/archive/v1.45.0.tar.gz
107+
tar -xzf v1.45.0.tar.gz
108+
cd libuv-1.45.0
109109
mkdir build && cd build
110110
cmake .. -DCMAKE_BUILD_TYPE=Release
111111
make -j$(nproc)

config.m4

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,14 @@ if test "$PHP_ASYNC" = "yes"; then
2626
AC_MSG_CHECKING(for libuv)
2727

2828
if test -x "$PKG_CONFIG" && $PKG_CONFIG --exists libuv; then
29-
dnl Require libuv >= 1.44.0 for UV_RUN_ONCE busy loop fix
30-
if $PKG_CONFIG libuv --atleast-version 1.44.0; then
29+
dnl Require libuv >= 1.45.0 for UV_RUN_ONCE busy loop fix
30+
if $PKG_CONFIG libuv --atleast-version 1.45.0; then
3131
LIBUV_INCLINE=`$PKG_CONFIG libuv --cflags`
3232
LIBUV_LIBLINE=`$PKG_CONFIG libuv --libs`
3333
LIBUV_VERSION=`$PKG_CONFIG libuv --modversion`
3434
AC_MSG_RESULT(from pkgconfig: found version $LIBUV_VERSION)
3535
else
36-
AC_MSG_ERROR(system libuv must be upgraded to version >= 1.44.0 (fixes UV_RUN_ONCE busy loop issue))
36+
AC_MSG_ERROR(system libuv must be upgraded to version >= 1.45.0 (fixes UV_RUN_ONCE busy loop issue))
3737
fi
3838
PHP_EVAL_LIBLINE($LIBUV_LIBLINE, UV_SHARED_LIBADD)
3939
PHP_EVAL_INCLINE($LIBUV_INCLINE)

config.w32

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ if (PHP_ASYNC == "yes") {
2323
if (CHECK_HEADER_ADD_INCLUDE("libuv/uv.h", "CFLAGS_UV", PHP_PHP_BUILD + "\\include")
2424
&& CHECK_LIB("libuv.lib", "libuv")) {
2525

26-
// Note: libuv >= 1.44.0 is required for UV_RUN_ONCE busy loop fix
26+
// Note: libuv >= 1.45.0 is required for UV_RUN_ONCE busy loop fix
2727
// For Windows builds, manually verify libuv version meets requirements
2828

2929
ADD_FLAG("LIBS", "libuv.lib Dbghelp.lib Userenv.lib");
@@ -32,6 +32,6 @@ if (PHP_ASYNC == "yes") {
3232
"'.\nTo compile PHP TRUE ASYNC with LibUV:\n" +
3333
"1. Copy files from 'libuv\\include' to '" + PHP_PHP_BUILD + "\\include\\libuv\\'\n" +
3434
"2. Build libuv.lib and copy it to '" + PHP_PHP_BUILD + "\\lib\\'\n" +
35-
"3. IMPORTANT: Use libuv >= 1.44.0 (fixes UV_RUN_ONCE busy loop issue)");
35+
"3. IMPORTANT: Use libuv >= 1.45.0 (fixes UV_RUN_ONCE busy loop issue)");
3636
}
3737
}

0 commit comments

Comments
 (0)