From 0a6440481f10ad35ae904a1834ba99f627078e28 Mon Sep 17 00:00:00 2001 From: Jan Tattermusch Date: Sun, 12 Jul 2015 01:27:30 -0700 Subject: [PATCH 1/9] remove chatty log messages on windows --- src/core/iomgr/iocp_windows.c | 1 - src/core/iomgr/tcp_windows.c | 24 +++++++++++++++--------- 2 files changed, 15 insertions(+), 10 deletions(-) diff --git a/src/core/iomgr/iocp_windows.c b/src/core/iomgr/iocp_windows.c index 0c62bfccd5154..3d3a193d00d9a 100644 --- a/src/core/iomgr/iocp_windows.c +++ b/src/core/iomgr/iocp_windows.c @@ -127,7 +127,6 @@ static void iocp_loop(void *p) { grpc_maybe_call_delayed_callbacks(NULL, 1); do_iocp_work(); } - gpr_log(GPR_DEBUG, "iocp_loop is done"); gpr_event_set(&g_iocp_done, (void *)1); } diff --git a/src/core/iomgr/tcp_windows.c b/src/core/iomgr/tcp_windows.c index 15759c398a141..1bf81a73e0c80 100644 --- a/src/core/iomgr/tcp_windows.c +++ b/src/core/iomgr/tcp_windows.c @@ -148,9 +148,11 @@ static void on_read(void *tcpp, int from_iocp) { GPR_ASSERT(tcp->socket->read_info.outstanding); if (socket->read_info.wsa_error != 0) { - char *utf8_message = gpr_format_message(info->wsa_error); - gpr_log(GPR_ERROR, "ReadFile overlapped error: %s", utf8_message); - gpr_free(utf8_message); + if (socket->read_info.wsa_error != WSAECONNRESET) { + char *utf8_message = gpr_format_message(info->wsa_error); + gpr_log(GPR_ERROR, "ReadFile overlapped error: %s", utf8_message); + gpr_free(utf8_message); + } status = GRPC_ENDPOINT_CB_ERROR; } else { if (info->bytes_transfered != 0) { @@ -259,9 +261,11 @@ static void on_write(void *tcpp, int from_iocp) { GPR_ASSERT(tcp->socket->write_info.outstanding); if (info->wsa_error != 0) { - char *utf8_message = gpr_format_message(info->wsa_error); - gpr_log(GPR_ERROR, "WSASend overlapped error: %s", utf8_message); - gpr_free(utf8_message); + if (info->wsa_error != WSAECONNRESET) { + char *utf8_message = gpr_format_message(info->wsa_error); + gpr_log(GPR_ERROR, "WSASend overlapped error: %s", utf8_message); + gpr_free(utf8_message); + } status = GRPC_ENDPOINT_CB_ERROR; } else { GPR_ASSERT(info->bytes_transfered == tcp->write_slices.length); @@ -325,9 +329,11 @@ static grpc_endpoint_write_status win_write(grpc_endpoint *ep, ret = GRPC_ENDPOINT_WRITE_DONE; GPR_ASSERT(bytes_sent == tcp->write_slices.length); } else { - char *utf8_message = gpr_format_message(info->wsa_error); - gpr_log(GPR_ERROR, "WSASend error: %s", utf8_message); - gpr_free(utf8_message); + if (socket->read_info.wsa_error != WSAECONNRESET) { + char *utf8_message = gpr_format_message(info->wsa_error); + gpr_log(GPR_ERROR, "WSASend error: %s", utf8_message); + gpr_free(utf8_message); + } } if (allocated) gpr_free(allocated); gpr_slice_buffer_reset_and_unref(&tcp->write_slices); From ee3129b8f660fc4e96565496ee16481f1cc1c190 Mon Sep 17 00:00:00 2001 From: Jan Tattermusch Date: Sun, 12 Jul 2015 01:28:05 -0700 Subject: [PATCH 2/9] zero-out channel after creation --- src/core/surface/channel.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/core/surface/channel.c b/src/core/surface/channel.c index eeae3b507cc81..b7826d4dfc990 100644 --- a/src/core/surface/channel.c +++ b/src/core/surface/channel.c @@ -91,6 +91,7 @@ grpc_channel *grpc_channel_create_from_filters( size_t size = sizeof(grpc_channel) + grpc_channel_stack_size(filters, num_filters); grpc_channel *channel = gpr_malloc(size); + memset(channel, 0, sizeof(*channel)); GPR_ASSERT(grpc_is_initialized() && "call grpc_init()"); channel->is_client = is_client; /* decremented by grpc_channel_destroy */ From cbce62ce6bcc5cf08ca2138ea5eeae232c72f23c Mon Sep 17 00:00:00 2001 From: "Nicolas \"Pixel\" Noble" Date: Tue, 14 Jul 2015 02:27:23 +0200 Subject: [PATCH 3/9] Better socket kick for Windows. Now calling tcp_shutdown will in fact close the socket, which cascades into properly cleaning out all the pending requests. The tcp_server_windows's shutdown logic had to be rewritted (simplified) in order to take this into account. --- src/core/iomgr/socket_windows.c | 30 +++++++----- src/core/iomgr/tcp_server_windows.c | 76 ++++++++++++----------------- 2 files changed, 49 insertions(+), 57 deletions(-) diff --git a/src/core/iomgr/socket_windows.c b/src/core/iomgr/socket_windows.c index fbf3fdc949169..b4ed9b5a52917 100644 --- a/src/core/iomgr/socket_windows.c +++ b/src/core/iomgr/socket_windows.c @@ -37,6 +37,7 @@ #include #include +#include #include "src/core/iomgr/iocp_windows.h" #include "src/core/iomgr/iomgr_internal.h" @@ -58,22 +59,27 @@ grpc_winsocket *grpc_winsocket_create(SOCKET socket, const char *name) { operations to abort them. We need to do that this way because of the various callsites of that function, which happens to be in various mutex hold states, and that'd be unsafe to call them directly. */ -int grpc_winsocket_shutdown(grpc_winsocket *socket) { +int grpc_winsocket_shutdown(grpc_winsocket *winsocket) { int callbacks_set = 0; - gpr_mu_lock(&socket->state_mu); - if (socket->read_info.cb) { + SOCKET socket; + gpr_mu_lock(&winsocket->state_mu); + socket = winsocket->socket; + if (winsocket->read_info.cb) { callbacks_set++; - grpc_iomgr_closure_init(&socket->shutdown_closure, socket->read_info.cb, - socket->read_info.opaque); - grpc_iomgr_add_delayed_callback(&socket->shutdown_closure, 0); + grpc_iomgr_closure_init(&winsocket->shutdown_closure, + winsocket->read_info.cb, + winsocket->read_info.opaque); + grpc_iomgr_add_delayed_callback(&winsocket->shutdown_closure, 0); } - if (socket->write_info.cb) { + if (winsocket->write_info.cb) { callbacks_set++; - grpc_iomgr_closure_init(&socket->shutdown_closure, socket->write_info.cb, - socket->write_info.opaque); - grpc_iomgr_add_delayed_callback(&socket->shutdown_closure, 0); + grpc_iomgr_closure_init(&winsocket->shutdown_closure, + winsocket->write_info.cb, + winsocket->write_info.opaque); + grpc_iomgr_add_delayed_callback(&winsocket->shutdown_closure, 0); } - gpr_mu_unlock(&socket->state_mu); + gpr_mu_unlock(&winsocket->state_mu); + closesocket(socket); return callbacks_set; } @@ -84,14 +90,12 @@ int grpc_winsocket_shutdown(grpc_winsocket *socket) { an "idle" socket which is neither trying to read or write, we'd start leaking both memory and sockets. */ void grpc_winsocket_orphan(grpc_winsocket *winsocket) { - SOCKET socket = winsocket->socket; grpc_iomgr_unregister_object(&winsocket->iomgr_object); if (winsocket->read_info.outstanding || winsocket->write_info.outstanding) { grpc_iocp_socket_orphan(winsocket); } else { grpc_winsocket_destroy(winsocket); } - closesocket(socket); } void grpc_winsocket_destroy(grpc_winsocket *winsocket) { diff --git a/src/core/iomgr/tcp_server_windows.c b/src/core/iomgr/tcp_server_windows.c index d70968de88511..dfd56f9c40222 100644 --- a/src/core/iomgr/tcp_server_windows.c +++ b/src/core/iomgr/tcp_server_windows.c @@ -108,9 +108,10 @@ void grpc_tcp_server_destroy(grpc_tcp_server *s, size_t i; gpr_mu_lock(&s->mu); /* First, shutdown all fd's. This will queue abortion calls for all - of the pending accepts. */ + of the pending accepts due to the normal operation mechanism. */ for (i = 0; i < s->nports; i++) { server_port *sp = &s->ports[i]; + sp->shutting_down = 1; grpc_winsocket_shutdown(sp->socket); } /* This happens asynchronously. Wait while that happens. */ @@ -243,62 +244,49 @@ static void on_accept(void *arg, int from_iocp) { grpc_winsocket_callback_info *info = &sp->socket->read_info; grpc_endpoint *ep = NULL; - /* The shutdown sequence is done in two parts. This is the second - part here, acknowledging the IOCP notification, and doing nothing - else, especially not queuing a new accept. */ - if (sp->shutting_down) { - GPR_ASSERT(from_iocp); - sp->shutting_down = 0; - sp->socket->read_info.outstanding = 0; - gpr_mu_lock(&sp->server->mu); - if (0 == --sp->server->active_ports) { - gpr_cv_broadcast(&sp->server->cv); - } - gpr_mu_unlock(&sp->server->mu); - return; - } - - if (from_iocp) { - /* The IOCP notified us of a completed operation. Let's grab the results, - and act accordingly. */ - DWORD transfered_bytes = 0; - DWORD flags; - BOOL wsa_success = WSAGetOverlappedResult(sock, &info->overlapped, - &transfered_bytes, FALSE, &flags); - if (!wsa_success) { + /* The general mechanism for shutting down is to queue abortion calls. While + this is necessary in the read/write case, it's useless for the accept + case. Let's do nothing. */ + if (!from_iocp) return; + + /* The IOCP notified us of a completed operation. Let's grab the results, + and act accordingly. */ + DWORD transfered_bytes = 0; + DWORD flags; + BOOL wsa_success = WSAGetOverlappedResult(sock, &info->overlapped, + &transfered_bytes, FALSE, &flags); + if (!wsa_success) { + if (sp->shutting_down) { + /* During the shutdown case, we ARE expecting an error. So that's swell, + and we can wake up the shutdown thread. */ + sp->shutting_down = 0; + sp->socket->read_info.outstanding = 0; + gpr_mu_lock(&sp->server->mu); + if (0 == --sp->server->active_ports) { + gpr_cv_broadcast(&sp->server->cv); + } + gpr_mu_unlock(&sp->server->mu); + return; + } else { char *utf8_message = gpr_format_message(WSAGetLastError()); gpr_log(GPR_ERROR, "on_accept error: %s", utf8_message); gpr_free(utf8_message); closesocket(sock); - } else { - /* TODO(ctiller): add sockaddr address to label */ - ep = grpc_tcp_create(grpc_winsocket_create(sock, "server")); } } else { - /* If we're not notified from the IOCP, it means we are asked to shutdown. - This will initiate that shutdown. Calling closesocket will trigger an - IOCP notification, that will call this function a second time, from - the IOCP thread. Of course, this only works if the socket was, in fact, - listening. If that's not the case, we'd wait indefinitely. That's a bit - of a degenerate case, but it can happen if you create a server, but - don't start it. So let's support that by recursing once. */ - sp->shutting_down = 1; - sp->new_socket = INVALID_SOCKET; - if (sock != INVALID_SOCKET) { - closesocket(sock); - } else { - on_accept(sp, 1); + if (!sp->shutting_down) { + /* TODO(ctiller): add sockaddr address to label */ + ep = grpc_tcp_create(grpc_winsocket_create(sock, "server")); } - return; } /* The only time we should call our callback, is where we successfully managed to accept a connection, and created an endpoint. */ if (ep) sp->server->cb(sp->server->cb_arg, ep); /* As we were notified from the IOCP of one and exactly one accept, - the former socked we created has now either been destroy or assigned - to the new connection. We need to create a new one for the next - connection. */ + the former socked we created has now either been destroy or assigned + to the new connection. We need to create a new one for the next + connection. */ start_accept(sp); } From 043c2dcee4aac2d1b9e6110394d4e94aa57b31c8 Mon Sep 17 00:00:00 2001 From: Jan Tattermusch Date: Wed, 29 Jul 2015 11:49:31 -0700 Subject: [PATCH 4/9] fix race in server shutdown --- src/core/iomgr/tcp_server_windows.c | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/src/core/iomgr/tcp_server_windows.c b/src/core/iomgr/tcp_server_windows.c index dfd56f9c40222..92e512e8d0798 100644 --- a/src/core/iomgr/tcp_server_windows.c +++ b/src/core/iomgr/tcp_server_windows.c @@ -79,6 +79,8 @@ struct grpc_tcp_server { /* active port count: how many ports are actually still listening */ int active_ports; + /* number of iomgr callbacks that have been explicitly scheduled during shutdown */ + int iomgr_callbacks_pending; /* all listening ports */ server_port *ports; @@ -93,6 +95,7 @@ grpc_tcp_server *grpc_tcp_server_create(void) { gpr_mu_init(&s->mu); gpr_cv_init(&s->cv); s->active_ports = 0; + s->iomgr_callbacks_pending = 0; s->cb = NULL; s->cb_arg = NULL; s->ports = gpr_malloc(sizeof(server_port) * INIT_PORT_CAP); @@ -112,10 +115,10 @@ void grpc_tcp_server_destroy(grpc_tcp_server *s, for (i = 0; i < s->nports; i++) { server_port *sp = &s->ports[i]; sp->shutting_down = 1; - grpc_winsocket_shutdown(sp->socket); + s->iomgr_callbacks_pending += grpc_winsocket_shutdown(sp->socket); } /* This happens asynchronously. Wait while that happens. */ - while (s->active_ports) { + while (s->active_ports || s->iomgr_callbacks_pending) { gpr_cv_wait(&s->cv, &s->mu, gpr_inf_future); } gpr_mu_unlock(&s->mu); @@ -246,8 +249,16 @@ static void on_accept(void *arg, int from_iocp) { /* The general mechanism for shutting down is to queue abortion calls. While this is necessary in the read/write case, it's useless for the accept - case. Let's do nothing. */ - if (!from_iocp) return; + case. We only need to adjust the pending callback count */ + if (!from_iocp) { + gpr_mu_lock(&sp->server->mu); + GPR_ASSERT(sp->server->iomgr_callbacks_pending > 0); + if (0 == --sp->server->iomgr_callbacks_pending) { + gpr_cv_broadcast(&sp->server->cv); + } + gpr_mu_unlock(&sp->server->mu); + return; + } /* The IOCP notified us of a completed operation. Let's grab the results, and act accordingly. */ @@ -257,11 +268,12 @@ static void on_accept(void *arg, int from_iocp) { &transfered_bytes, FALSE, &flags); if (!wsa_success) { if (sp->shutting_down) { - /* During the shutdown case, we ARE expecting an error. So that's swell, + /* During the shutdown case, we ARE expecting an error. So that's well, and we can wake up the shutdown thread. */ sp->shutting_down = 0; sp->socket->read_info.outstanding = 0; gpr_mu_lock(&sp->server->mu); + GPR_ASSERT(sp->server->active_ports > 0); if (0 == --sp->server->active_ports) { gpr_cv_broadcast(&sp->server->cv); } From a6fb2705f81eb5da44fe7f18294b552c5d03c712 Mon Sep 17 00:00:00 2001 From: Jan Tattermusch Date: Mon, 13 Jul 2015 21:14:17 -0700 Subject: [PATCH 5/9] pick up nuget package version from cmdline param and fix nuget build --- src/csharp/Grpc.Auth/Grpc.Auth.csproj | 1 + src/csharp/Grpc.Auth/Grpc.Auth.nuspec | 6 +++--- src/csharp/Grpc.Core/Grpc.Core.csproj | 1 + src/csharp/Grpc.Core/Grpc.Core.nuspec | 4 ++-- src/csharp/Grpc.Tools.nuspec | 4 ++-- src/csharp/Grpc.nuspec | 6 +++--- src/csharp/build_packages.bat | 14 +++++++++----- 7 files changed, 21 insertions(+), 15 deletions(-) diff --git a/src/csharp/Grpc.Auth/Grpc.Auth.csproj b/src/csharp/Grpc.Auth/Grpc.Auth.csproj index e6abbbfdf0173..d8f91383a2d2a 100644 --- a/src/csharp/Grpc.Auth/Grpc.Auth.csproj +++ b/src/csharp/Grpc.Auth/Grpc.Auth.csproj @@ -81,6 +81,7 @@ + diff --git a/src/csharp/Grpc.Auth/Grpc.Auth.nuspec b/src/csharp/Grpc.Auth/Grpc.Auth.nuspec index 978b04d70b3d8..1262bdbdab89a 100644 --- a/src/csharp/Grpc.Auth/Grpc.Auth.nuspec +++ b/src/csharp/Grpc.Auth/Grpc.Auth.nuspec @@ -5,19 +5,19 @@ gRPC C# Auth Auth library for C# implementation of gRPC - an RPC library and framework Auth library for C# implementation of gRPC - an RPC library and framework. See project site for more info. - 0.6.0 + $version$ Google Inc. grpc-packages https://github.com/grpc/grpc/blob/master/LICENSE https://github.com/grpc/grpc false - Release 0.6.0 of gRPC C# + Release $version$ of gRPC C# Copyright 2015, Google Inc. gRPC RPC Protocol HTTP/2 Auth OAuth2 - + diff --git a/src/csharp/Grpc.Core/Grpc.Core.csproj b/src/csharp/Grpc.Core/Grpc.Core.csproj index 0e67da324538d..940143bd0a722 100644 --- a/src/csharp/Grpc.Core/Grpc.Core.csproj +++ b/src/csharp/Grpc.Core/Grpc.Core.csproj @@ -104,6 +104,7 @@ + diff --git a/src/csharp/Grpc.Core/Grpc.Core.nuspec b/src/csharp/Grpc.Core/Grpc.Core.nuspec index 457983532a05b..94854c8fbebd5 100644 --- a/src/csharp/Grpc.Core/Grpc.Core.nuspec +++ b/src/csharp/Grpc.Core/Grpc.Core.nuspec @@ -5,13 +5,13 @@ gRPC C# Core Core C# implementation of gRPC - an RPC library and framework Core C# implementation of gRPC - an RPC library and framework. See project site for more info. - 0.6.0 + $version$ Google Inc. grpc-packages https://github.com/grpc/grpc/blob/master/LICENSE https://github.com/grpc/grpc false - Release 0.6.0 of gRPC C# + Release $version$ of gRPC C# Copyright 2015, Google Inc. gRPC RPC Protocol HTTP/2 diff --git a/src/csharp/Grpc.Tools.nuspec b/src/csharp/Grpc.Tools.nuspec index 0f4fa79277ef5..eabf5dc7dbc48 100644 --- a/src/csharp/Grpc.Tools.nuspec +++ b/src/csharp/Grpc.Tools.nuspec @@ -5,13 +5,13 @@ gRPC C# Tools Tools for C# implementation of gRPC - an RPC library and framework Precompiled Windows binaries for generating protocol buffer messages and gRPC client/server code - 0.6.0 + $version$ Google Inc. grpc-packages https://github.com/grpc/grpc/blob/master/LICENSE https://github.com/grpc/grpc false - protoc.exe - protocol buffer compiler v3.0.0-alpha-3; grpc_csharp_plugin.exe - gRPC C# protoc plugin version 0.6.0 + protoc.exe - protocol buffer compiler v3.0.0-alpha-3; grpc_csharp_plugin.exe - gRPC C# protoc plugin version $version$ Copyright 2015, Google Inc. gRPC RPC Protocol HTTP/2 diff --git a/src/csharp/Grpc.nuspec b/src/csharp/Grpc.nuspec index 70203a6203f9e..7fbd8619230d6 100644 --- a/src/csharp/Grpc.nuspec +++ b/src/csharp/Grpc.nuspec @@ -5,17 +5,17 @@ gRPC C# C# implementation of gRPC - an RPC library and framework C# implementation of gRPC - an RPC library and framework. See project site for more info. - 0.6.0 + $version$ Google Inc. grpc-packages https://github.com/grpc/grpc/blob/master/LICENSE https://github.com/grpc/grpc false - Release 0.6.0 of gRPC C# + Release $version$ of gRPC C# Copyright 2015, Google Inc. gRPC RPC Protocol HTTP/2 - + diff --git a/src/csharp/build_packages.bat b/src/csharp/build_packages.bat index 3412129fb2b1c..1a99e0302f949 100644 --- a/src/csharp/build_packages.bat +++ b/src/csharp/build_packages.bat @@ -1,5 +1,9 @@ @rem Builds gRPC NuGet packages +@rem Current package versions +set VERSION=0.6.0 +set CORE_VERSION=0.10.0 + @rem Adjust the location of nuget.exe set NUGET=C:\nuget\nuget.exe @@ -10,11 +14,11 @@ endlocal @call buildall.bat || goto :error -%NUGET% pack ..\..\vsprojects\nuget_package\grpc.native.csharp_ext.nuspec || goto :error -%NUGET% pack Grpc.Core\Grpc.Core.nuspec -Symbols || goto :error -%NUGET% pack Grpc.Auth\Grpc.Auth.nuspec -Symbols || goto :error -%NUGET% pack Grpc.Tools.nuspec || goto :error -%NUGET% pack Grpc.nuspec || goto :error +%NUGET% pack ..\..\vsprojects\nuget_package\grpc.native.csharp_ext.nuspec -Version %CORE_VERSION% || goto :error +%NUGET% pack Grpc.Auth\Grpc.Auth.nuspec -Symbols -Version %VERSION% || goto :error +%NUGET% pack Grpc.Core\Grpc.Core.nuspec -Symbols -Version %VERSION% || goto :error +%NUGET% pack Grpc.Tools.nuspec -Version %VERSION% || goto :error +%NUGET% pack Grpc.nuspec -Version %VERSION% || goto :error goto :EOF From 0d066beedbae0772c3ab52836f12a6ef566ebd86 Mon Sep 17 00:00:00 2001 From: Jan Tattermusch Date: Mon, 13 Jul 2015 21:32:33 -0700 Subject: [PATCH 6/9] introduce Version.cs as single source of truth of gRPC C# version --- src/csharp/Grpc.Auth/Grpc.Auth.csproj | 3 +++ src/csharp/Grpc.Auth/Properties/AssemblyInfo.cs | 1 - src/csharp/Grpc.Core.Tests/Grpc.Core.Tests.csproj | 5 ++++- src/csharp/Grpc.Core.Tests/Properties/AssemblyInfo.cs | 1 - src/csharp/Grpc.Core/Grpc.Core.csproj | 1 + src/csharp/Grpc.Core/Properties/AssemblyInfo.cs | 1 - src/csharp/Grpc.Core/Version.cs | 6 ++++++ .../Grpc.Examples.MathClient.csproj | 7 +++++-- .../Grpc.Examples.MathClient/Properties/AssemblyInfo.cs | 1 - .../Grpc.Examples.MathServer.csproj | 3 +++ .../Grpc.Examples.MathServer/Properties/AssemblyInfo.cs | 1 - src/csharp/Grpc.Examples.Tests/Grpc.Examples.Tests.csproj | 3 +++ src/csharp/Grpc.Examples.Tests/Properties/AssemblyInfo.cs | 1 - src/csharp/Grpc.Examples/Grpc.Examples.csproj | 3 +++ src/csharp/Grpc.Examples/Properties/AssemblyInfo.cs | 1 - .../Grpc.IntegrationTesting.Client.csproj | 3 +++ .../Properties/AssemblyInfo.cs | 1 - .../Grpc.IntegrationTesting.Server.csproj | 3 +++ .../Properties/AssemblyInfo.cs | 1 - .../Grpc.IntegrationTesting/Grpc.IntegrationTesting.csproj | 3 +++ .../Grpc.IntegrationTesting/Properties/AssemblyInfo.cs | 1 - 21 files changed, 37 insertions(+), 13 deletions(-) create mode 100644 src/csharp/Grpc.Core/Version.cs diff --git a/src/csharp/Grpc.Auth/Grpc.Auth.csproj b/src/csharp/Grpc.Auth/Grpc.Auth.csproj index d8f91383a2d2a..fdec2e7bd7f83 100644 --- a/src/csharp/Grpc.Auth/Grpc.Auth.csproj +++ b/src/csharp/Grpc.Auth/Grpc.Auth.csproj @@ -68,6 +68,9 @@ + + Version.cs + diff --git a/src/csharp/Grpc.Auth/Properties/AssemblyInfo.cs b/src/csharp/Grpc.Auth/Properties/AssemblyInfo.cs index 2cdf64359714a..70cb32d5b2bd2 100644 --- a/src/csharp/Grpc.Auth/Properties/AssemblyInfo.cs +++ b/src/csharp/Grpc.Auth/Properties/AssemblyInfo.cs @@ -9,6 +9,5 @@ [assembly: AssemblyCopyright("Google Inc. All rights reserved.")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] -[assembly: AssemblyVersion("0.6.*")] [assembly: InternalsVisibleTo("Grpc.Auth.Tests")] diff --git a/src/csharp/Grpc.Core.Tests/Grpc.Core.Tests.csproj b/src/csharp/Grpc.Core.Tests/Grpc.Core.Tests.csproj index 92e28b7d74cd2..927954c448a2c 100644 --- a/src/csharp/Grpc.Core.Tests/Grpc.Core.Tests.csproj +++ b/src/csharp/Grpc.Core.Tests/Grpc.Core.Tests.csproj @@ -37,6 +37,9 @@ + + Version.cs + @@ -63,4 +66,4 @@ - + \ No newline at end of file diff --git a/src/csharp/Grpc.Core.Tests/Properties/AssemblyInfo.cs b/src/csharp/Grpc.Core.Tests/Properties/AssemblyInfo.cs index d5fffb8b1830e..c2e5e81e911a9 100644 --- a/src/csharp/Grpc.Core.Tests/Properties/AssemblyInfo.cs +++ b/src/csharp/Grpc.Core.Tests/Properties/AssemblyInfo.cs @@ -9,4 +9,3 @@ [assembly: AssemblyCopyright("Google Inc. All rights reserved.")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] -[assembly: AssemblyVersion("0.6.*")] diff --git a/src/csharp/Grpc.Core/Grpc.Core.csproj b/src/csharp/Grpc.Core/Grpc.Core.csproj index 940143bd0a722..cde42c3b7e26f 100644 --- a/src/csharp/Grpc.Core/Grpc.Core.csproj +++ b/src/csharp/Grpc.Core/Grpc.Core.csproj @@ -49,6 +49,7 @@ + diff --git a/src/csharp/Grpc.Core/Properties/AssemblyInfo.cs b/src/csharp/Grpc.Core/Properties/AssemblyInfo.cs index c57eef65aac7c..2b3d7530f2cf0 100644 --- a/src/csharp/Grpc.Core/Properties/AssemblyInfo.cs +++ b/src/csharp/Grpc.Core/Properties/AssemblyInfo.cs @@ -9,6 +9,5 @@ [assembly: AssemblyCopyright("Google Inc. All rights reserved.")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] -[assembly: AssemblyVersion("0.6.*")] [assembly: InternalsVisibleTo("Grpc.Core.Tests")] diff --git a/src/csharp/Grpc.Core/Version.cs b/src/csharp/Grpc.Core/Version.cs new file mode 100644 index 0000000000000..972f495bd7dc0 --- /dev/null +++ b/src/csharp/Grpc.Core/Version.cs @@ -0,0 +1,6 @@ +using System.Reflection; +using System.Runtime.CompilerServices; + +// The current version of gRPC C#. +[assembly: AssemblyVersion("0.6.0.*")] + diff --git a/src/csharp/Grpc.Examples.MathClient/Grpc.Examples.MathClient.csproj b/src/csharp/Grpc.Examples.MathClient/Grpc.Examples.MathClient.csproj index 19bb4347aa8ec..5d5401593d0e1 100644 --- a/src/csharp/Grpc.Examples.MathClient/Grpc.Examples.MathClient.csproj +++ b/src/csharp/Grpc.Examples.MathClient/Grpc.Examples.MathClient.csproj @@ -1,4 +1,4 @@ - + Debug @@ -35,6 +35,9 @@ + + Version.cs + @@ -49,4 +52,4 @@ Grpc.Examples - + \ No newline at end of file diff --git a/src/csharp/Grpc.Examples.MathClient/Properties/AssemblyInfo.cs b/src/csharp/Grpc.Examples.MathClient/Properties/AssemblyInfo.cs index a57c540215c78..0fb0dbd510a86 100644 --- a/src/csharp/Grpc.Examples.MathClient/Properties/AssemblyInfo.cs +++ b/src/csharp/Grpc.Examples.MathClient/Properties/AssemblyInfo.cs @@ -9,4 +9,3 @@ [assembly: AssemblyCopyright("Google Inc. All rights reserved.")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] -[assembly: AssemblyVersion("0.6.*")] diff --git a/src/csharp/Grpc.Examples.MathServer/Grpc.Examples.MathServer.csproj b/src/csharp/Grpc.Examples.MathServer/Grpc.Examples.MathServer.csproj index ba6586ee5e23f..677d87da205d2 100644 --- a/src/csharp/Grpc.Examples.MathServer/Grpc.Examples.MathServer.csproj +++ b/src/csharp/Grpc.Examples.MathServer/Grpc.Examples.MathServer.csproj @@ -35,6 +35,9 @@ + + Version.cs + diff --git a/src/csharp/Grpc.Examples.MathServer/Properties/AssemblyInfo.cs b/src/csharp/Grpc.Examples.MathServer/Properties/AssemblyInfo.cs index 6c772cb45cf44..63035b6c63b78 100644 --- a/src/csharp/Grpc.Examples.MathServer/Properties/AssemblyInfo.cs +++ b/src/csharp/Grpc.Examples.MathServer/Properties/AssemblyInfo.cs @@ -9,4 +9,3 @@ [assembly: AssemblyCopyright("Google Inc. All rights reserved.")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] -[assembly: AssemblyVersion("0.6.*")] diff --git a/src/csharp/Grpc.Examples.Tests/Grpc.Examples.Tests.csproj b/src/csharp/Grpc.Examples.Tests/Grpc.Examples.Tests.csproj index 6e84add42baff..d59d7515d1ffb 100644 --- a/src/csharp/Grpc.Examples.Tests/Grpc.Examples.Tests.csproj +++ b/src/csharp/Grpc.Examples.Tests/Grpc.Examples.Tests.csproj @@ -43,6 +43,9 @@ + + Version.cs + diff --git a/src/csharp/Grpc.Examples.Tests/Properties/AssemblyInfo.cs b/src/csharp/Grpc.Examples.Tests/Properties/AssemblyInfo.cs index 4acaeaa438e41..846afb46164ef 100644 --- a/src/csharp/Grpc.Examples.Tests/Properties/AssemblyInfo.cs +++ b/src/csharp/Grpc.Examples.Tests/Properties/AssemblyInfo.cs @@ -9,4 +9,3 @@ [assembly: AssemblyCopyright("Google Inc. All rights reserved.")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] -[assembly: AssemblyVersion("0.6.*")] diff --git a/src/csharp/Grpc.Examples/Grpc.Examples.csproj b/src/csharp/Grpc.Examples/Grpc.Examples.csproj index 5ce490f403401..eaf24a253c096 100644 --- a/src/csharp/Grpc.Examples/Grpc.Examples.csproj +++ b/src/csharp/Grpc.Examples/Grpc.Examples.csproj @@ -40,6 +40,9 @@ + + Version.cs + diff --git a/src/csharp/Grpc.Examples/Properties/AssemblyInfo.cs b/src/csharp/Grpc.Examples/Properties/AssemblyInfo.cs index 60a7aaea137e0..92111389cb904 100644 --- a/src/csharp/Grpc.Examples/Properties/AssemblyInfo.cs +++ b/src/csharp/Grpc.Examples/Properties/AssemblyInfo.cs @@ -9,4 +9,3 @@ [assembly: AssemblyCopyright("Google Inc. All rights reserved.")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] -[assembly: AssemblyVersion("0.6.*")] diff --git a/src/csharp/Grpc.IntegrationTesting.Client/Grpc.IntegrationTesting.Client.csproj b/src/csharp/Grpc.IntegrationTesting.Client/Grpc.IntegrationTesting.Client.csproj index df05c535e2472..328acb5b47646 100644 --- a/src/csharp/Grpc.IntegrationTesting.Client/Grpc.IntegrationTesting.Client.csproj +++ b/src/csharp/Grpc.IntegrationTesting.Client/Grpc.IntegrationTesting.Client.csproj @@ -36,6 +36,9 @@ + + Version.cs + diff --git a/src/csharp/Grpc.IntegrationTesting.Client/Properties/AssemblyInfo.cs b/src/csharp/Grpc.IntegrationTesting.Client/Properties/AssemblyInfo.cs index 9a389a1e30899..f51f2796c4394 100644 --- a/src/csharp/Grpc.IntegrationTesting.Client/Properties/AssemblyInfo.cs +++ b/src/csharp/Grpc.IntegrationTesting.Client/Properties/AssemblyInfo.cs @@ -9,4 +9,3 @@ [assembly: AssemblyCopyright("Google Inc. All rights reserved.")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] -[assembly: AssemblyVersion("0.6.*")] diff --git a/src/csharp/Grpc.IntegrationTesting.Server/Grpc.IntegrationTesting.Server.csproj b/src/csharp/Grpc.IntegrationTesting.Server/Grpc.IntegrationTesting.Server.csproj index 235897c888e6e..ae184c1dc7e7f 100644 --- a/src/csharp/Grpc.IntegrationTesting.Server/Grpc.IntegrationTesting.Server.csproj +++ b/src/csharp/Grpc.IntegrationTesting.Server/Grpc.IntegrationTesting.Server.csproj @@ -36,6 +36,9 @@ + + Version.cs + diff --git a/src/csharp/Grpc.IntegrationTesting.Server/Properties/AssemblyInfo.cs b/src/csharp/Grpc.IntegrationTesting.Server/Properties/AssemblyInfo.cs index ff31035d5346e..f68d9a3ddcc5b 100644 --- a/src/csharp/Grpc.IntegrationTesting.Server/Properties/AssemblyInfo.cs +++ b/src/csharp/Grpc.IntegrationTesting.Server/Properties/AssemblyInfo.cs @@ -9,4 +9,3 @@ [assembly: AssemblyCopyright("Google Inc. All rights reserved.")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] -[assembly: AssemblyVersion("0.6.*")] diff --git a/src/csharp/Grpc.IntegrationTesting/Grpc.IntegrationTesting.csproj b/src/csharp/Grpc.IntegrationTesting/Grpc.IntegrationTesting.csproj index a6d847ca653d5..af4a75a034bff 100644 --- a/src/csharp/Grpc.IntegrationTesting/Grpc.IntegrationTesting.csproj +++ b/src/csharp/Grpc.IntegrationTesting/Grpc.IntegrationTesting.csproj @@ -75,6 +75,9 @@ + + Version.cs + diff --git a/src/csharp/Grpc.IntegrationTesting/Properties/AssemblyInfo.cs b/src/csharp/Grpc.IntegrationTesting/Properties/AssemblyInfo.cs index 7134b04892d29..1beb0bbb413c0 100644 --- a/src/csharp/Grpc.IntegrationTesting/Properties/AssemblyInfo.cs +++ b/src/csharp/Grpc.IntegrationTesting/Properties/AssemblyInfo.cs @@ -9,4 +9,3 @@ [assembly: AssemblyCopyright("Google Inc. All rights reserved.")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] -[assembly: AssemblyVersion("0.6.*")] From c0d4b6bfd2b97dc46b4870689fa97edd428f37fb Mon Sep 17 00:00:00 2001 From: Jan Tattermusch Date: Mon, 13 Jul 2015 21:53:32 -0700 Subject: [PATCH 7/9] make build_packages.bat provide version of grpc.native.csharp_ext dependency --- src/csharp/Grpc.Core/Grpc.Core.nuspec | 2 +- src/csharp/build_packages.bat | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/csharp/Grpc.Core/Grpc.Core.nuspec b/src/csharp/Grpc.Core/Grpc.Core.nuspec index 94854c8fbebd5..5ace6dcf8942d 100644 --- a/src/csharp/Grpc.Core/Grpc.Core.nuspec +++ b/src/csharp/Grpc.Core/Grpc.Core.nuspec @@ -17,7 +17,7 @@ - + diff --git a/src/csharp/build_packages.bat b/src/csharp/build_packages.bat index 1a99e0302f949..6061d05a32e34 100644 --- a/src/csharp/build_packages.bat +++ b/src/csharp/build_packages.bat @@ -16,7 +16,7 @@ endlocal %NUGET% pack ..\..\vsprojects\nuget_package\grpc.native.csharp_ext.nuspec -Version %CORE_VERSION% || goto :error %NUGET% pack Grpc.Auth\Grpc.Auth.nuspec -Symbols -Version %VERSION% || goto :error -%NUGET% pack Grpc.Core\Grpc.Core.nuspec -Symbols -Version %VERSION% || goto :error +%NUGET% pack Grpc.Core\Grpc.Core.nuspec -Symbols -Version %VERSION% -Properties GrpcNativeCsharpExtVersion=%CORE_VERSION% || goto :error %NUGET% pack Grpc.Tools.nuspec -Version %VERSION% || goto :error %NUGET% pack Grpc.nuspec -Version %VERSION% || goto :error From d65b34e71702b4fceb9ae9598faeb6c1c7db491d Mon Sep 17 00:00:00 2001 From: Jan Tattermusch Date: Thu, 30 Jul 2015 17:22:10 -0700 Subject: [PATCH 8/9] bump C# version to 0.6.1 and core version to 0.10.1 --- Makefile | 2 +- build.json | 2 +- src/csharp/Grpc.Core/Version.cs | 2 +- src/csharp/build_packages.bat | 4 ++-- tools/doxygen/Doxyfile.c++ | 2 +- tools/doxygen/Doxyfile.c++.internal | 2 +- tools/doxygen/Doxyfile.core | 2 +- tools/doxygen/Doxyfile.core.internal | 2 +- 8 files changed, 9 insertions(+), 9 deletions(-) diff --git a/Makefile b/Makefile index 08171320d4460..5ae7f2754a159 100644 --- a/Makefile +++ b/Makefile @@ -313,7 +313,7 @@ E = @echo Q = @ endif -VERSION = 0.10.0.0 +VERSION = 0.10.1.0 CPPFLAGS_NO_ARCH += $(addprefix -I, $(INCLUDES)) $(addprefix -D, $(DEFINES)) CPPFLAGS += $(CPPFLAGS_NO_ARCH) $(ARCH_FLAGS) diff --git a/build.json b/build.json index 7d2242b116e86..41bbdc562efdd 100644 --- a/build.json +++ b/build.json @@ -7,7 +7,7 @@ "version": { "major": 0, "minor": 10, - "micro": 0, + "micro": 1, "build": 0 } }, diff --git a/src/csharp/Grpc.Core/Version.cs b/src/csharp/Grpc.Core/Version.cs index 972f495bd7dc0..b3d8cf12c557f 100644 --- a/src/csharp/Grpc.Core/Version.cs +++ b/src/csharp/Grpc.Core/Version.cs @@ -2,5 +2,5 @@ using System.Runtime.CompilerServices; // The current version of gRPC C#. -[assembly: AssemblyVersion("0.6.0.*")] +[assembly: AssemblyVersion("0.6.1.*")] diff --git a/src/csharp/build_packages.bat b/src/csharp/build_packages.bat index 6061d05a32e34..5f2827721381f 100644 --- a/src/csharp/build_packages.bat +++ b/src/csharp/build_packages.bat @@ -1,8 +1,8 @@ @rem Builds gRPC NuGet packages @rem Current package versions -set VERSION=0.6.0 -set CORE_VERSION=0.10.0 +set VERSION=0.6.1 +set CORE_VERSION=0.10.1 @rem Adjust the location of nuget.exe set NUGET=C:\nuget\nuget.exe diff --git a/tools/doxygen/Doxyfile.c++ b/tools/doxygen/Doxyfile.c++ index feb7ad8bb93bf..40ca8abc63172 100644 --- a/tools/doxygen/Doxyfile.c++ +++ b/tools/doxygen/Doxyfile.c++ @@ -40,7 +40,7 @@ PROJECT_NAME = "GRPC C++" # could be handy for archiving the generated documentation or if some version # control system is used. -PROJECT_NUMBER = 0.10.0.0 +PROJECT_NUMBER = 0.10.1.0 # Using the PROJECT_BRIEF tag one can provide an optional one line description # for a project that appears at the top of each page and should give viewer a diff --git a/tools/doxygen/Doxyfile.c++.internal b/tools/doxygen/Doxyfile.c++.internal index 67718d8976f10..a50cf4f93d2a8 100644 --- a/tools/doxygen/Doxyfile.c++.internal +++ b/tools/doxygen/Doxyfile.c++.internal @@ -40,7 +40,7 @@ PROJECT_NAME = "GRPC C++" # could be handy for archiving the generated documentation or if some version # control system is used. -PROJECT_NUMBER = 0.10.0.0 +PROJECT_NUMBER = 0.10.1.0 # Using the PROJECT_BRIEF tag one can provide an optional one line description # for a project that appears at the top of each page and should give viewer a diff --git a/tools/doxygen/Doxyfile.core b/tools/doxygen/Doxyfile.core index 1bfd78752897d..38107b392e1fd 100644 --- a/tools/doxygen/Doxyfile.core +++ b/tools/doxygen/Doxyfile.core @@ -40,7 +40,7 @@ PROJECT_NAME = "GRPC Core" # could be handy for archiving the generated documentation or if some version # control system is used. -PROJECT_NUMBER = 0.10.0.0 +PROJECT_NUMBER = 0.10.1.0 # Using the PROJECT_BRIEF tag one can provide an optional one line description # for a project that appears at the top of each page and should give viewer a diff --git a/tools/doxygen/Doxyfile.core.internal b/tools/doxygen/Doxyfile.core.internal index ac411e3c02dc3..bfe4c54b2d419 100644 --- a/tools/doxygen/Doxyfile.core.internal +++ b/tools/doxygen/Doxyfile.core.internal @@ -40,7 +40,7 @@ PROJECT_NAME = "GRPC Core" # could be handy for archiving the generated documentation or if some version # control system is used. -PROJECT_NUMBER = 0.10.0.0 +PROJECT_NUMBER = 0.10.1.0 # Using the PROJECT_BRIEF tag one can provide an optional one line description # for a project that appears at the top of each page and should give viewer a From f90528efbd2d29006737e6bd4ff82cfaac912ffe Mon Sep 17 00:00:00 2001 From: Jan Tattermusch Date: Thu, 30 Jul 2015 18:15:44 -0700 Subject: [PATCH 9/9] fix build under VS2010 --- src/core/iomgr/tcp_server_windows.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/core/iomgr/tcp_server_windows.c b/src/core/iomgr/tcp_server_windows.c index 92e512e8d0798..9ef1ff4d9a869 100644 --- a/src/core/iomgr/tcp_server_windows.c +++ b/src/core/iomgr/tcp_server_windows.c @@ -242,6 +242,9 @@ static void start_accept(server_port *port) { /* Event manager callback when reads are ready. */ static void on_accept(void *arg, int from_iocp) { + DWORD transfered_bytes = 0; + DWORD flags; + BOOL wsa_success; server_port *sp = arg; SOCKET sock = sp->new_socket; grpc_winsocket_callback_info *info = &sp->socket->read_info; @@ -262,9 +265,8 @@ static void on_accept(void *arg, int from_iocp) { /* The IOCP notified us of a completed operation. Let's grab the results, and act accordingly. */ - DWORD transfered_bytes = 0; - DWORD flags; - BOOL wsa_success = WSAGetOverlappedResult(sock, &info->overlapped, + transfered_bytes = 0; + wsa_success = WSAGetOverlappedResult(sock, &info->overlapped, &transfered_bytes, FALSE, &flags); if (!wsa_success) { if (sp->shutting_down) {