diff --git a/.github/workflows/ci-low-cadence.yml b/.github/workflows/ci-low-cadence.yml index 79e7b1713d..3d4f50044d 100644 --- a/.github/workflows/ci-low-cadence.yml +++ b/.github/workflows/ci-low-cadence.yml @@ -7,10 +7,10 @@ on: types: run-slow-tests schedule: - cron: '0 0,12 * * *' -# push: -# branches: -# - master -# - 'release/**' + push: + branches: + - master + - 'release/**' pull_request: types: [opened, synchronize] branches: diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index dd95a1b241..2382e4e526 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -5,10 +5,10 @@ on: workflow_dispatch: repository_dispatch: types: run-commit-tests -# push: -# branches: -# - master -# - 'release/**' + push: + branches: + - master + - 'release/**' pull_request: types: [opened, synchronize] branches: diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index c2ee6bad91..43a4209a06 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -5,10 +5,10 @@ on: workflow_dispatch: repository_dispatch: types: run-commit-tests -# push: -# branches: -# - master -# - release/** + push: + branches: + - master + - release/** pull_request: types: [opened, synchronize] branches: diff --git a/.github/workflows/debug.yml b/.github/workflows/debug.yml deleted file mode 100644 index d10c78c168..0000000000 --- a/.github/workflows/debug.yml +++ /dev/null @@ -1,63 +0,0 @@ -name: DEBUG - -on: - push: - branches: - - master - -concurrency: - group: ci-${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -env: - GRADLE_OPTS: '-Dorg.gradle.daemon=false -Dorg.gradle.java.installations.auto-detect=false -Dorg.gradle.warning.mode=fail' - INSTALL_COMPILER_RETRIES: '5' - JAVA_VERSION: '17' - -permissions: - contents: read - -jobs: - cpp-msvc-build: - name: C++ MSVC (Windows) - runs-on: windows-latest - timeout-minutes: 60 - env: - CC: cl - CXX: cl - steps: - - name: Checkout code - uses: actions/checkout@v4 - with: - ref: ${{ github.sha }} -# - name: Cache Gradle dependencies -# uses: actions/cache@v4 -# with: -# path: ~/.gradle/caches -# key: ${{ runner.os }}-gradle-caches-${{ hashFiles('**/*.gradle') }} -# restore-keys: | -# ${{ runner.os }}-gradle-caches- -# - name: Cache Gradle wrappers -# uses: actions/cache@v4 -# with: -# path: ~/.gradle/wrapper -# key: ${{ runner.os }}-gradle-wrapper-${{ hashFiles('**/gradle/wrapper/gradle-wrapper.properties') }} -# - name: Setup java -# uses: actions/setup-java@v4 -# with: -# distribution: 'zulu' -# java-version: ${{ env.JAVA_VERSION }} - - name: Build - run: cppbuild/debug.ps1 --cxx-hide-deprecation-message --no-system-tests -# - name: Copy test logs -# id: copy_test_logs -# if: failure() -# run: | -# echo "file=build/distributions/test_logs.tbz2" | Out-File $env:GITHUB_OUTPUT -Encoding utf8 -Append -# ./gradlew tarTestLogs -# - name: Upload crash logs -# if: always() && steps.copy_test_logs.outputs.file == 'build/distributions/test_logs.tbz2' -# uses: actions/upload-artifact@v4 -# with: -# name: crash-logs-msvc-latest -# path: ${{ steps.copy_test_logs.outputs.file }} diff --git a/aeron-client/src/main/cpp/concurrent/Atomic64.h b/aeron-client/src/main/cpp/concurrent/Atomic64.h index 33c7fd84f9..7368ee5858 100644 --- a/aeron-client/src/main/cpp/concurrent/Atomic64.h +++ b/aeron-client/src/main/cpp/concurrent/Atomic64.h @@ -18,12 +18,10 @@ #include "util/Platform.h" -#if defined(AERON_COMPILER_GCC) - #if defined(AERON_CPU_X64) - #include "concurrent/atomic/Atomic64_gcc_x86_64.h" - #else - #include "concurrent/atomic/Atomic64_gcc_cpp11.h" - #endif +#if defined(AERON_COMPILER_GCC) && defined(AERON_CPU_X64) + #include "concurrent/atomic/Atomic64_gcc_x86_64.h" +#elif defined(AERON_COMPILER_GCC) && defined(AERON_CPU_ARM) + #include "concurrent/atomic/Atomic64_gcc_cpp11.h" #elif defined(AERON_COMPILER_MSVC) && defined(AERON_CPU_X64) #include "concurrent/atomic/Atomic64_msvc.h" #else diff --git a/aeron-client/src/main/cpp/util/Platform.h b/aeron-client/src/main/cpp/util/Platform.h index a3259c0641..2731aea629 100644 --- a/aeron-client/src/main/cpp/util/Platform.h +++ b/aeron-client/src/main/cpp/util/Platform.h @@ -26,7 +26,6 @@ #if defined(_M_X64) #define AERON_CPU_X64 1 - #else #error Unsupported CPU! #endif @@ -42,6 +41,13 @@ #define AERON_CPU_X64 1 #endif + #if defined(__aarch64__) + #define AERON_CPU_ARM 1 + #if defined(__STDC_NO_ATOMICS__) + #error C11 atomics are required to compile for aarch64! + #endif + #endif + #else #error Unsupported compiler! #endif diff --git a/aeron-client/src/main/cpp_wrapper/concurrent/Atomic64.h b/aeron-client/src/main/cpp_wrapper/concurrent/Atomic64.h index 33c7fd84f9..7368ee5858 100644 --- a/aeron-client/src/main/cpp_wrapper/concurrent/Atomic64.h +++ b/aeron-client/src/main/cpp_wrapper/concurrent/Atomic64.h @@ -18,12 +18,10 @@ #include "util/Platform.h" -#if defined(AERON_COMPILER_GCC) - #if defined(AERON_CPU_X64) - #include "concurrent/atomic/Atomic64_gcc_x86_64.h" - #else - #include "concurrent/atomic/Atomic64_gcc_cpp11.h" - #endif +#if defined(AERON_COMPILER_GCC) && defined(AERON_CPU_X64) + #include "concurrent/atomic/Atomic64_gcc_x86_64.h" +#elif defined(AERON_COMPILER_GCC) && defined(AERON_CPU_ARM) + #include "concurrent/atomic/Atomic64_gcc_cpp11.h" #elif defined(AERON_COMPILER_MSVC) && defined(AERON_CPU_X64) #include "concurrent/atomic/Atomic64_msvc.h" #else diff --git a/aeron-client/src/main/cpp_wrapper/concurrent/logbuffer/LogBufferDescriptor.h b/aeron-client/src/main/cpp_wrapper/concurrent/logbuffer/LogBufferDescriptor.h index e116e0ae85..e74dd6b121 100644 --- a/aeron-client/src/main/cpp_wrapper/concurrent/logbuffer/LogBufferDescriptor.h +++ b/aeron-client/src/main/cpp_wrapper/concurrent/logbuffer/LogBufferDescriptor.h @@ -29,8 +29,6 @@ namespace aeron { namespace concurrent { namespace logbuffer { namespace LogBuff const std::int32_t TERM_MIN_LENGTH = 64 * 1024; const std::int32_t TERM_MAX_LENGTH = 1024 * 1024 * 1024; -const std::int32_t AERON_PAGE_MIN_SIZE = 4 * 1024; -const std::int32_t AERON_PAGE_MAX_SIZE = 1024 * 1024 * 1024; #if defined(__GNUC__) || _MSC_VER >= 1900 static constexpr const int PARTITION_COUNT = 3; diff --git a/aeron-client/src/main/cpp_wrapper/util/Platform.h b/aeron-client/src/main/cpp_wrapper/util/Platform.h index a3259c0641..2731aea629 100644 --- a/aeron-client/src/main/cpp_wrapper/util/Platform.h +++ b/aeron-client/src/main/cpp_wrapper/util/Platform.h @@ -26,7 +26,6 @@ #if defined(_M_X64) #define AERON_CPU_X64 1 - #else #error Unsupported CPU! #endif @@ -42,6 +41,13 @@ #define AERON_CPU_X64 1 #endif + #if defined(__aarch64__) + #define AERON_CPU_ARM 1 + #if defined(__STDC_NO_ATOMICS__) + #error C11 atomics are required to compile for aarch64! + #endif + #endif + #else #error Unsupported compiler! #endif diff --git a/aeron-driver/src/main/c/agent/aeron_driver_agent.c b/aeron-driver/src/main/c/agent/aeron_driver_agent.c index 727429c26a..bab016cd06 100644 --- a/aeron-driver/src/main/c/agent/aeron_driver_agent.c +++ b/aeron-driver/src/main/c/agent/aeron_driver_agent.c @@ -1470,7 +1470,7 @@ static const char *dissect_cmd_in(int64_t cmd_id, const void *message, size_t le snprintf( buffer, sizeof(buffer) - 1, - "streamId=%d clientId=%" PRId64 " correlationId=%" PRId64 " channel=%*.s", + "streamId=%d clientId=%" PRId64 " correlationId=%" PRId64 " channel=%.*s", command->stream_id, command->correlated.client_id, command->correlated.correlation_id, diff --git a/aeron-driver/src/main/c/media/aeron_udp_channel_transport.c b/aeron-driver/src/main/c/media/aeron_udp_channel_transport.c index e4c0c2f84b..ce970cf448 100644 --- a/aeron-driver/src/main/c/media/aeron_udp_channel_transport.c +++ b/aeron-driver/src/main/c/media/aeron_udp_channel_transport.c @@ -102,7 +102,7 @@ int aeron_udp_channel_transport_init( { transport->interceptor_clientds[i] = NULL; } - + if (NULL == params) { AERON_SET_ERR(EINVAL, "%s", "channel transport params is NULL"); @@ -584,12 +584,14 @@ static int aeron_udp_channel_transport_sendv( struct mmsghdr msg[AERON_NETWORK_PUBLICATION_MAX_MESSAGES_PER_SEND]; size_t msg_i; + size_t msg_namelen = address == NULL ? 0 : AERON_ADDR_LEN(address); + for (msg_i = 0; msg_i < iov_length && msg_i < AERON_NETWORK_PUBLICATION_MAX_MESSAGES_PER_SEND; msg_i++) { msg[msg_i].msg_hdr.msg_control = NULL; msg[msg_i].msg_hdr.msg_controllen = 0; msg[msg_i].msg_hdr.msg_name = address; - msg[msg_i].msg_hdr.msg_namelen = AERON_ADDR_LEN(address); + msg[msg_i].msg_hdr.msg_namelen = msg_namelen; msg[msg_i].msg_hdr.msg_flags = 0; msg[msg_i].msg_hdr.msg_iov = &iov[msg_i]; msg[msg_i].msg_hdr.msg_iovlen = 1; @@ -634,9 +636,16 @@ int aeron_udp_channel_transport_send( int64_t *bytes_sent) { #if defined(HAVE_SENDMMSG) - if (1 == iov_length && NULL != transport->connected_address) + if (NULL != transport->connected_address) { - return aeron_udp_channel_transport_send_connected(transport, iov, bytes_sent); + if (1 == iov_length) + { + return aeron_udp_channel_transport_send_connected(transport, iov, bytes_sent); + } + else + { + return aeron_udp_channel_transport_sendv(transport, NULL, iov, iov_length, bytes_sent); + } } else { diff --git a/build.gradle b/build.gradle index 42c23c5e71..789334334f 100644 --- a/build.gradle +++ b/build.gradle @@ -1390,6 +1390,7 @@ tasks.register('copyTestLogs', Copy) { include '/var/coredump/core*' include '**/*.log' include '**/*.tlog' + include '**/*.PML' include '**/build/reports/tests/**' include '**/build/test-results/**/*' include 'LICENSE' diff --git a/cppbuild/debug.ps1 b/cppbuild/debug.ps1 deleted file mode 100644 index 25f95bf6a6..0000000000 --- a/cppbuild/debug.ps1 +++ /dev/null @@ -1,99 +0,0 @@ -# -# Copyright 2014-2025 Real Logic Limited. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -$CmakeBuildParallelLevel = [Environment]::ProcessorCount -$DeleteBuildDir = $true -$BuildConfig = "Release" -$BuildDir = "$PSScriptRoot\$BuildConfig" -$SourceDir = "$PSScriptRoot\.." -$CMakeVersion = "3.30.0" -$CMakeDirName = "cmake-$CMakeVersion-windows-x86_64" -$CMakeArchive = "$CMakeDirName.zip" -$CMakePath = "$PSScriptRoot\$CMakeDirName" -$OldPath = $env:Path - -try -{ - if (-not (Test-Path $CMakePath)) - { - Write-Host "Installing $CMakeArchive ..." - - $client = New-Object System.Net.WebClient - $client.DownloadFile("https://github.com/Kitware/CMake/releases/download/v$CMakeVersion/$CMakeArchive", "$PSScriptRoot\$CMakeArchive") - - Push-Location $PSScriptRoot - Expand-Archive -LiteralPath "$CMakeArchive" -DestinationPath "$PSScriptRoot" - Remove-Item "$CMakeArchive" - Pop-Location - - Write-Host "Success: $CMakePath" - } - - Write-Host "Installing ProcessMonitor ..." - - $client = New-Object System.Net.WebClient - $client.DownloadFile("https://download.sysinternals.com/files/ProcessMonitor.zip", "$PSScriptRoot\ProcessMonitor.zip") - - Push-Location $PSScriptRoot - Expand-Archive -LiteralPath "ProcessMonitor.zip" -DestinationPath "$PSScriptRoot\ProcessMonitor" - Remove-Item "ProcessMonitor.zip" - - Write-Host "Starting $PSScriptRoot\ProcessMonitor..." - - .\ProcessMonitor\Procmon.exe /AcceptEula /NoFilter /Backingfile $PSScriptRoot\procmon.log - Pop-Location - - Write-Host "Running?" - Get-Process procmon | Format-List * - - if ((Test-Path $BuildDir) -and ($DeleteBuildDir)) - { - Remove-Item -Path $BuildDir -Force -Recurse - } - - if (-not (Test-Path $BuildDir)) - { - [void](New-Item -Path $BuildDir -Type Directory -Force) - } - - Push-Location -Path $BuildDir - - $vsPath = &(Join-Path ${env:ProgramFiles(x86)} "\Microsoft Visual Studio\Installer\vswhere.exe") -property installationpath - Write-Host $vsPath - Import-Module (Join-Path $vsPath "Common7\Tools\Microsoft.VisualStudio.DevShell.dll") - Enter-VsDevShell -VsInstallPath $vsPath -SkipAutomaticLocation - - $env:Path = "$CMakePath\bin;$env:Path" - - Get-ChildItem -Path $PSScriptRoot - - cmake -DAERON_SYSTEM_TESTS=OFF $SourceDir - cmake -DAERON_SYSTEM_TESTS=OFF --build . --config $BuildConfig --parallel $CmakeBuildParallelLevel - if (-not $?) - { - Write-Host "Compile Failed" - Exit 1 - } - - ctest -C $BuildConfig --output-on-failure --timeout 2000 -} -finally -{ - Pop-Location - $env:Path = $OldPath -} - -