From 89119c9c840831c792cc31c6be7ca86a90f6a768 Mon Sep 17 00:00:00 2001 From: Coldwings Date: Wed, 25 Feb 2026 18:20:34 +0800 Subject: [PATCH 1/2] Fix macos CI finding openssl dep (#1134) --- .github/workflows/ci.macos.arm.yml | 9 ++++++++- .github/workflows/ci.macos.x86_64.yml | 11 +++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.macos.arm.yml b/.github/workflows/ci.macos.arm.yml index 453df4ab..09762dca 100644 --- a/.github/workflows/ci.macos.arm.yml +++ b/.github/workflows/ci.macos.arm.yml @@ -20,10 +20,13 @@ jobs: - name: Install Dependencies shell: bash run: | - brew install openssl gflags googletest gsasl + brew install openssl@3 gflags googletest gsasl - name: Build run: | + export OPENSSL_TOP=$(brew --prefix openssl@3) + export OPENSSL_VERSION=$(ls -1 $OPENSSL_TOP | grep -E '^[0-9]' | head -1) + export OPENSSL_DIR="$OPENSSL_TOP/$OPENSSL_VERSION" cmake -B ${{github.workspace}}/build \ -D PHOTON_CXX_STANDARD=17 \ -D PHOTON_ENABLE_ECOSYSTEM=ON \ @@ -31,7 +34,11 @@ jobs: -D CMAKE_BUILD_TYPE=MinSizeRel \ -D PHOTON_ENABLE_SASL=ON \ -D PHOTON_ENABLE_LIBCURL=ON \ +<<<<<<< HEAD -D OPENSSL_ROOT_DIR=/opt/homebrew/Cellar/openssl@1.1/1.1.1w +======= + -D OPENSSL_ROOT_DIR=${OPENSSL_DIR} +>>>>>>> be8e6af (Fix macos CI finding openssl dep (#1134)) cmake --build ${{github.workspace}}/build -j $(sysctl -n hw.logicalcpu) - name: Test diff --git a/.github/workflows/ci.macos.x86_64.yml b/.github/workflows/ci.macos.x86_64.yml index f11219d6..558cc93f 100644 --- a/.github/workflows/ci.macos.x86_64.yml +++ b/.github/workflows/ci.macos.x86_64.yml @@ -20,10 +20,17 @@ jobs: - name: Install Dependencies shell: bash run: | +<<<<<<< HEAD brew install openssl gflags googletest gsasl nasm +======= + brew install openssl@3 gflags googletest gsasl nasm +>>>>>>> be8e6af (Fix macos CI finding openssl dep (#1134)) - name: Build run: | + export OPENSSL_TOP=$(brew --prefix openssl@3) + export OPENSSL_VERSION=$(ls -1 $OPENSSL_TOP | grep -E '^[0-9]' | head -1) + export OPENSSL_DIR="$OPENSSL_TOP/$OPENSSL_VERSION" cmake -B ${{github.workspace}}/build \ -D PHOTON_CXX_STANDARD=17 \ -D PHOTON_ENABLE_ECOSYSTEM=ON \ @@ -31,7 +38,11 @@ jobs: -D CMAKE_BUILD_TYPE=MinSizeRel \ -D PHOTON_ENABLE_SASL=ON \ -D PHOTON_ENABLE_LIBCURL=ON \ +<<<<<<< HEAD -D OPENSSL_ROOT_DIR=/usr/local/opt/openssl@3 +======= + -D OPENSSL_ROOT_DIR=${OPENSSL_DIR} +>>>>>>> be8e6af (Fix macos CI finding openssl dep (#1134)) cmake --build ${{github.workspace}}/build -j $(sysctl -n hw.logicalcpu) - name: Test From 4ff30c730763b9950d1584055ec053084efedf19 Mon Sep 17 00:00:00 2001 From: Coldwings Date: Thu, 19 Mar 2026 16:18:54 +0800 Subject: [PATCH 2/2] FIX on SleepQueue --- thread/thread.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/thread/thread.cpp b/thread/thread.cpp index 52fd07e4..1a3d2ec7 100644 --- a/thread/thread.cpp +++ b/thread/thread.cpp @@ -389,6 +389,10 @@ namespace photon thread* pop_front() { auto ret = q[0]; + if (q.size() == 1) { + q.pop_back(); + return ret; + } q[0] = q.back(); q[0]->idx = 0; q.pop_back(); @@ -407,6 +411,11 @@ namespace photon } auto id = obj->idx; + if (q.size() == 1) { + assert(id == 0); + q.pop_back(); + return 0; + } q[obj->idx] = q.back(); q[id]->idx = id; q.pop_back(); @@ -424,6 +433,7 @@ namespace photon // compare m_nodes[idx] with parent node. bool up(int idx) { + assert(!q.empty()); auto tmp = q[idx]; bool ret = false; while (idx != 0){ @@ -443,6 +453,7 @@ namespace photon // compare m_nodes[idx] with child node. bool down(int idx) { + assert(!q.empty()); auto tmp = q[idx]; size_t cmpIdx = (idx << 1) + 1; bool ret = false;