diff options
-rw-r--r-- | src/core/lib/iomgr/tcp_uv.cc | 3 | ||||
-rw-r--r-- | src/core/lib/iomgr/timer_uv.cc | 3 | ||||
-rwxr-xr-x | tools/dockerfile/interoptest/grpc_interop_node/build_interop.sh | 11 |
3 files changed, 17 insertions, 0 deletions
diff --git a/src/core/lib/iomgr/tcp_uv.cc b/src/core/lib/iomgr/tcp_uv.cc index f20f8dcb74..8d0e4a5e79 100644 --- a/src/core/lib/iomgr/tcp_uv.cc +++ b/src/core/lib/iomgr/tcp_uv.cc @@ -204,6 +204,9 @@ static grpc_error* uv_socket_init_helper(uv_socket_t* uv_socket, int domain) { uv_socket->write_buffers = nullptr; uv_socket->read_len = 0; uv_tcp_nodelay(uv_socket->handle, 1); + // Node uses a garbage collector to call destructors, so we don't + // want to hold the uv loop open with active gRPC objects. + uv_unref((uv_handle_t*)uv_socket->handle); uv_socket->pending_connection = false; uv_socket->accept_socket = nullptr; uv_socket->accept_error = GRPC_ERROR_NONE; diff --git a/src/core/lib/iomgr/timer_uv.cc b/src/core/lib/iomgr/timer_uv.cc index dadeb960b2..8b7c82eb7d 100644 --- a/src/core/lib/iomgr/timer_uv.cc +++ b/src/core/lib/iomgr/timer_uv.cc @@ -52,6 +52,9 @@ static void timer_start(grpc_custom_timer* t) { uv_timer->data = t; t->timer = (void*)uv_timer; uv_timer_start(uv_timer, run_expired_timer, t->timeout_ms, 0); + // Node uses a garbage collector to call destructors, so we don't + // want to hold the uv loop open with active gRPC objects. + uv_unref((uv_handle_t*)uv_timer); } static void timer_stop(grpc_custom_timer* t) { diff --git a/tools/dockerfile/interoptest/grpc_interop_node/build_interop.sh b/tools/dockerfile/interoptest/grpc_interop_node/build_interop.sh index c16efc1d35..21fdd0b490 100755 --- a/tools/dockerfile/interoptest/grpc_interop_node/build_interop.sh +++ b/tools/dockerfile/interoptest/grpc_interop_node/build_interop.sh @@ -17,12 +17,23 @@ set -e mkdir -p /var/local/git + git clone /var/local/jenkins/grpc-node /var/local/git/grpc-node # clone gRPC submodules, use data from locally cloned submodules where possible (cd /var/local/jenkins/grpc-node/ && git submodule foreach 'cd /var/local/git/grpc-node \ && git submodule update --init --recursive --reference /var/local/jenkins/grpc-node/${name} \ ${name}') +# Use the pending c-core changes if possible +if [ -d "/var/local/jenkins/grpc" ]; then + cd /var/local/jenkins/grpc + CURRENT_COMMIT="$(git rev-parse --verify HEAD)" + cd /var/local/git/grpc-node/packages/grpc-native-core/deps/grpc/ + git fetch --tags --progress https://github.com/grpc/grpc.git +refs/pull/*:refs/remotes/origin/pr/* + git checkout $CURRENT_COMMIT + git submodule update --init --recursive --reference /var/local/jenkins/grpc +fi + # copy service account keys if available cp -r /var/local/jenkins/service_account $HOME || true |