Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
73 commits
Select commit Hold shift + click to select a range
1a5b17a
auto delete auto-pr branch which is merged
Coldwings Dec 13, 2024
11b8afe
User PAT to trigger workflow
Coldwings Dec 16, 2024
962674a
Rename action file
Coldwings Dec 16, 2024
4b5ed11
AutoPR checkout also use PAT
Coldwings Dec 17, 2024
1257c7f
Fix autopr title
Coldwings Dec 17, 2024
ace0747
Apply suggestions from code review
beef9999 Dec 17, 2024
50c0cb0
Apply suggestions from code review
beef9999 Dec 17, 2024
8cf7203
add set body buffer for http client
liulanzheng Dec 17, 2024
dcb245b
extract c_str for estring_view
lihuiba Dec 19, 2024
e9e0031
Disable old auto-pr
beef9999 Dec 19, 2024
80ac531
redefine undefined() in EndPoint
lihuiba Dec 25, 2024
5cb2e65
Make with one argument able to be call
Coldwings Dec 25, 2024
81ac522
AutoPR always using cherry-pick but do not resolve conflicts, just ke…
photonlibos Feb 7, 2025
30f0b3b
fix potential race condition in DefaultResolver when discard_cache()
lihuiba Feb 7, 2025
d772d58
fix on path Walker (#719) (#720)
photonlibos Feb 17, 2025
a600bb2
minor update for http url and headers
liulanzheng Feb 17, 2025
8051429
io-perf example support workpool
beef9999 Mar 6, 2025
1e28e5a
make now monotonic
lihuiba Mar 24, 2025
f696c50
fix a typo in cookie
lihuiba Mar 26, 2025
d4d5476
enhance at_photon_fini() in PooledDialer
liulanzheng Apr 3, 2025
debb0be
macOS CI remove cmake dependency
beef9999 Apr 9, 2025
60da16c
Enhance debug tools (#753)
Coldwings Apr 10, 2025
4d7744f
add PHOTON_DEFAULT_LOG_LEVEL for cmake
liulanzheng Apr 10, 2025
c2c9aec
backport coredump fix for test_throttle.cpp
beef9999 Apr 10, 2025
57a8457
Fix on RPC async_serve accessing count after context call (#763) (#764)
photonlibos Apr 17, 2025
62b0b9f
Set TCP_NODELAY by default (#767)
Coldwings Apr 17, 2025
aaabc01
make it compiles with C++17/20/23
lihuiba Apr 17, 2025
6c56509
Make autopr cleanup using autopr secret
Coldwings Apr 23, 2025
5b683bd
Upgrade c++ version to 17 for macOS CI
beef9999 May 14, 2025
eeacece
fix compile 0.8 with clang17 (#796)
lihuiba May 22, 2025
76940f5
[fix.] segfault when create_extfs() failed.
BigVan Feb 8, 2025
cfe1786
make simple dom preseving the nodes' order of the document, by
lihuiba Jun 6, 2025
f31950a
FIX autopr when commit message contains quota ' character (#812)
Coldwings Jun 9, 2025
97c88bd
simple_dom supports .ini
lihuiba Jun 9, 2025
8791f72
fix url escape/unescape
liulanzheng Jun 16, 2025
2f63609
fini_hook should clear after executed (#839)
Coldwings Jun 28, 2025
aae6c01
fix race and leak in DefaultResolver
lihuiba Jul 12, 2025
3d44523
Fix incorrect char usage in estring trim function
Moonpuck Jul 15, 2025
27e9c71
no unit test on push, only on pull request
lihuiba Jul 16, 2025
85e037c
Force libcurl using http/1.1 since photon wrapper does not support us…
Coldwings Jul 17, 2025
39335fe
FIX: lockfree BatchMPMCQueue on aarch64
Coldwings Jul 21, 2025
d4f99d7
ensure at_photon_fini executed in PooledDialer when photon init and f…
liulanzheng Jul 22, 2025
e164ee3
types in simple_dom
lihuiba Jul 25, 2025
66c2ada
[fix #909] fix compile error
ivanallen Aug 1, 2025
907e0c2
Fix AutoPR dealing with PR title/body contain quota like ` ' " (#913)
Coldwings Aug 4, 2025
97100ac
Fix X86 linux asan start call
Coldwings Aug 5, 2025
79228b2
Fix autopr (#933) (#934)
photonlibos Aug 8, 2025
014d75c
Fix PHOTON_BUILD_WITH_ASAN (#940)
Coldwings Aug 12, 2025
05c0481
Fix autopr title (#944) (#946)
photonlibos Aug 13, 2025
b6598e9
Fix ASAN access stack after vstack destructed (#949)
Coldwings Aug 14, 2025
7c7d10e
simple_dom: respect the size of text, and make parsers exception-safe…
lihuiba Aug 14, 2025
0347793
FIX: objcachev2 should not use spinlock for create or erase (#955)
Coldwings Aug 20, 2025
596a0eb
fx http sock leaks in some error cases (#956) (#958)
photonlibos Aug 20, 2025
57f5a0f
Fix overflow in range lock (#973)
EricHuangqx Sep 3, 2025
18b33c5
enhance LOG_ERROR_RETURN and LOG_ERRNO_RETURN to optionally enforce s…
lihuiba Sep 15, 2025
6a5e28b
invoke dtor for arguments passed to thread_create11() (#987) (#988)
photonlibos Sep 16, 2025
f7aec2a
avoid sleep q starvation by standby q (#978)
lihuiba Sep 16, 2025
f89bff5
make thread_yield_to() less prone to starve threads (#982) (#993)
photonlibos Sep 16, 2025
9f8dd22
Fix photon_std::condition_variable not using custom clock for time_po…
photonlibos Sep 25, 2025
ee84368
fix iovector not checking size before extracting continuous buffer (#…
photonlibos Oct 10, 2025
abd2151
fix deserialize returning invalid message on failure (#1012) (#1015)
photonlibos Oct 14, 2025
600894a
fix invoking appends() in estring to_string(const photon::net::EndPoi…
lihuiba Oct 27, 2025
5925b29
Fix double free in socket pool on unexpected photon thread switch (#1…
photonlibos Nov 3, 2025
d39f52b
rapidxml relocation (#1036)
lihuiba Nov 10, 2025
34b5bbf
fix resume_threads() (#1040)
lihuiba Nov 16, 2025
c401a0e
fix perfermance degradation in photon::thread_create (#1043) (#1046)
ivanallen Nov 21, 2025
39947fd
fix trailer for illegal inputs (#1023) (#1050)
zhenjiaseu Nov 21, 2025
bf03f40
fix json/yaml issues with illegal format (#1054)
zhenjiaseu Nov 22, 2025
56492f4
Since macos-13 test image are retired, move on to macos-15 by github …
Coldwings Dec 11, 2025
c407105
FIX: estring split in non-consecutive merge mode (#1071) (#1072)
photonlibos Dec 12, 2025
d6562fe
Fix split iteration meets empty parts (#1078) (#1079)
photonlibos Dec 15, 2025
f11a9ee
Fix on domain resolver
Coldwings Dec 23, 2025
ba6d32b
Simplify do_resolver
Coldwings Dec 26, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions .github/workflows/auto-pr-autodelete.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Auto PR Branch Cleanup

on:
pull_request:
types:
- closed

jobs:
clean-auto-pr:
if: ${{ github.event.pull_request.merged }} &&
${{ github.event.pull_request.head.repo.id == github.event.pull_request.base.repo.id }} &&
${{ github.event.pull_request.head.ref == 'auto-pr-*' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ secrets.AUTOPR_SECRET }}

- name: set git config
run: |
git config --global user.email "${GITHUB_ACTOR_ID}+${GITHUB_ACTOR}@users.noreply.github.com"
git config --global user.name "${GITHUB_ACTOR}"
git config --global advice.mergeConflict false
git config --global --add safe.directory "${{ github.workspace }}"
git config -l
git push -d origin ${{ github.event.pull_request.head.ref }}
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ jobs:
- uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ secrets.AUTOPR_SECRET }}

- name: set git config
run: |
Expand Down Expand Up @@ -56,44 +57,36 @@ jobs:
set -x
git checkout ${{steps.branch_info.outputs.NEXT_BRANCH}}
git checkout -b ${{steps.create_branch.outputs.PRBRANCH}}
echo "MESSAGE<<__EOF" >> $GITHUB_OUTPUT
git log --format=%B ${{ github.event.commits[0].id }}~..${{ github.event.after }} >> $GITHUB_OUTPUT
echo "__EOF" >> $GITHUB_OUTPUT
echo "TITLE<<__AUTOPR_EOF" >> $GITHUB_OUTPUT
git log --format="| %s" ${{ github.event.commits[0].id }}~..${{ github.event.after }} | tr '\n' ' ' >> $GITHUB_OUTPUT
echo "" >> $GITHUB_OUTPUT
echo "__AUTOPR_EOF" >> $GITHUB_OUTPUT
echo "MESSAGE<<__AUTOPR_EOF" >> $GITHUB_OUTPUT
git log --format="> %B" ${{ github.event.commits[0].id }}~..${{ github.event.after }} >> $GITHUB_OUTPUT
echo "__AUTOPR_EOF" >> $GITHUB_OUTPUT
cat $GITHUB_OUTPUT
REVS=$(git rev-list --reverse ${{ github.event.commits[0].id }}~..${{ github.event.after }} )
for rev in "$REVS"; do
if ! git cherry-pick -X theirs ${rev} ; then
echo "merge=false" >> $GITHUB_OUTPUT
exit 0;
if ! git cherry-pick ${rev} ; then
git add -u
git -c core.editor=true cherry-pick --continue
fi
done
git push -d origin ${{steps.create_branch.outputs.PRBRANCH}} || true
git push -u origin ${{steps.create_branch.outputs.PRBRANCH}}
echo "merge=true" >> $GITHUB_OUTPUT

- uses: actions/github-script@v7
name: Open pick PR to ${{steps.branch_info.outputs.NEXT_BRANCH}}
if: steps.merge-changes.outputs.merge == 'true'
env:
TITLE: ${{steps.merge-changes.outputs.TITLE}}
MESSAGE: ${{steps.merge-changes.outputs.MESSAGE}}
with:
github-token: ${{ github.token }}
github-token: ${{ secrets.AUTOPR_SECRET }}
script: |
await github.rest.pulls.create({
...context.repo,
title: `Pick ${{steps.branch_info.outputs.CURRENT_VERSION}} to ${{steps.branch_info.outputs.NEXT_VERSION}}`,
title: `[Pick][${{steps.branch_info.outputs.CURRENT_VERSION}} to ${{steps.branch_info.outputs.NEXT_VERSION}}] ` + process.env.TITLE,
head: `${{steps.create_branch.outputs.PRBRANCH}}`,
base: `${{steps.branch_info.outputs.NEXT_BRANCH}}`,
body: `${{steps.merge-changes.outputs.MESSAGE}}\nGenerated by Auto PR, by cherry-pick related commits`,
});

- uses: actions/github-script@v7
name: Open merge PR to ${{steps.branch_info.outputs.NEXT_BRANCH}}
if: steps.merge-changes.outputs.merge == 'false'
with:
github-token: ${{ github.token }}
script: |
await github.rest.pulls.create({
...context.repo,
title: `Merge ${{steps.branch_info.outputs.CURRENT_VERSION}} to ${{steps.branch_info.outputs.NEXT_VERSION}}`,
head: `${context.ref}`,
base: `${{steps.branch_info.outputs.NEXT_BRANCH}}`,
body: `${{steps.merge-changes.outputs.MESSAGE}}\nGenerated by Auto PR, using merge since cherry-pick failed`,
body: process.env.MESSAGE + `\nGenerated by Auto PR, by cherry-pick related commits`,
});
File renamed without changes.
64 changes: 39 additions & 25 deletions .github/workflows/ci.linux.arm.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
name: Linux ARM

on:
push:
branches: [ "main", "release/*" ]
pull_request:
branches: [ "main", "release/*" ]

jobs:
gcc921:
runs-on: [self-hosted, Linux, ARM64]
arm-linux-build-and-test:
runs-on: ubuntu-24.04-arm

container:
image: ghcr.io/alibaba/photon-ut-base:latest
Expand All @@ -23,7 +21,7 @@ jobs:

- uses: actions/checkout@v4

- name: Build
- name: Build-Debug-921-C++14
run: |
source /opt/rh/gcc-toolset-9/enable
cmake -B build \
Expand All @@ -36,31 +34,42 @@ jobs:
-D PHOTON_ENABLE_EXTFS=ON
cmake --build build -j $(nproc) -- VERBOSE=1

- name: Test
- name: Build-Debug-921-C++17
run: |
cd build
ctest -E test-lockfree --timeout 3600 -V

gcc921-build-debug:
runs-on: [self-hosted, Linux, ARM64]

container:
image: ghcr.io/alibaba/photon-ut-base:latest
options: --cpus 4

steps:
- uses: szenius/set-timezone@v2.0
with:
timezoneLinux: "Asia/Shanghai"
timezoneMacos: "Asia/Shanghai"
timezoneWindows: "China Standard Time"
source /opt/rh/gcc-toolset-9/enable
rm -fr build
cmake -B build \
-D PHOTON_CXX_STANDARD=17 \
-D CMAKE_BUILD_TYPE=Debug \
-D PHOTON_ENABLE_ECOSYSTEM=ON \
-D PHOTON_BUILD_TESTING=ON \
-D PHOTON_ENABLE_SASL=ON \
-D PHOTON_ENABLE_FUSE=ON \
-D PHOTON_ENABLE_LIBCURL=ON \
-D PHOTON_ENABLE_EXTFS=ON
cmake --build build -j $(nproc) -- VERBOSE=1

- uses: actions/checkout@v4
- name: Build-Debug-1121-C++20
run: |
source /opt/rh/gcc-toolset-11/enable
rm -fr build
cmake -B build \
-D PHOTON_CXX_STANDARD=20 \
-D CMAKE_BUILD_TYPE=Debug \
-D PHOTON_ENABLE_ECOSYSTEM=ON \
-D PHOTON_BUILD_TESTING=ON \
-D PHOTON_ENABLE_SASL=ON \
-D PHOTON_ENABLE_FUSE=ON \
-D PHOTON_ENABLE_LIBCURL=ON \
-D PHOTON_ENABLE_EXTFS=ON
cmake --build build -j $(nproc) -- VERBOSE=1

- name: Build
- name: Build-Debug-1211-C++23
run: |
source /opt/rh/gcc-toolset-9/enable
source /opt/rh/gcc-toolset-12/enable
rm -fr build
cmake -B build \
-D PHOTON_CXX_STANDARD=23 \
-D CMAKE_BUILD_TYPE=Debug \
-D PHOTON_ENABLE_ECOSYSTEM=ON \
-D PHOTON_BUILD_TESTING=ON \
Expand All @@ -69,3 +78,8 @@ jobs:
-D PHOTON_ENABLE_LIBCURL=ON \
-D PHOTON_ENABLE_EXTFS=ON
cmake --build build -j $(nproc) -- VERBOSE=1

- name: Test
run: |
cd build
ctest -E test-lockfree --timeout 3600 -V
2 changes: 0 additions & 2 deletions .github/workflows/ci.linux.x86_64.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
name: Linux x86_64

on:
push:
branches: [ "main", "release/*" ]
pull_request:
branches: [ "main", "release/*" ]

Expand Down
9 changes: 4 additions & 5 deletions .github/workflows/ci.macos.arm.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
name: macOS ARM

on:
push:
branches: [ "main", "release/*" ]
pull_request:
branches: [ "main", "release/*" ]

jobs:
macOS14-arm:
runs-on: macos-14
runs-on: macos-15

steps:
- uses: szenius/set-timezone@v2.0
Expand All @@ -22,17 +20,18 @@ jobs:
- name: Install Dependencies
shell: bash
run: |
brew install cmake openssl gflags googletest gsasl
brew install openssl gflags googletest gsasl

- name: Build
run: |
cmake -B ${{github.workspace}}/build \
-D PHOTON_CXX_STANDARD=17 \
-D PHOTON_ENABLE_ECOSYSTEM=ON \
-D PHOTON_BUILD_TESTING=ON \
-D CMAKE_BUILD_TYPE=MinSizeRel \
-D PHOTON_ENABLE_SASL=ON \
-D PHOTON_ENABLE_LIBCURL=ON \
-D OPENSSL_ROOT_DIR=/opt/homebrew/Cellar/openssl@1.1/1.1.1w
-D OPENSSL_ROOT_DIR=/opt/homebrew/Cellar/openssl@3/3.6.0
cmake --build ${{github.workspace}}/build -j $(sysctl -n hw.logicalcpu)

- name: Test
Expand Down
9 changes: 4 additions & 5 deletions .github/workflows/ci.macos.x86_64.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
name: macOS x86_64

on:
push:
branches: [ "main", "release/*" ]
pull_request:
branches: [ "main", "release/*" ]

jobs:
macOS13-x86:
runs-on: macos-13
runs-on: macos-15

steps:
- uses: szenius/set-timezone@v2.0
Expand All @@ -22,17 +20,18 @@ jobs:
- name: Install Dependencies
shell: bash
run: |
brew install cmake openssl gflags googletest gsasl
brew install openssl gflags googletest gsasl

- name: Build
run: |
cmake -B ${{github.workspace}}/build \
-D PHOTON_CXX_STANDARD=17 \
-D PHOTON_ENABLE_ECOSYSTEM=ON \
-D PHOTON_BUILD_TESTING=ON \
-D CMAKE_BUILD_TYPE=MinSizeRel \
-D PHOTON_ENABLE_SASL=ON \
-D PHOTON_ENABLE_LIBCURL=ON \
-D OPENSSL_ROOT_DIR=/usr/local/opt/openssl@3
-D OPENSSL_ROOT_DIR=/opt/homebrew/Cellar/openssl@3/3.6.0
cmake --build ${{github.workspace}}/build -j $(sysctl -n hw.logicalcpu)

- name: Test
Expand Down
10 changes: 9 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ project(
LANGUAGES C CXX ASM
)

# for CMake 4.x compatible
set(CMAKE_POLICY_VERSION_MINIMUM 3.5)

# Utility Modules and Find Modules
include(FindPackageHandleStandardArgs)
include(CheckCXXCompilerFlag)
Expand All @@ -28,6 +31,7 @@ option(PHOTON_ENABLE_FSTACK_DPDK "Use f-stack + DPDK as the event engine" OFF)
option(PHOTON_ENABLE_EXTFS "enable extfs" OFF)
option(PHOTON_ENABLE_ECOSYSTEM "enable ecosystem" OFF)
option(PHOTON_ENABLE_LIBCURL "enable libcurl" ON)
set(PHOTON_DEFAULT_LOG_LEVEL "0" CACHE STRING "default log level")

option(PHOTON_BUILD_DEPENDENCIES "" OFF)
set(PHOTON_AIO_SOURCE "https://pagure.io/libaio/archive/libaio-0.3.113/libaio-0.3.113.tar.gz" CACHE STRING "")
Expand All @@ -42,7 +46,7 @@ set(PHOTON_E2FS_SOURCE "" CACHE STRING "")
set(PHOTON_GFLAGS_SOURCE "https://github.com/gflags/gflags/archive/refs/tags/v2.2.2.tar.gz" CACHE STRING "")
set(PHOTON_GOOGLETEST_SOURCE "https://github.com/google/googletest/archive/refs/tags/release-1.12.1.tar.gz" CACHE STRING "")
set(PHOTON_RAPIDJSON_GIT "https://github.com/Tencent/rapidjson.git" CACHE STRING "")
set(PHOTON_RAPIDXML_SOURCE "https://sourceforge.net/projects/rapidxml/files/rapidxml/rapidxml%201.13/rapidxml-1.13.zip/download" CACHE STRING "")
set(PHOTON_RAPIDXML_SOURCE "https://github.com/photonlibos/rapidxml" CACHE STRING "")
set(PHOTON_RAPIDYAML_SOURCE "https://github.com/biojppm/rapidyaml/releases/download/v0.5.0/rapidyaml-0.5.0.hpp" CACHE STRING "")
set(PHOTON_CPP_REDIS_SOURCE "https://github.com/cpp-redis/cpp_redis/archive/refs/tags/4.3.1.tar.gz" CACHE STRING "")

Expand All @@ -64,6 +68,7 @@ if (PHOTON_BUILD_WITH_ASAN)
if ((NOT CMAKE_BUILD_TYPE STREQUAL "Debug") OR (NOT CMAKE_SYSTEM_NAME STREQUAL "Linux"))
message(FATAL_ERROR "Wrong environment")
endif ()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=address -static-libasan")
add_link_options(-fsanitize=address -static-libasan)
endif ()

Expand Down Expand Up @@ -257,6 +262,9 @@ endif()
if (PHOTON_ENABLE_LIBCURL)
target_compile_definitions(photon_obj PRIVATE ENABLE_CURL)
endif()
if (PHOTON_DEFAULT_LOG_LEVEL)
target_compile_definitions(photon_obj PRIVATE DEFAULT_LOG_LEVEL=${PHOTON_DEFAULT_LOG_LEVEL})
endif()

if (actually_built)
add_dependencies(photon_obj ${actually_built})
Expand Down
30 changes: 18 additions & 12 deletions common/alog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,10 @@ class LogOutputNull : public BaseLogOutput {
static LogOutputNull _log_output_null;
ILogOutput* const log_output_null = &_log_output_null;

ALogLogger default_logger {log_output_stdout, ALOG_DEBUG};
#ifndef DEFAULT_LOG_LEVEL
#define DEFAULT_LOG_LEVEL ALOG_DEBUG
#endif
ALogLogger default_logger {log_output_stdout, DEFAULT_LOG_LEVEL};
ALogLogger default_audit_logger {log_output_null, ALOG_AUDIT};

uint32_t& log_output_level = default_logger.log_level;
Expand Down Expand Up @@ -204,23 +207,26 @@ void LogFormatter::put_integer_dec(ALogBuffer& buf, ALogInteger x)
}

__attribute__((constructor)) static void __initial_timezone() { tzset(); }
static time_t dayid = 0;
static time_t dayid = 0, minuteid = 0, tsdelta = 0;
static struct tm alog_time = {0};
static struct tm* alog_update_time(time_t now)
{
auto now0 = now;
static struct tm* alog_update_time(time_t now0) {
auto now = now0 + tsdelta;
int sec = now % 60; now /= 60;
if (unlikely(now != minuteid)) { // calibrate wall time every minute
now = time(0) - timezone;
tsdelta = now - now0;
sec = now % 60; now /= 60;
minuteid = now;
}
int min = now % 60; now /= 60;
int hor = now % 24; now /= 24;
if (now != dayid)
{
if (now != dayid) {
dayid = now;
gmtime_r(&now0, &alog_time);
auto now_ = now0 + tsdelta;
gmtime_r(&now_, &alog_time);
alog_time.tm_year+=1900;
alog_time.tm_mon++;
}
else
{
} else {
alog_time.tm_sec = sec;
alog_time.tm_min = min;
alog_time.tm_hour = hor;
Expand Down Expand Up @@ -484,7 +490,7 @@ LogBuffer& operator << (LogBuffer& log, const Prologue& pro)
auto t = &alog_time;
#else
auto ts = photon::__update_now();
auto t = alog_update_time(ts.sec() - timezone);
auto t = alog_update_time(ts.sec());
#endif
#define DEC_W2P0(x) DEC(x).width(2).padding('0')
log.printf(t->tm_year, '/');
Expand Down
Loading