Skip to content

Commit

Permalink
fix: patch grpc to fix infinite loop
Browse files Browse the repository at this point in the history
Signed-off-by: Patrick Weizhi Xu <weizhi.xu@zilliz.com>
  • Loading branch information
PwzXxm committed Aug 5, 2024
1 parent 7b09707 commit 4fff8bb
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 10 deletions.
6 changes: 3 additions & 3 deletions build.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,9 @@ def system(command):
system("conan export gflags/all gflags/2.2.2@")
system("conan export glog/all glog/0.6.0@")
system("conan export gnu-config/all gnu-config/cci.20210814@")
system("conan export google-cloud-cpp/2.x google-cloud-cpp/2.5.0@")
system("conan export google-cloud-cpp/2.x google-cloud-cpp/2.5.0@milvus/dev")
system("conan export googleapis/all googleapis/cci.20221108@")
system("conan export grpc/all grpc/1.50.1@")
system("conan export grpc/all grpc/1.54.3@")
system("conan export grpc/all grpc/1.54.3@milvus/dev")
system("conan export gtest/all gtest/1.8.1@")
system("conan export gtest/all gtest/1.13.0@")
system("conan export hwloc/all hwloc/2.9.3@")
Expand All @@ -66,6 +65,7 @@ def system(command):
system("conan export onetbb/all onetbb/2021.7.0@")
system("conan export onetbb/all onetbb/2021.9.0@")
system("conan export opentelemetry-proto/all opentelemetry-proto/0.19.0@")
system("conan export opentelemetry-cpp/all opentelemetry-cpp/1.8.3@milvus/dev")
system("conan export pkgconf/all pkgconf/1.9.3@")
system("conan export pkgconf/all pkgconf/2.1.0@")
system("conan export prometheus-cpp/all prometheus-cpp/1.1.0@")
Expand Down
3 changes: 2 additions & 1 deletion conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ class MilvusConan(ConanFile):
"re2/20230301",
"folly/2023.10.30.08@milvus/dev",
"google-cloud-cpp/2.5.0@milvus/dev",
"opentelemetry-cpp/1.8.1.1@milvus/dev",
"opentelemetry-cpp/1.8.3@milvus/dev",
"grpc/1.54.3@milvus/dev", # fix grpc infinite loop
"librdkafka/1.9.1",
"abseil/20230125.3",
"roaring/3.0.0",
Expand Down
4 changes: 2 additions & 2 deletions google-cloud-cpp/2.x/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ def requirements(self):
# These must remain pinned in conan index.
self.requires("protobuf/3.21.12", transitive_headers=True)
self.requires("abseil/20230125.3", transitive_headers=True)
self.requires("grpc/1.54.3", transitive_headers=True)
self.requires("grpc/1.54.3@milvus/dev", transitive_headers=True)
self.requires("nlohmann_json/3.11.2")
self.requires("crc32c/1.1.2")
# The rest require less pinning.
Expand All @@ -156,7 +156,7 @@ def requirements(self):

def build_requirements(self):
# For the `grpc-cpp-plugin` executable, and indirectly `protoc`
self.tool_requires("grpc/<host_version>")
self.tool_requires("grpc/1.54.3@milvus/dev")

def generate(self):
tc = CMakeToolchain(self)
Expand Down
2 changes: 2 additions & 0 deletions grpc/all/conandata.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ patches:
- patch_file: "patches/v1.50.x/002-CMake-Add-gRPC_USE_SYSTEMD-option-34384.patch"
patch_type: "backport"
patch_source: "https://github.com/grpc/grpc/commit/5c3400e8dc08d0810e3301d7e8cd8a718c82eeed"
- patch_file: "patches/v1.50.x/003-trace-loop.patch"
"1.50.1":
- patch_file: "patches/v1.50.x/001-disable-cppstd-override.patch"
- patch_file: "patches/v1.50.x/003-trace-loop.patch"
"1.50.0":
- patch_file: "patches/v1.50.x/001-disable-cppstd-override.patch"
17 changes: 17 additions & 0 deletions grpc/all/patches/v1.50.x/003-trace-loop.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
diff --git a/src/core/lib/debug/trace.cc b/src/core/lib/debug/trace.cc
index 71d427d..08c976c 100644
--- a/src/core/lib/debug/trace.cc
+++ b/src/core/lib/debug/trace.cc
@@ -71,8 +71,10 @@ bool TraceFlagList::Set(const char* name, bool enabled) {
}

void TraceFlagList::Add(TraceFlag* flag) {
- flag->next_tracer_ = root_tracer_;
- root_tracer_ = flag;
+ TraceFlag** next = &root_tracer_;
+ while(*next) next = &(*next)->next_tracer_;
+ flag->next_tracer_ = nullptr;
+ *next = flag;;
}

void TraceFlagList::LogAllTracers() {
8 changes: 4 additions & 4 deletions opentelemetry-cpp/all/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ class OpenTelemetryCppConan(ConanFile):
"shared": False,

"with_no_deprecated_code": False,
"with_stl": False,
"with_stl": True,
"with_gsl": False,
"with_abseil": True,
"with_otlp": "deprecated",
Expand Down Expand Up @@ -116,7 +116,7 @@ def requirements(self):
self.requires("protobuf/3.21.12", transitive_headers=True, transitive_libs=True)

if self.options.with_otlp_grpc:
self.requires("grpc/1.54.3", transitive_headers=True, transitive_libs=True)
self.requires("grpc/1.54.3@milvus/dev", transitive_headers=True, transitive_libs=True)

if (self.options.with_zipkin or
self.options.with_elasticsearch or
Expand Down Expand Up @@ -179,7 +179,7 @@ def build_requirements(self):
self.tool_requires("protobuf/<host_version>")

if self.options.with_otlp_grpc:
self.tool_requires("grpc/<host_version>")
self.tool_requires("grpc/1.54.3@milvus/dev")

def _create_cmake_module_variables(self, module_file):
content = textwrap.dedent("""\
Expand Down Expand Up @@ -219,7 +219,7 @@ def generate(self):
tc.cache_variables["WITH_PROMETHEUS"] = self.options.with_prometheus
tc.cache_variables["WITH_ELASTICSEARCH"] = self.options.with_elasticsearch
tc.cache_variables["WITH_ZPAGES"] = self.options.with_zpages
tc.cache_variables["WITH_JAEGER"] = self.options.get_safe("with_jaeger", False)
tc.cache_variables["WITH_JAEGER"] = self.options.get_safe("with_jaeger", True)
tc.cache_variables["WITH_NO_GETENV"] = self.options.with_no_getenv
tc.cache_variables["WITH_ETW"] = self.options.with_etw
if Version(self.version) < "1.11":
Expand Down

0 comments on commit 4fff8bb

Please sign in to comment.