From 883ae17420ff81bf311af0edb47abfd022c4b267 Mon Sep 17 00:00:00 2001 From: vjpai Date: Wed, 28 Jan 2015 16:46:11 -0800 Subject: [PATCH 1/3] Make this compile on mac by adding in header files currently used for posix, as opposed to non-existent header file. --- src/core/iomgr/wakeup_fd_nospecial.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/core/iomgr/wakeup_fd_nospecial.c b/src/core/iomgr/wakeup_fd_nospecial.c index 21e8074d50e..a7b69744e2b 100644 --- a/src/core/iomgr/wakeup_fd_nospecial.c +++ b/src/core/iomgr/wakeup_fd_nospecial.c @@ -37,11 +37,12 @@ */ #include +#include "src/core/iomgr/wakeup_fd_posix.h" +#include "src/core/iomgr/wakeup_fd_pipe.h" +#include #ifndef GPR_POSIX_HAS_SPECIAL_WAKEUP_FD -#include "src/core/iomgr/wakeup_fd.h" - static int check_availability_invalid(void) { return 0; } From dbc0f5940adca898862ff4c0791e5eb08b254045 Mon Sep 17 00:00:00 2001 From: Vijay Pai Date: Wed, 4 Feb 2015 10:56:32 -0800 Subject: [PATCH 2/3] Add write buffer hint to C++ server handlers so that writes actually go out when expected. --- src/cpp/server/async_server_context.cc | 2 +- src/cpp/server/server_rpc_handler.cc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/cpp/server/async_server_context.cc b/src/cpp/server/async_server_context.cc index 92958111c0c..8e03f7257c7 100644 --- a/src/cpp/server/async_server_context.cc +++ b/src/cpp/server/async_server_context.cc @@ -54,7 +54,7 @@ AsyncServerContext::~AsyncServerContext() { grpc_call_destroy(call_); } void AsyncServerContext::Accept(grpc_completion_queue *cq) { GPR_ASSERT(grpc_call_server_accept(call_, cq, this) == GRPC_CALL_OK); - GPR_ASSERT(grpc_call_server_end_initial_metadata(call_, 0) == GRPC_CALL_OK); + GPR_ASSERT(grpc_call_server_end_initial_metadata(call_, GRPC_WRITE_BUFFER_HINT) == GRPC_CALL_OK); } bool AsyncServerContext::StartRead(google::protobuf::Message *request) { diff --git a/src/cpp/server/server_rpc_handler.cc b/src/cpp/server/server_rpc_handler.cc index 061ac1c2f39..bf02de8b805 100644 --- a/src/cpp/server/server_rpc_handler.cc +++ b/src/cpp/server/server_rpc_handler.cc @@ -77,7 +77,7 @@ void ServerRpcHandler::StartRpc() { if (status.IsOk()) { // Send the response if we get an ok status. - async_server_context_->StartWrite(*response, 0); + async_server_context_->StartWrite(*response, GRPC_WRITE_BUFFER_HINT); type = WaitForNextEvent(); if (type != CompletionQueue::SERVER_WRITE_OK) { status = Status(StatusCode::INTERNAL, "Error writing response."); From 2d03e042e71e76734685215de8d5c6c32e94b3d0 Mon Sep 17 00:00:00 2001 From: Vijay Pai Date: Wed, 4 Feb 2015 11:07:23 -0800 Subject: [PATCH 3/3] Revert "Make this compile on mac by adding in header files currently used for posix," This reverts commit 883ae17420ff81bf311af0edb47abfd022c4b267. --- src/core/iomgr/wakeup_fd_nospecial.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/core/iomgr/wakeup_fd_nospecial.c b/src/core/iomgr/wakeup_fd_nospecial.c index a7b69744e2b..21e8074d50e 100644 --- a/src/core/iomgr/wakeup_fd_nospecial.c +++ b/src/core/iomgr/wakeup_fd_nospecial.c @@ -37,12 +37,11 @@ */ #include -#include "src/core/iomgr/wakeup_fd_posix.h" -#include "src/core/iomgr/wakeup_fd_pipe.h" -#include #ifndef GPR_POSIX_HAS_SPECIAL_WAKEUP_FD +#include "src/core/iomgr/wakeup_fd.h" + static int check_availability_invalid(void) { return 0; }