Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert "*: supress grpc "tcp set inq" loggings (#5797)" #6053

Merged
merged 1 commit into from
Sep 28, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
26 changes: 0 additions & 26 deletions contrib/grpc-cmake/0001-disable-tcp-set-inq-debug-message.patch

This file was deleted.

28 changes: 1 addition & 27 deletions contrib/grpc-cmake/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -81,35 +81,9 @@ if(TIFLASH_LLVM_TOOLCHAIN)
target_compile_options(grpc PRIVATE
-Wno-deprecated-declarations -Wno-non-c-typedef-for-linkage -Wno-implicit-const-int-float-conversion)
target_compile_options(grpc++ PRIVATE
-Wno-deprecated-declarations -Wno-non-c-typedef-for-linkage -Wno-implicit-const-int-float-conversion)
-Wno-deprecated-declarations -Wno-non-c-typedef-for-linkage -Wno-implicit-const-int-float-conversion)
endif()

execute_process(
COMMAND grep "//gpr_log(GPR_DEBUG, \"cannot set inq fd=%d errno=%d\", tcp->fd, errno);" "${_gRPC_SOURCE_DIR}/src/core/lib/iomgr/tcp_posix.cc"
RESULT_VARIABLE HAVE_APPLY_PATCH)
# grep - Normally, the exit status is 0 if selected lines are found and 1 otherwise. But the exit status is 2 if an error occurred.
if (HAVE_APPLY_PATCH EQUAL 1)
message(STATUS "grpc patch not apply: ${HAVE_APPLY_PATCH}, patching...")
# update the patch using `git format-patch` if you upgrade grpc
set (GRPC_PATCH_FILE "${TiFlash_SOURCE_DIR}/contrib/grpc-cmake/0001-disable-tcp-set-inq-debug-message.patch")
# apply the patch
execute_process(
COMMAND git apply -v "${GRPC_PATCH_FILE}"
WORKING_DIRECTORY "${_gRPC_SOURCE_DIR}"
COMMAND_ECHO STDOUT
RESULT_VARIABLE PATCH_SUCC)
if (NOT PATCH_SUCC EQUAL 0)
message(FATAL_ERROR "Can not apply grpc patch ${GRPC_PATCH_FILE}")
else ()
message(STATUS "grpc patch done")
endif ()
elseif (HAVE_APPLY_PATCH EQUAL 0)
message(STATUS "grpc patch have been applied: ${HAVE_APPLY_PATCH}")
else ()
message(FATAL_ERROR "Can not check the grpc patch status")
endif ()


# The contrib/grpc/CMakeLists.txt redefined the PROTOBUF_GENERATE_GRPC_CPP() function for its own purposes,
# so we need to redefine it back.
include("${TiFlash_SOURCE_DIR}/contrib/grpc-cmake/protobuf_generate_grpc.cmake")