Skip to content

Commit

Permalink
Revert "*: supress grpc "tcp set inq" loggings (#5797)" (#6053)
Browse files Browse the repository at this point in the history
ref #6054
  • Loading branch information
JaySon-Huang committed Sep 28, 2022
1 parent ca8f97d commit 9e35992
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 53 deletions.
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")

0 comments on commit 9e35992

Please sign in to comment.