Skip to content

Commit

Permalink
Merge branch 'main' into support-client-certs
Browse files Browse the repository at this point in the history
  • Loading branch information
kylepl authored May 3, 2023
2 parents 5f8d2e7 + 2fd3d35 commit 0e06a9e
Show file tree
Hide file tree
Showing 12 changed files with 68 additions and 59 deletions.
2 changes: 1 addition & 1 deletion .bazelversion
Original file line number Diff line number Diff line change
@@ -1 +1 @@
4.2.0
5.4.1
10 changes: 5 additions & 5 deletions bazel/repository.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@ def opentelemetry_cpp_deps():
maybe(
http_archive,
name = "com_github_google_benchmark",
sha256 = "1f71c72ce08d2c1310011ea6436b31e39ccab8c2db94186d26657d41747c85d6",
strip_prefix = "benchmark-1.6.0",
sha256 = "6430e4092653380d9dc4ccb45a1e2dc9259d581f4866dc0759713126056bc1d7",
strip_prefix = "benchmark-1.7.1",
urls = [
"https://github.com/google/benchmark/archive/v1.6.0.tar.gz",
"https://github.com/google/benchmark/archive/v1.7.1.tar.gz",
],
)

Expand Down Expand Up @@ -112,9 +112,9 @@ def opentelemetry_cpp_deps():
http_archive,
name = "github_nlohmann_json",
build_file = "@io_opentelemetry_cpp//bazel:nlohmann_json.BUILD",
sha256 = "b94997df68856753b72f0d7a3703b7d484d4745c567f3584ef97c96c25a5798e",
sha256 = "e5c7a9f49a16814be27e4ed0ee900ecd0092bfb7dbfca65b5a421b774dccaaed",
urls = [
"https://github.com/nlohmann/json/releases/download/v3.10.5/include.zip",
"https://github.com/nlohmann/json/releases/download/v3.11.2/include.zip",
],
)

Expand Down
2 changes: 1 addition & 1 deletion ci/install_bazelisk.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

set -e

BAZELISK_VERSION=v1.10.1
BAZELISK_VERSION=v1.16.0

wget -O /usr/local/bin/bazel https://github.com/bazelbuild/bazelisk/releases/download/$BAZELISK_VERSION/bazelisk-linux-amd64
chmod +x /usr/local/bin/bazel
2 changes: 1 addition & 1 deletion ci/install_windows_bazelisk.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
$ErrorActionPreference = "Stop"
trap { $host.SetShouldExit(1) }

$BAZELISK_VERSION="1.7.4"
$BAZELISK_VERSION="1.16.0"
$CWD=(Get-Item -Path ".\").FullName
(new-object System.Net.WebClient). `
DownloadFile("https://github.com/bazelbuild/bazelisk/releases/download/v$BAZELISK_VERSION/bazelisk-windows-amd64.exe",
Expand Down
5 changes: 0 additions & 5 deletions ci/ports/benchmark/CONTROL

This file was deleted.

27 changes: 10 additions & 17 deletions ci/ports/benchmark/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -6,38 +6,31 @@ if(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore")
endif()

# Make sure vs2019 compiled binaries are compat with vs2017
set(VCPKG_CXX_FLAGS "/Zc:__cplusplus /d2FH4-")
set(VCPKG_C_FLAGS "/Zc:__cplusplus /d2FH4-")

include(vcpkg_common_functions)

vcpkg_check_linkage(ONLY_STATIC_LIBRARY)

vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO google/benchmark
REF v1.5.0
SHA512 a0df9aa3d03f676e302c76d83b436de36eea0a8517ab50a8f5a11c74ccc68a1f5128fa02474901002d8e6b5a4d290ef0272a798ff4670eab3e2d78dc86bb6cd3
REF v1.7.1
SHA512 396af1c1d3eaa2b78c6d23b1472f6088db85a294056ae1c2366dc5c0becdc8f141ba8fc3a235033324ab0a41c2298f5d242ef09b9b6f69d9877de6bcb2062efd
HEAD_REF master
)

vcpkg_configure_cmake(
vcpkg_cmake_configure(
SOURCE_PATH ${SOURCE_PATH}
PREFER_NINJA
OPTIONS
-DBENCHMARK_ENABLE_TESTING=OFF
-DCMAKE_DEBUG_POSTFIX=d
)

vcpkg_install_cmake()

vcpkg_cmake_install()
vcpkg_copy_pdbs()

vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/benchmark)
vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/benchmark)

vcpkg_fixup_pkgconfig()

file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share)
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share")

# Handle copyright
file(COPY ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/benchmark)
file(RENAME ${CURRENT_PACKAGES_DIR}/share/benchmark/LICENSE ${CURRENT_PACKAGES_DIR}/share/benchmark/copyright)
file(INSTALL "${SOURCE_PATH}/LICENSE" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
19 changes: 19 additions & 0 deletions ci/ports/benchmark/vcpkg.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"$comment": "https://github.com/google/benchmark/issues/661 describes the missing UWP support upstream",
"name": "benchmark",
"version-semver": "1.7.1",
"description": "A library to support the benchmarking of functions, similar to unit-tests.",
"homepage": "https://github.com/google/benchmark",
"license": "Apache-2.0",
"supports": "!uwp",
"dependencies": [
{
"name": "vcpkg-cmake",
"host": true
},
{
"name": "vcpkg-cmake-config",
"host": true
}
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,7 @@ class HttpClient : public opentelemetry::ext::http::client::HttpClient
std::recursive_mutex session_ids_m_;
std::unordered_map<uint64_t, std::shared_ptr<Session>> sessions_;
std::unordered_set<uint64_t> pending_to_add_session_ids_;
std::unordered_set<uint64_t> pending_to_abort_session_ids_;
std::unordered_map<uint64_t, std::shared_ptr<Session>> pending_to_abort_sessions_;
std::unordered_map<uint64_t, HttpCurlEasyResource> pending_to_remove_session_handles_;
std::list<std::shared_ptr<Session>> pending_to_remove_sessions_;

Expand Down
50 changes: 26 additions & 24 deletions ext/src/http/client/curl/http_client_curl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -257,8 +257,8 @@ void HttpClient::CleanupSession(uint64_t session_id)
}
else if (session->IsSessionActive() && session->GetOperation())
{
// If this session is alread waiting to be removed, just wakeup background thread to call
// doRemoveSessions()
// If this session is already running, give it to the background thread for cleanup.
pending_to_abort_sessions_[session_id] = std::move(session);
wakeupBackgroundThread();
}
}
Expand Down Expand Up @@ -392,7 +392,7 @@ void HttpClient::ScheduleAddSession(uint64_t session_id)
std::lock_guard<std::recursive_mutex> lock_guard{session_ids_m_};
pending_to_add_session_ids_.insert(session_id);
pending_to_remove_session_handles_.erase(session_id);
pending_to_abort_session_ids_.erase(session_id);
pending_to_abort_sessions_.erase(session_id);
}

wakeupBackgroundThread();
Expand All @@ -401,9 +401,21 @@ void HttpClient::ScheduleAddSession(uint64_t session_id)
void HttpClient::ScheduleAbortSession(uint64_t session_id)
{
{
std::lock_guard<std::recursive_mutex> lock_guard{session_ids_m_};
pending_to_abort_session_ids_.insert(session_id);
pending_to_add_session_ids_.erase(session_id);
std::lock_guard<std::mutex> lock_guard{sessions_m_};
auto session = sessions_.find(session_id);
if (session == sessions_.end())
{
std::lock_guard<std::recursive_mutex> lock_guard{session_ids_m_};
pending_to_add_session_ids_.erase(session_id);
}
else
{
std::lock_guard<std::recursive_mutex> lock_guard{session_ids_m_};
pending_to_abort_sessions_[session_id] = std::move(session->second);
pending_to_add_session_ids_.erase(session_id);

sessions_.erase(session);
}
}

wakeupBackgroundThread();
Expand Down Expand Up @@ -472,33 +484,23 @@ bool HttpClient::doAddSessions()

bool HttpClient::doAbortSessions()
{
std::list<std::shared_ptr<Session>> abort_sessions;
std::unordered_set<uint64_t> pending_to_abort_session_ids;
std::unordered_map<uint64_t, std::shared_ptr<Session>> pending_to_abort_sessions;
{
std::lock_guard<std::recursive_mutex> session_id_lock_guard{session_ids_m_};
pending_to_abort_session_ids_.swap(pending_to_abort_session_ids);
pending_to_abort_sessions_.swap(pending_to_abort_sessions);
}

bool has_data = false;
for (auto session : pending_to_abort_sessions)
{
std::lock_guard<std::mutex> lock_guard{sessions_m_};
for (auto &session_id : pending_to_abort_session_ids)
if (!session.second)
{
auto session = sessions_.find(session_id);
if (session == sessions_.end())
{
continue;
}

abort_sessions.push_back(session->second);
continue;
}
}

bool has_data = false;
for (auto session : abort_sessions)
{
if (session->GetOperation())
if (session.second->GetOperation())
{
session->FinishOperation();
session.second->FinishOperation();
has_data = true;
}
}
Expand Down
2 changes: 1 addition & 1 deletion third_party/benchmark
Submodule benchmark updated 139 files
2 changes: 1 addition & 1 deletion third_party/nlohmann-json
Submodule nlohmann-json updated 1123 files
4 changes: 2 additions & 2 deletions third_party_release
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@
gRPC=v1.49.2
thrift=0.14.1
abseil=20220623.1
benchmark=v1.5.3
benchmark=v1.7.1
googletest=release-1.12.1
ms-gsl=v3.1.0-67-g6f45293
nlohmann-json=v3.10.5
nlohmann-json=v3.11.2
opentelemetry-proto=v0.19.0
opentracing-cpp=v1.6.0
prometheus-cpp=v1.1.0
Expand Down

0 comments on commit 0e06a9e

Please sign in to comment.