From e339f6feecf943c282ccc5efe4500a7d3d4b660a Mon Sep 17 00:00:00 2001 From: murgatroid99 Date: Wed, 23 Sep 2015 11:38:39 -0700 Subject: [PATCH 01/79] Fixed hang when using Node gRPC with other async operations --- src/node/ext/completion_queue_async_worker.cc | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/src/node/ext/completion_queue_async_worker.cc b/src/node/ext/completion_queue_async_worker.cc index bf2cd946a5c..efc611b8b78 100644 --- a/src/node/ext/completion_queue_async_worker.cc +++ b/src/node/ext/completion_queue_async_worker.cc @@ -53,6 +53,9 @@ using v8::Value; grpc_completion_queue *CompletionQueueAsyncWorker::queue; +// Invariants: current_threads <= max_queue_threads +// (current_threads == max_queue_threads) || (waiting_next_calls == 0) + int CompletionQueueAsyncWorker::current_threads; int CompletionQueueAsyncWorker::waiting_next_calls; @@ -74,11 +77,15 @@ grpc_completion_queue *CompletionQueueAsyncWorker::GetQueue() { return queue; } void CompletionQueueAsyncWorker::Next() { NanScope(); if (current_threads < max_queue_threads) { + current_threads += 1; CompletionQueueAsyncWorker *worker = new CompletionQueueAsyncWorker(); NanAsyncQueueWorker(worker); } else { waiting_next_calls += 1; } + GPR_ASSERT(current_threads <= max_queue_threads); + GPR_ASSERT((current_threads == max_queue_threads) || + (waiting_next_calls == 0)); } void CompletionQueueAsyncWorker::Init(Handle exports) { @@ -92,11 +99,15 @@ void CompletionQueueAsyncWorker::HandleOKCallback() { NanScope(); if (waiting_next_calls > 0) { waiting_next_calls -= 1; + // Old worker removed, new worker added. current_threads += 0 CompletionQueueAsyncWorker *worker = new CompletionQueueAsyncWorker(); NanAsyncQueueWorker(worker); } else { current_threads -= 1; } + GPR_ASSERT(current_threads <= max_queue_threads); + GPR_ASSERT((current_threads == max_queue_threads) || + (waiting_next_calls == 0)); NanCallback *callback = GetTagCallback(result.tag); Handle argv[] = {NanNull(), GetTagNodeValue(result.tag)}; callback->Call(2, argv); @@ -106,6 +117,17 @@ void CompletionQueueAsyncWorker::HandleOKCallback() { void CompletionQueueAsyncWorker::HandleErrorCallback() { NanScope(); + if (waiting_next_calls > 0) { + waiting_next_calls -= 1; + // Old worker removed, new worker added. current_threads += 0 + CompletionQueueAsyncWorker *worker = new CompletionQueueAsyncWorker(); + NanAsyncQueueWorker(worker); + } else { + current_threads -= 1; + } + GPR_ASSERT(current_threads <= max_queue_threads); + GPR_ASSERT((current_threads == max_queue_threads) || + (waiting_next_calls == 0)); NanCallback *callback = GetTagCallback(result.tag); Handle argv[] = {NanError(ErrorMessage())}; From ad88f57ae9e43b1d5bcbb53e3baeefff6447121f Mon Sep 17 00:00:00 2001 From: Jan Tattermusch Date: Wed, 23 Sep 2015 12:23:04 -0700 Subject: [PATCH 02/79] update C# examples to 0.7.1 --- examples/csharp/helloworld/.nuget/packages.config | 2 +- examples/csharp/helloworld/Greeter/Greeter.csproj | 14 +++++++------- examples/csharp/helloworld/Greeter/packages.config | 6 +++--- .../helloworld/GreeterClient/GreeterClient.csproj | 14 +++++++------- .../helloworld/GreeterClient/packages.config | 6 +++--- .../helloworld/GreeterServer/GreeterServer.csproj | 14 +++++++------- .../helloworld/GreeterServer/packages.config | 6 +++--- examples/csharp/route_guide/.nuget/packages.config | 2 +- .../route_guide/RouteGuide/RouteGuide.csproj | 14 +++++++------- .../csharp/route_guide/RouteGuide/packages.config | 6 +++--- .../RouteGuideClient/RouteGuideClient.csproj | 14 +++++++------- .../route_guide/RouteGuideClient/packages.config | 6 +++--- .../RouteGuideServer/RouteGuideServer.csproj | 14 +++++++------- .../route_guide/RouteGuideServer/packages.config | 6 +++--- 14 files changed, 62 insertions(+), 62 deletions(-) diff --git a/examples/csharp/helloworld/.nuget/packages.config b/examples/csharp/helloworld/.nuget/packages.config index e2879c18932..1c1f118d466 100644 --- a/examples/csharp/helloworld/.nuget/packages.config +++ b/examples/csharp/helloworld/.nuget/packages.config @@ -1,4 +1,4 @@  - + \ No newline at end of file diff --git a/examples/csharp/helloworld/Greeter/Greeter.csproj b/examples/csharp/helloworld/Greeter/Greeter.csproj index 3d92c4bf25a..2ae8620267f 100644 --- a/examples/csharp/helloworld/Greeter/Greeter.csproj +++ b/examples/csharp/helloworld/Greeter/Greeter.csproj @@ -1,6 +1,6 @@  - + @@ -13,7 +13,7 @@ Greeter Greeter v4.5 - 3ef64a6a + e423e365 true @@ -37,9 +37,9 @@ ..\packages\Google.Protobuf.3.0.0-alpha4\lib\portable-net45+netcore45+wpa81+wp8\Google.Protobuf.dll - + False - ..\packages\Grpc.Core.0.7.0\lib\net45\Grpc.Core.dll + ..\packages\Grpc.Core.0.7.1\lib\net45\Grpc.Core.dll @@ -65,10 +65,10 @@ - - + + - + \ No newline at end of file diff --git a/examples/csharp/helloworld/Greeter/packages.config b/examples/csharp/helloworld/Greeter/packages.config index 1273624cbd0..c0f73879160 100644 --- a/examples/csharp/helloworld/Greeter/packages.config +++ b/examples/csharp/helloworld/Greeter/packages.config @@ -1,10 +1,10 @@  - - + + - + \ No newline at end of file diff --git a/examples/csharp/helloworld/GreeterClient/GreeterClient.csproj b/examples/csharp/helloworld/GreeterClient/GreeterClient.csproj index 7874172bf26..af330f2b905 100644 --- a/examples/csharp/helloworld/GreeterClient/GreeterClient.csproj +++ b/examples/csharp/helloworld/GreeterClient/GreeterClient.csproj @@ -1,6 +1,6 @@  - + @@ -13,7 +13,7 @@ GreeterClient GreeterClient v4.5 - c4057b0a + 2dcf22af true @@ -37,9 +37,9 @@ ..\packages\Google.Protobuf.3.0.0-alpha4\lib\portable-net45+netcore45+wpa81+wp8\Google.Protobuf.dll - + False - ..\packages\Grpc.Core.0.7.0\lib\net45\Grpc.Core.dll + ..\packages\Grpc.Core.0.7.1\lib\net45\Grpc.Core.dll @@ -68,10 +68,10 @@ - - + + - + \ No newline at end of file diff --git a/examples/csharp/helloworld/GreeterClient/packages.config b/examples/csharp/helloworld/GreeterClient/packages.config index 1273624cbd0..c0f73879160 100644 --- a/examples/csharp/helloworld/GreeterClient/packages.config +++ b/examples/csharp/helloworld/GreeterClient/packages.config @@ -1,10 +1,10 @@  - - + + - + \ No newline at end of file diff --git a/examples/csharp/helloworld/GreeterServer/GreeterServer.csproj b/examples/csharp/helloworld/GreeterServer/GreeterServer.csproj index d1db2f4773b..752f32828b0 100644 --- a/examples/csharp/helloworld/GreeterServer/GreeterServer.csproj +++ b/examples/csharp/helloworld/GreeterServer/GreeterServer.csproj @@ -1,6 +1,6 @@  - + @@ -13,7 +13,7 @@ GreeterServer GreeterServer v4.5 - cc15afe5 + 53a3a588 true @@ -37,9 +37,9 @@ ..\packages\Google.Protobuf.3.0.0-alpha4\lib\portable-net45+netcore45+wpa81+wp8\Google.Protobuf.dll - + False - ..\packages\Grpc.Core.0.7.0\lib\net45\Grpc.Core.dll + ..\packages\Grpc.Core.0.7.1\lib\net45\Grpc.Core.dll @@ -68,10 +68,10 @@ - - + + - + \ No newline at end of file diff --git a/examples/csharp/helloworld/GreeterServer/packages.config b/examples/csharp/helloworld/GreeterServer/packages.config index 1273624cbd0..c0f73879160 100644 --- a/examples/csharp/helloworld/GreeterServer/packages.config +++ b/examples/csharp/helloworld/GreeterServer/packages.config @@ -1,10 +1,10 @@  - - + + - + \ No newline at end of file diff --git a/examples/csharp/route_guide/.nuget/packages.config b/examples/csharp/route_guide/.nuget/packages.config index e2879c18932..1c1f118d466 100644 --- a/examples/csharp/route_guide/.nuget/packages.config +++ b/examples/csharp/route_guide/.nuget/packages.config @@ -1,4 +1,4 @@  - + \ No newline at end of file diff --git a/examples/csharp/route_guide/RouteGuide/RouteGuide.csproj b/examples/csharp/route_guide/RouteGuide/RouteGuide.csproj index 302a783aa46..f3342229d42 100644 --- a/examples/csharp/route_guide/RouteGuide/RouteGuide.csproj +++ b/examples/csharp/route_guide/RouteGuide/RouteGuide.csproj @@ -1,6 +1,6 @@  - + @@ -14,7 +14,7 @@ RouteGuide v4.5 512 - 443bbc38 + 256a7eeb true @@ -37,9 +37,9 @@ ..\packages\Google.Protobuf.3.0.0-alpha4\lib\portable-net45+netcore45+wpa81+wp8\Google.Protobuf.dll - + False - ..\packages\Grpc.Core.0.7.0\lib\net45\Grpc.Core.dll + ..\packages\Grpc.Core.0.7.1\lib\net45\Grpc.Core.dll False @@ -77,12 +77,12 @@ - - + + - + + true + + + v120 + Win32 + Debug + cdecl + + \ No newline at end of file diff --git a/vsprojects/copkg/zlib/managed_targets/grpc.dependencies.zlib.redist.targets b/vsprojects/copkg/zlib/managed_targets/grpc.dependencies.zlib.redist.targets new file mode 100644 index 00000000000..f00d97dc361 --- /dev/null +++ b/vsprojects/copkg/zlib/managed_targets/grpc.dependencies.zlib.redist.targets @@ -0,0 +1,14 @@ + + + + + + + + PreserveNewest + + + + + + \ No newline at end of file diff --git a/vsprojects/copkg/zlib/version.inc b/vsprojects/copkg/zlib/version.inc new file mode 100644 index 00000000000..1f893a49514 --- /dev/null +++ b/vsprojects/copkg/zlib/version.inc @@ -0,0 +1 @@ +#define { package-version : 1.2.8.9; } diff --git a/vsprojects/copkg/zlib/zlib.sln b/vsprojects/copkg/zlib/zlib.sln new file mode 100644 index 00000000000..7c38e6e1215 --- /dev/null +++ b/vsprojects/copkg/zlib/zlib.sln @@ -0,0 +1,26 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 2012 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "zlib", "zlib.vcxproj", "{63BED288-E8C3-4345-B84D-2E64598DCF3A}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Win32 = Debug|Win32 + Release|Win32 = Release|Win32 + Debug|x64 = Debug|x64 + Release|x64 = Release|x64 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {63BED288-E8C3-4345-B84D-2E64598DCF3A}.Debug|Win32.ActiveCfg = Debug|Win32 + {63BED288-E8C3-4345-B84D-2E64598DCF3A}.Debug|Win32.Build.0 = Debug|Win32 + {63BED288-E8C3-4345-B84D-2E64598DCF3A}.Release|Win32.ActiveCfg = Release|Win32 + {63BED288-E8C3-4345-B84D-2E64598DCF3A}.Release|Win32.Build.0 = Release|Win32 + {63BED288-E8C3-4345-B84D-2E64598DCF3A}.Debug|x64.ActiveCfg = Debug|x64 + {63BED288-E8C3-4345-B84D-2E64598DCF3A}.Debug|x64.Build.0 = Debug|x64 + {63BED288-E8C3-4345-B84D-2E64598DCF3A}.Release|x64.ActiveCfg = Release|x64 + {63BED288-E8C3-4345-B84D-2E64598DCF3A}.Release|x64.Build.0 = Release|x64 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/vsprojects/copkg/zlib/zlib.vcxproj b/vsprojects/copkg/zlib/zlib.vcxproj new file mode 100644 index 00000000000..0a60fe53937 --- /dev/null +++ b/vsprojects/copkg/zlib/zlib.vcxproj @@ -0,0 +1,155 @@ + + + + $(registry:HKEY_LOCAL_MACHINE\Software\Outercurve\CoApp.Powershell\etc) + + + false + + + + + v110 + + + + + + + + {63BED288-E8C3-4345-B84D-2E64598DCF3A} + $(MSBuildProjectName) + + 1 + + + DynamicLibrary + + + _CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS; + $(Defines);ZLIB_WINAPI; + $(Defines);ZLIB_DLL; + $(Defines);IOWIN32_USING_WINRT_API=1; + $(Defines);IOWIN32_USING_WINRT_API=0; + $(Defines);ASMV;ASMINF; + $(Defines);WIN64; + + + ..\..; + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + $(ProjectRootDir)Output/$(PlatformToolset)/$(Platform)/$(Configuration)/$(UsesConfigurationType)/$(CallingConvention)/$(CharacterSet)/$(AppContainer)/$(UseASM)/ + $(ProjectRootDir)Intermediate/$(TargetName)/$(PlatformToolset)/$(Platform)/$(Configuration)/$(UsesConfigurationType)/$(CallingConvention)/$(CharacterSet)/$(AppContainer)/$(UseASM)/ + + + + + true + + + 0x5A4C0000 + + + + + + $(IntDir)gvmat64.lst + Build + $(IntDir)gvmat64.obj + + + $(IntDir)inffasx64.lst + Build + $(IntDir)inffasx64.obj + + + $(IntDir)inffas32.lst + Build + true + /coff %(AdditionalOptions) + $(IntDir)inffas32.obj + + + $(IntDir)match686.lst + Build + true + /coff %(AdditionalOptions) + $(IntDir)match686.obj + + + + + + + + + + + + + + + + + + + + + + + + + ZLIB_INTERNAL;%(PreprocessorDefinitions) + + + ZLIB_INTERNAL;%(PreprocessorDefinitions) + + + + + + + + + + + + + From 18e2202fb568d8488e1e63eb6f9bd22baca012b3 Mon Sep 17 00:00:00 2001 From: Jan Tattermusch Date: Mon, 28 Sep 2015 17:20:03 -0700 Subject: [PATCH 38/79] customize the coapp scripts for zlib --- vsprojects/{copkg => coapp}/zlib/README.md | 0 vsprojects/{copkg => coapp}/zlib/buildall.bat | 0 .../zlib/grpc.dependencies.zlib.autopkg | 62 +++++++++---------- .../grpc.dependencies.zlib.redist.props | 0 .../grpc.dependencies.zlib.redist.targets | 0 vsprojects/{copkg => coapp}/zlib/version.inc | 0 vsprojects/{copkg => coapp}/zlib/zlib.sln | 0 vsprojects/{copkg => coapp}/zlib/zlib.vcxproj | 56 +++++++---------- 8 files changed, 53 insertions(+), 65 deletions(-) rename vsprojects/{copkg => coapp}/zlib/README.md (100%) rename vsprojects/{copkg => coapp}/zlib/buildall.bat (100%) rename vsprojects/{copkg => coapp}/zlib/grpc.dependencies.zlib.autopkg (57%) rename vsprojects/{copkg => coapp}/zlib/managed_targets/grpc.dependencies.zlib.redist.props (100%) rename vsprojects/{copkg => coapp}/zlib/managed_targets/grpc.dependencies.zlib.redist.targets (100%) rename vsprojects/{copkg => coapp}/zlib/version.inc (100%) rename vsprojects/{copkg => coapp}/zlib/zlib.sln (100%) rename vsprojects/{copkg => coapp}/zlib/zlib.vcxproj (75%) diff --git a/vsprojects/copkg/zlib/README.md b/vsprojects/coapp/zlib/README.md similarity index 100% rename from vsprojects/copkg/zlib/README.md rename to vsprojects/coapp/zlib/README.md diff --git a/vsprojects/copkg/zlib/buildall.bat b/vsprojects/coapp/zlib/buildall.bat similarity index 100% rename from vsprojects/copkg/zlib/buildall.bat rename to vsprojects/coapp/zlib/buildall.bat diff --git a/vsprojects/copkg/zlib/grpc.dependencies.zlib.autopkg b/vsprojects/coapp/zlib/grpc.dependencies.zlib.autopkg similarity index 57% rename from vsprojects/copkg/zlib/grpc.dependencies.zlib.autopkg rename to vsprojects/coapp/zlib/grpc.dependencies.zlib.autopkg index 015103ba2f0..01390b94346 100644 --- a/vsprojects/copkg/zlib/grpc.dependencies.zlib.autopkg +++ b/vsprojects/coapp/zlib/grpc.dependencies.zlib.autopkg @@ -41,42 +41,38 @@ nuget { "managed_targets\${package-id}.redist.targets"; }; - include: { ..\..\zlib.h, ..\..\zconf.h }; + include: { ..\..\..\third_party\zlib\zlib.h, ..\..\..\third_party\zlib\zconf.h }; - docs: { ..\..\doc\**\* }; + docs: { ..\..\..\third_party\zlib\doc\**\* }; source += { - "..\..\adler32.c", - "..\..\compress.c", - "..\..\crc32.c", - "..\..\deflate.c", - "..\..\gzclose.c", - "..\..\gzlib.c", - "..\..\gzread.c", - "..\..\gzwrite.c", - "..\..\infback.c", - "..\..\inffast.c", - "..\..\inflate.c", - "..\..\inftrees.c", - "..\..\trees.c", - "..\..\uncompr.c", - "..\..\zutil.c", - "..\..\crc32.h", - "..\..\deflate.h", - "..\..\gzguts.h", - "..\..\inffast.h", - "..\..\inffixed.h", - "..\..\inflate.h", - "..\..\inftrees.h", - "..\..\trees.h", - "..\..\zconf.h", - "..\..\zlib.h", - "..\..\zutil.h", - "..\masmx64\inffas8664.c", - "..\minizip\ioapi.c", - "..\minizip\iowin32.c", - "..\minizip\unzip.c", - "..\minizip\zip.c", + "..\..\..\third_party\zlib\adler32.c", + "..\..\..\third_party\zlib\compress.c", + "..\..\..\third_party\zlib\crc32.c", + "..\..\..\third_party\zlib\deflate.c", + "..\..\..\third_party\zlib\gzclose.c", + "..\..\..\third_party\zlib\gzlib.c", + "..\..\..\third_party\zlib\gzread.c", + "..\..\..\third_party\zlib\gzwrite.c", + "..\..\..\third_party\zlib\infback.c", + "..\..\..\third_party\zlib\inffast.c", + "..\..\..\third_party\zlib\inflate.c", + "..\..\..\third_party\zlib\inftrees.c", + "..\..\..\third_party\zlib\trees.c", + "..\..\..\third_party\zlib\uncompr.c", + "..\..\..\third_party\zlib\zutil.c", + "..\..\..\third_party\zlib\crc32.h", + "..\..\..\third_party\zlib\deflate.h", + "..\..\..\third_party\zlib\gzguts.h", + "..\..\..\third_party\zlib\inffast.h", + "..\..\..\third_party\zlib\inffixed.h", + "..\..\..\third_party\zlib\inflate.h", + "..\..\..\third_party\zlib\inftrees.h", + "..\..\..\third_party\zlib\trees.h", + "..\..\..\third_party\zlib\zconf.h", + "..\..\..\third_party\zlib\zlib.h", + "..\..\..\third_party\zlib\zutil.h", + "..\..\..\third_party\zlib\contrib\masmx64\inffas8664.c", }; ("v100,v120", "Win32,x64", "Release,Debug", "Dynamic", "cdecl,stdcall", "MultiByte") => { [${0},${1},${2},${3},${4}] { diff --git a/vsprojects/copkg/zlib/managed_targets/grpc.dependencies.zlib.redist.props b/vsprojects/coapp/zlib/managed_targets/grpc.dependencies.zlib.redist.props similarity index 100% rename from vsprojects/copkg/zlib/managed_targets/grpc.dependencies.zlib.redist.props rename to vsprojects/coapp/zlib/managed_targets/grpc.dependencies.zlib.redist.props diff --git a/vsprojects/copkg/zlib/managed_targets/grpc.dependencies.zlib.redist.targets b/vsprojects/coapp/zlib/managed_targets/grpc.dependencies.zlib.redist.targets similarity index 100% rename from vsprojects/copkg/zlib/managed_targets/grpc.dependencies.zlib.redist.targets rename to vsprojects/coapp/zlib/managed_targets/grpc.dependencies.zlib.redist.targets diff --git a/vsprojects/copkg/zlib/version.inc b/vsprojects/coapp/zlib/version.inc similarity index 100% rename from vsprojects/copkg/zlib/version.inc rename to vsprojects/coapp/zlib/version.inc diff --git a/vsprojects/copkg/zlib/zlib.sln b/vsprojects/coapp/zlib/zlib.sln similarity index 100% rename from vsprojects/copkg/zlib/zlib.sln rename to vsprojects/coapp/zlib/zlib.sln diff --git a/vsprojects/copkg/zlib/zlib.vcxproj b/vsprojects/coapp/zlib/zlib.vcxproj similarity index 75% rename from vsprojects/copkg/zlib/zlib.vcxproj rename to vsprojects/coapp/zlib/zlib.vcxproj index 0a60fe53937..56df39a2483 100644 --- a/vsprojects/copkg/zlib/zlib.vcxproj +++ b/vsprojects/coapp/zlib/zlib.vcxproj @@ -8,8 +8,8 @@ - - v110 + + v120 @@ -35,7 +35,7 @@ $(Defines);WIN64; - ..\..; + ..\..\..\third_party\zlib; @@ -89,24 +89,24 @@ - + $(IntDir)gvmat64.lst Build $(IntDir)gvmat64.obj - + $(IntDir)inffasx64.lst Build $(IntDir)inffasx64.obj - + $(IntDir)inffas32.lst Build true /coff %(AdditionalOptions) $(IntDir)inffas32.obj - + $(IntDir)match686.lst Build true @@ -118,36 +118,28 @@ - - - - - - - - - - - - - - - - - - - ZLIB_INTERNAL;%(PreprocessorDefinitions) - - - ZLIB_INTERNAL;%(PreprocessorDefinitions) - - + + + + + + + + + + + + + + + + - + From 191b79cf53edbb2537967860257d3b28453dd7c8 Mon Sep 17 00:00:00 2001 From: Craig Tiller Date: Wed, 30 Sep 2015 10:49:58 -0700 Subject: [PATCH 39/79] Add comment --- src/core/iomgr/pollset_posix.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/core/iomgr/pollset_posix.c b/src/core/iomgr/pollset_posix.c index f4e4ce60457..82a82cc0644 100644 --- a/src/core/iomgr/pollset_posix.c +++ b/src/core/iomgr/pollset_posix.c @@ -57,7 +57,14 @@ GPR_TLS_DECL(g_current_thread_poller); GPR_TLS_DECL(g_current_thread_worker); +/** Default poll() function - a pointer so that it can be overridden by some + * tests */ grpc_poll_function_type grpc_poll_function = poll; + +/** The alarm system needs to be able to wakeup 'some poller' sometimes + * (specifically when a new alarm needs to be triggered earlier than the next + * alarm 'epoch'). + * This wakeup_fd gives us something to alert on when such a case occurs. */ grpc_wakeup_fd grpc_global_wakeup_fd; static void remove_worker(grpc_pollset *p, grpc_pollset_worker *worker) { From d7d8337df091c90fed6066a28059ae88a910ce52 Mon Sep 17 00:00:00 2001 From: murgatroid99 Date: Wed, 30 Sep 2015 11:00:23 -0700 Subject: [PATCH 40/79] Added code for extension coverage --- src/node/.istanbul.yml | 6 ++++++ src/node/binding.gyp | 15 +++++++++++++++ src/node/package.json | 6 ++++-- tools/run_tests/run_node.sh | 15 ++++++++++++++- 4 files changed, 39 insertions(+), 3 deletions(-) create mode 100644 src/node/.istanbul.yml diff --git a/src/node/.istanbul.yml b/src/node/.istanbul.yml new file mode 100644 index 00000000000..9ff1379f511 --- /dev/null +++ b/src/node/.istanbul.yml @@ -0,0 +1,6 @@ +reporting: + watermarks: + statements: [80, 95] + lines: [80, 95] + functions: [80, 95] + branches: [80, 95] diff --git a/src/node/binding.gyp b/src/node/binding.gyp index a6440309324..247719e9813 100644 --- a/src/node/binding.gyp +++ b/src/node/binding.gyp @@ -1,4 +1,7 @@ { + "variables" : { + 'config': '/dev/null 2>&1 && echo true || echo false)' }, 'conditions': [ + ['config=="gcov"', { + 'cflags': [ + '-ftest-coverage', + '-fprofile-arcs', + '-O0' + ], + 'ldflags': [ + '-ftest-coverage', + '-fprofile-arcs' + ] + } + ], ['pkg_config_grpc == "true"', { 'link_settings': { 'libraries': [ diff --git a/src/node/package.json b/src/node/package.json index 22f94757ce6..0a5528781db 100644 --- a/src/node/package.json +++ b/src/node/package.json @@ -21,8 +21,9 @@ }, "scripts": { "lint": "node ./node_modules/jshint/bin/jshint src test examples interop index.js", - "test": "node ./node_modules/mocha/bin/mocha && npm run-script lint", - "gen_docs": "./node_modules/.bin/jsdoc -c jsdoc_conf.json" + "test": "./node_modules/.bin/mocha && npm run-script lint", + "gen_docs": "./node_modules/.bin/jsdoc -c jsdoc_conf.json", + "coverage": "./node_modules/.bin/istanbul cover ./node_modules/.bin/_mocha" }, "dependencies": { "bindings": "^1.2.0", @@ -33,6 +34,7 @@ "devDependencies": { "async": "^0.9.0", "google-auth-library": "^0.9.2", + "istanbul": "^0.3.21", "jsdoc": "^3.3.2", "jshint": "^2.5.0", "minimist": "^1.1.0", diff --git a/tools/run_tests/run_node.sh b/tools/run_tests/run_node.sh index bcd93ed2262..1043b447db3 100755 --- a/tools/run_tests/run_node.sh +++ b/tools/run_tests/run_node.sh @@ -37,6 +37,19 @@ cd $(dirname $0)/../.. root=`pwd` +cd $root/src/node + export LD_LIBRARY_PATH=$root/libs/$CONFIG -$root/src/node/node_modules/mocha/bin/mocha --timeout 8000 $root/src/node/test +if [ "$CONFIG" = "gcov" ] +then + ./node_modules/.bin/istanbul cover ./node_modules/.bin/_mocha -- \ + --timeout 8000 + cd build + gcov Release/obj.target/grpc/ext/*.o + lcov --base-directory . --directory . -c -o coverage.info + genhtml -o ../ext_coverage --num-spaces 2 -t 'Node gRPC test coverage' \ + coverage.info +else + ./node_modules/mocha/bin/mocha --timeout 8000 +fi From 404cf028e58cfe7f367532be6428901db40b78e4 Mon Sep 17 00:00:00 2001 From: David Garcia Quintas Date: Wed, 30 Sep 2015 11:31:21 -0700 Subject: [PATCH 41/79] Subchannel cleanup on iomgr shutdown --- src/core/client_config/subchannel.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/core/client_config/subchannel.c b/src/core/client_config/subchannel.c index 740389003a5..e6c05c93194 100644 --- a/src/core/client_config/subchannel.c +++ b/src/core/client_config/subchannel.c @@ -645,11 +645,24 @@ static void on_alarm(grpc_exec_ctx *exec_ctx, void *arg, int iomgr_success) { iomgr_success = 0; } connectivity_state_changed_locked(exec_ctx, c, "alarm"); - gpr_mu_unlock(&c->mu); if (iomgr_success) { + gpr_mu_unlock(&c->mu); update_reconnect_parameters(c); continue_connect(exec_ctx, c); } else { + waiting_for_connect *w4c; + w4c = c->waiting; + c->waiting = NULL; + gpr_mu_unlock(&c->mu); + while (w4c != NULL) { + waiting_for_connect *next = w4c->next; + grpc_subchannel_del_interested_party(exec_ctx, w4c->subchannel, + w4c->pollset); + w4c->notify->cb(exec_ctx, w4c->notify->cb_arg, 0); + GRPC_SUBCHANNEL_UNREF(exec_ctx, w4c->subchannel, "waiting_for_connect"); + gpr_free(w4c); + w4c = next; + } GRPC_CHANNEL_INTERNAL_UNREF(exec_ctx, c->master, "connecting"); GRPC_SUBCHANNEL_UNREF(exec_ctx, c, "connecting"); } From d43ad333b8847b596b3e1205e85635f0c513aa08 Mon Sep 17 00:00:00 2001 From: Masood Malekghassemi Date: Thu, 17 Sep 2015 14:50:36 -0700 Subject: [PATCH 42/79] Make load_tests protocol tests run via py.test --- src/python/grpcio_test/grpc_test/conftest.py | 60 ++++++++++++++++++++ tools/run_tests/run_python.sh | 10 ---- 2 files changed, 60 insertions(+), 10 deletions(-) create mode 100644 src/python/grpcio_test/grpc_test/conftest.py diff --git a/src/python/grpcio_test/grpc_test/conftest.py b/src/python/grpcio_test/grpc_test/conftest.py new file mode 100644 index 00000000000..357320ec64b --- /dev/null +++ b/src/python/grpcio_test/grpc_test/conftest.py @@ -0,0 +1,60 @@ +import types +import unittest + +import pytest + + +class LoadTestsSuiteCollector(pytest.Collector): + + def __init__(self, name, parent, suite): + super(LoadTestsSuiteCollector, self).__init__(name, parent=parent) + self.suite = suite + self.obj = suite + + def collect(self): + collected = [] + for case in self.suite: + if isinstance(case, unittest.TestCase): + collected.append(LoadTestsCase(case.id(), self, case)) + elif isinstance(case, unittest.TestSuite): + collected.append( + LoadTestsSuiteCollector('suite_child_of_mine', self, case)) + return collected + + def reportinfo(self): + return str(self.suite) + + +class LoadTestsCase(pytest.Function): + + def __init__(self, name, parent, item): + super(LoadTestsCase, self).__init__(name, parent, callobj=self._item_run) + self.item = item + + def _item_run(self): + result = unittest.TestResult() + self.item(result) + if result.failures: + test_method, trace = result.failures[0] + pytest.fail(trace, False) + elif result.errors: + test_method, trace = result.errors[0] + pytest.fail(trace, False) + elif result.skipped: + test_method, reason = result.skipped[0] + pytest.skip(reason) + + +def pytest_pycollect_makeitem(collector, name, obj): + if name == 'load_tests' and isinstance(obj, types.FunctionType): + suite = unittest.TestSuite() + loader = unittest.TestLoader() + pattern = '*' + try: + # Check that the 'load_tests' object is actually a callable that actually + # accepts the arguments expected for the load_tests protocol. + suite = obj(loader, suite, pattern) + except Exception as e: + return None + else: + return LoadTestsSuiteCollector(name, collector, suite) diff --git a/tools/run_tests/run_python.sh b/tools/run_tests/run_python.sh index 977b02fd949..e2135be04c5 100755 --- a/tools/run_tests/run_python.sh +++ b/tools/run_tests/run_python.sh @@ -40,14 +40,4 @@ export DYLD_LIBRARY_PATH=$ROOT/libs/$CONFIG export PATH=$ROOT/bins/$CONFIG:$ROOT/bins/$CONFIG/protobuf:$PATH source "python"$PYVER"_virtual_environment"/bin/activate -# TODO(atash): These tests don't currently run under py.test and thus don't -# appear under the coverage report. Find a way to get these tests to work with -# py.test (or find another tool or *something*) that's acceptable to the rest of -# the team... -"python"$PYVER -m grpc_test._core_over_links_base_interface_test -"python"$PYVER -m grpc_test._crust_over_core_over_links_face_interface_test -"python"$PYVER -m grpc_test.beta._face_interface_test -"python"$PYVER -m grpc_test.framework._crust_over_core_face_interface_test -"python"$PYVER -m grpc_test.framework.core._base_interface_test - "python"$PYVER $GRPCIO_TEST/setup.py test -a "-n8 --cov=grpc --junitxml=./report.xml --timeout=300" From 3b147818e3aef9d77cce55e96447b568558f2e62 Mon Sep 17 00:00:00 2001 From: David Garcia Quintas Date: Wed, 30 Sep 2015 15:59:52 -0700 Subject: [PATCH 43/79] Added subchannel ability to unsubscribe to connectivity state changes. --- src/core/client_config/subchannel.c | 11 +++++++++++ src/core/client_config/subchannel.h | 15 +++++++++++---- src/core/transport/connectivity_state.c | 21 +++++++++++++++++++++ src/core/transport/connectivity_state.h | 7 +++++++ 4 files changed, 50 insertions(+), 4 deletions(-) diff --git a/src/core/client_config/subchannel.c b/src/core/client_config/subchannel.c index 740389003a5..86654544605 100644 --- a/src/core/client_config/subchannel.c +++ b/src/core/client_config/subchannel.c @@ -413,6 +413,17 @@ void grpc_subchannel_notify_on_state_change(grpc_exec_ctx *exec_ctx, } } +int grpc_subchannel_state_change_unsubscribe(grpc_exec_ctx *exec_ctx, + grpc_subchannel *c, + grpc_closure *subscribed_notify) { + int success; + gpr_mu_lock(&c->mu); + success = grpc_connectivity_state_change_unsubscribe( + exec_ctx, &c->state_tracker, subscribed_notify); + gpr_mu_unlock(&c->mu); + return success; +} + void grpc_subchannel_process_transport_op(grpc_exec_ctx *exec_ctx, grpc_subchannel *c, grpc_transport_op *op) { diff --git a/src/core/client_config/subchannel.h b/src/core/client_config/subchannel.h index 2af3ce9e56a..03e7cd0590d 100644 --- a/src/core/client_config/subchannel.h +++ b/src/core/client_config/subchannel.h @@ -64,13 +64,13 @@ typedef struct grpc_subchannel_args grpc_subchannel_args; #define GRPC_SUBCHANNEL_REF_EXTRA_ARGS #endif -void grpc_subchannel_ref(grpc_subchannel *channel - GRPC_SUBCHANNEL_REF_EXTRA_ARGS); +void grpc_subchannel_ref( + grpc_subchannel *channel GRPC_SUBCHANNEL_REF_EXTRA_ARGS); void grpc_subchannel_unref(grpc_exec_ctx *exec_ctx, grpc_subchannel *channel GRPC_SUBCHANNEL_REF_EXTRA_ARGS); -void grpc_subchannel_call_ref(grpc_subchannel_call *call - GRPC_SUBCHANNEL_REF_EXTRA_ARGS); +void grpc_subchannel_call_ref( + grpc_subchannel_call *call GRPC_SUBCHANNEL_REF_EXTRA_ARGS); void grpc_subchannel_call_unref(grpc_exec_ctx *exec_ctx, grpc_subchannel_call *call GRPC_SUBCHANNEL_REF_EXTRA_ARGS); @@ -98,6 +98,13 @@ void grpc_subchannel_notify_on_state_change(grpc_exec_ctx *exec_ctx, grpc_connectivity_state *state, grpc_closure *notify); +/** Remove \a subscribed_notify from the list of closures to be called on a + * state change if present, returning 1. Otherwise, nothing is done and return + * 0. */ +int grpc_subchannel_state_change_unsubscribe(grpc_exec_ctx *exec_ctx, + grpc_subchannel *channel, + grpc_closure *subscribed_notify); + /** express interest in \a channel's activities through \a pollset. */ void grpc_subchannel_add_interested_party(grpc_exec_ctx *exec_ctx, grpc_subchannel *channel, diff --git a/src/core/transport/connectivity_state.c b/src/core/transport/connectivity_state.c index a53fecc1985..09b298c131b 100644 --- a/src/core/transport/connectivity_state.c +++ b/src/core/transport/connectivity_state.c @@ -115,6 +115,27 @@ int grpc_connectivity_state_notify_on_state_change( return tracker->current_state == GRPC_CHANNEL_IDLE; } +int grpc_connectivity_state_change_unsubscribe( + grpc_exec_ctx *exec_ctx, grpc_connectivity_state_tracker *tracker, + grpc_closure *subscribed_notify) { + grpc_connectivity_state_watcher *w = tracker->watchers; + if (w != NULL && w->notify == subscribed_notify) { + tracker->watchers = w->next; + gpr_free(w); + return 1; + } + while (w != NULL) { + grpc_connectivity_state_watcher *rm_candidate = w->next; + if (rm_candidate != NULL && rm_candidate->notify == subscribed_notify) { + w->next = w->next->next; + gpr_free(rm_candidate); + return 1; + } + w = w->next; + } + return 0; +} + void grpc_connectivity_state_set(grpc_exec_ctx *exec_ctx, grpc_connectivity_state_tracker *tracker, grpc_connectivity_state state, diff --git a/src/core/transport/connectivity_state.h b/src/core/transport/connectivity_state.h index 8b6b0554cd4..119b1c1554d 100644 --- a/src/core/transport/connectivity_state.h +++ b/src/core/transport/connectivity_state.h @@ -78,4 +78,11 @@ int grpc_connectivity_state_notify_on_state_change( grpc_exec_ctx *exec_ctx, grpc_connectivity_state_tracker *tracker, grpc_connectivity_state *current, grpc_closure *notify); +/** Remove \a subscribed_notify from the list of closures to be called on a + * state change if present, returning 1. Otherwise, nothing is done and return + * 0. */ +int grpc_connectivity_state_change_unsubscribe( + grpc_exec_ctx *exec_ctx, grpc_connectivity_state_tracker *tracker, + grpc_closure *subscribed_notify); + #endif /* GRPC_INTERNAL_CORE_TRANSPORT_CONNECTIVITY_STATE_H */ From bf6cfc3d18bb144fdeda924a0584a569bc552fef Mon Sep 17 00:00:00 2001 From: "Nicolas \"Pixel\" Noble" Date: Thu, 1 Oct 2015 02:23:03 +0200 Subject: [PATCH 44/79] Adding lcov to the jenkins docker files. --- tools/jenkins/grpc_jenkins_slave/Dockerfile | 3 ++- tools/jenkins/grpc_jenkins_slave_32bits/Dockerfile | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/tools/jenkins/grpc_jenkins_slave/Dockerfile b/tools/jenkins/grpc_jenkins_slave/Dockerfile index 7248f974092..4f5387eeb55 100644 --- a/tools/jenkins/grpc_jenkins_slave/Dockerfile +++ b/tools/jenkins/grpc_jenkins_slave/Dockerfile @@ -32,7 +32,7 @@ FROM debian:jessie -# Install Git. +# Install Git and basic packages. RUN apt-get update && apt-get install -y \ autoconf \ autotools-dev \ @@ -44,6 +44,7 @@ RUN apt-get update && apt-get install -y \ gcc-multilib \ git \ gyp \ + lcov \ libc6 \ libc6-dbg \ libc6-dev \ diff --git a/tools/jenkins/grpc_jenkins_slave_32bits/Dockerfile b/tools/jenkins/grpc_jenkins_slave_32bits/Dockerfile index c1ff85c3ca1..81a03990916 100644 --- a/tools/jenkins/grpc_jenkins_slave_32bits/Dockerfile +++ b/tools/jenkins/grpc_jenkins_slave_32bits/Dockerfile @@ -32,7 +32,7 @@ FROM 32bit/debian:jessie -# Install Git. +# Install Git and basic packages. RUN apt-get update && apt-get install -y \ autoconf \ autotools-dev \ @@ -44,6 +44,7 @@ RUN apt-get update && apt-get install -y \ gcc-multilib \ git \ gyp \ + lcov \ libc6 \ libc6-dbg \ libc6-dev \ From 9908877a731baacb4b26ce92011e43f5f9366b14 Mon Sep 17 00:00:00 2001 From: Tim Emiola Date: Thu, 1 Oct 2015 10:54:25 -0700 Subject: [PATCH 45/79] Update README.mds that don't currently have Status 'Beta' --- README.md | 38 +++++++++++++++++++------------------- src/core/README.md | 3 +-- src/cpp/README.md | 3 +-- 3 files changed, 21 insertions(+), 23 deletions(-) diff --git a/README.md b/README.md index c01529a73de..2ef6c3d7f6e 100644 --- a/README.md +++ b/README.md @@ -26,31 +26,31 @@ of shared C core library [src/core] (src/core). * PHP source code: [src/php] (src/php) * C# source code: [src/csharp] (src/csharp) * Objective-C source code: [src/objective-c] (src/objective-c) - -Java source code is in [grpc-java] (http://github.com/grpc/grpc-java) repository. + +Java source code is in [grpc-java] (http://github.com/grpc/grpc-java) repository. Go source code is in [grpc-go] (http://github.com/grpc/grpc-go) repository. #Current Status of libraries Libraries in different languages are in different state of development. We are seeking contributions for all of these libraries. - * shared C core library [src/core] (src/core) : Early adopter ready - Alpha. - * C++ Library: [src/cpp] (src/cpp) : Early adopter ready - Alpha. - * Ruby Library: [src/ruby] (src/ruby) : Early adopter ready - Alpha. - * NodeJS Library: [src/node] (src/node) : Early adopter ready - Alpha. - * Python Library: [src/python] (src/python) : Early adopter ready - Alpha. - * C# Library: [src/csharp] (src/csharp) : Beta. - * Objective-C Library: [src/objective-c] (src/objective-c): Early adopter ready - Alpha. - * PHP Library: [src/php] (src/php) : Pre-Alpha. + * shared C core library [src/core] (src/core) : Beta - the surface API is stable + * C++ Library: [src/cpp] (src/cpp) : Beta - the surface API is stable + * Ruby Library: [src/ruby] (src/ruby) : Beta - the surface API is stable + * NodeJS Library: [src/node] (src/node) : Beta - the surface API is stable + * Python Library: [src/python] (src/python) : Beta - the surface API is stable + * C# Library: [src/csharp] (src/csharp) : Beta - the surface API is stable + * Objective-C Library: [src/objective-c] (src/objective-c): Beta - the surface API is stable + * PHP Library: [src/php] (src/php) : Beta - the surface API is stable #Overview -Remote Procedure Calls (RPCs) provide a useful abstraction for building +Remote Procedure Calls (RPCs) provide a useful abstraction for building distributed applications and services. The libraries in this repository provide a concrete implementation of the gRPC protocol, layered over HTTP/2. These libraries enable communication between clients and servers using any -combination of the supported languages. +combination of the supported languages. ##Interface @@ -62,12 +62,12 @@ which they use on the client-side and implement on the server side. By default, gRPC uses [Protocol Buffers](https://github.com/google/protobuf) as the Interface Definition Language (IDL) for describing both the service interface -and the structure of the payload messages. It is possible to use other +and the structure of the payload messages. It is possible to use other alternatives if desired. ###Surface API Starting from an interface definition in a .proto file, gRPC provides -Protocol Compiler plugins that generate Client- and Server-side APIs. +Protocol Compiler plugins that generate Client- and Server-side APIs. gRPC users typically call into these APIs on the Client side and implement the corresponding API on the server side. @@ -76,9 +76,9 @@ Synchronous RPC calls, that block until a response arrives from the server, are the closest approximation to the abstraction of a procedure call that RPC aspires to. -On the other hand, networks are inherently asynchronous and in many scenarios, +On the other hand, networks are inherently asynchronous and in many scenarios, it is desirable to have the ability to start RPCs without blocking the current -thread. +thread. The gRPC programming surface in most languages comes in both synchronous and asynchronous flavors. @@ -87,8 +87,8 @@ asynchronous flavors. ## Streaming gRPC supports streaming semantics, where either the client or the server (or both) -send a stream of messages on a single RPC call. The most general case is -Bidirectional Streaming where a single gRPC call establishes a stream where both +send a stream of messages on a single RPC call. The most general case is +Bidirectional Streaming where a single gRPC call establishes a stream where both the client and the server can send a stream of messages to each other. The streamed messages are delivered in the order they were sent. @@ -103,7 +103,7 @@ fleshing out the details of each of the required operations. A gRPC RPC comprises of a bidirectional stream of messages, initiated by the client. In the client-to-server direction, this stream begins with a mandatory `Call Header`, followed by optional `Initial-Metadata`, followed by zero or more `Payload Messages`. The server-to-client direction contains an optional `Initial-Metadata`, followed by zero or more `Payload Messages` terminated with a mandatory `Status` and optional `Status-Metadata` (a.k.a.,`Trailing-Metadata`). ## Implementation over HTTP/2 -The abstract protocol defined above is implemented over [HTTP/2](https://http2.github.io/). gRPC bidirectional streams are mapped to HTTP/2 streams. The contents of `Call Header` and `Initial Metadata` are sent as HTTP/2 headers and subject to HPACK compression. `Payload Messages` are serialized into a byte stream of length prefixed gRPC frames which are then fragmented into HTTP/2 frames at the sender and reassembled at the receiver. `Status` and `Trailing-Metadata` are sent as HTTP/2 trailing headers (a.k.a., trailers). +The abstract protocol defined above is implemented over [HTTP/2](https://http2.github.io/). gRPC bidirectional streams are mapped to HTTP/2 streams. The contents of `Call Header` and `Initial Metadata` are sent as HTTP/2 headers and subject to HPACK compression. `Payload Messages` are serialized into a byte stream of length prefixed gRPC frames which are then fragmented into HTTP/2 frames at the sender and reassembled at the receiver. `Status` and `Trailing-Metadata` are sent as HTTP/2 trailing headers (a.k.a., trailers). ## Flow Control gRPC inherits the flow control mechanisms in HTTP/2 and uses them to enable fine-grained control of the amount of memory used for buffering in-flight messages. diff --git a/src/core/README.md b/src/core/README.md index 407dc4f7019..0d8c0d5bd90 100644 --- a/src/core/README.md +++ b/src/core/README.md @@ -5,5 +5,4 @@ Python, PHP, NodeJS, Objective-C) are layered on top of this library. #Status -Alpha : Ready for early adopters - +Beta diff --git a/src/cpp/README.md b/src/cpp/README.md index a2eb9a08c81..baeba083155 100644 --- a/src/cpp/README.md +++ b/src/cpp/README.md @@ -5,5 +5,4 @@ This directory contains source code for C++ implementation of gRPC. #Status -Alpha : Ready for early adopters - +Beta From 0d55750cb2b8122df3bfb4030c008fe084455000 Mon Sep 17 00:00:00 2001 From: yang-g Date: Thu, 1 Oct 2015 11:30:12 -0700 Subject: [PATCH 46/79] Maybe it is already ready when we call getstatus --- test/cpp/end2end/end2end_test.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/cpp/end2end/end2end_test.cc b/test/cpp/end2end/end2end_test.cc index 49a38ce544b..0322b2dabef 100644 --- a/test/cpp/end2end/end2end_test.cc +++ b/test/cpp/end2end/end2end_test.cc @@ -734,7 +734,8 @@ TEST_P(End2endTest, ChannelState) { EXPECT_EQ(GRPC_CHANNEL_IDLE, channel_->GetState(true)); EXPECT_TRUE(channel_->WaitForStateChange(GRPC_CHANNEL_IDLE, gpr_inf_future(GPR_CLOCK_REALTIME))); - EXPECT_EQ(GRPC_CHANNEL_CONNECTING, channel_->GetState(false)); + auto state = channel_->GetState(false); + EXPECT_TRUE(state == GRPC_CHANNEL_CONNECTING || state == GRPC_CHANNEL_READY); } // Takes 10s. From 035cf093de8e18095f9aeca3a7fe4faaa05c4639 Mon Sep 17 00:00:00 2001 From: yang-g Date: Fri, 18 Sep 2015 12:11:05 -0700 Subject: [PATCH 47/79] enable_ssl to use_tls --- test/cpp/interop/client.cc | 4 ++-- test/cpp/interop/client_helper.cc | 14 +++++++------- test/cpp/interop/server.cc | 2 +- test/cpp/interop/server_helper.cc | 4 ++-- tools/dockerfile/grpc_cxx/Dockerfile | 2 +- tools/gce_setup/grpc_docker.sh | 10 +++++----- 6 files changed, 18 insertions(+), 18 deletions(-) diff --git a/test/cpp/interop/client.cc b/test/cpp/interop/client.cc index 58c71cca35e..e785ac90099 100644 --- a/test/cpp/interop/client.cc +++ b/test/cpp/interop/client.cc @@ -45,7 +45,7 @@ #include "test/cpp/interop/interop_client.h" #include "test/cpp/util/test_config.h" -DEFINE_bool(enable_ssl, false, "Whether to use ssl/tls."); +DEFINE_bool(use_tls, false, "Whether to use tls."); DEFINE_bool(use_prod_roots, false, "True to use SSL roots for google"); DEFINE_int32(server_port, 0, "Server port."); DEFINE_string(server_host, "127.0.0.1", "Server host to connect to"); @@ -143,7 +143,7 @@ int main(int argc, char** argv) { client.DoEmptyStream(); client.DoStatusWithMessage(); // service_account_creds and jwt_token_creds can only run with ssl. - if (FLAGS_enable_ssl) { + if (FLAGS_use_tls) { grpc::string json_key = GetServiceAccountJsonKey(); client.DoJwtTokenCreds(json_key); client.DoOauth2AuthToken( diff --git a/test/cpp/interop/client_helper.cc b/test/cpp/interop/client_helper.cc index f85aa6ad8eb..cbad21e318e 100644 --- a/test/cpp/interop/client_helper.cc +++ b/test/cpp/interop/client_helper.cc @@ -51,7 +51,7 @@ #include "test/core/security/oauth2_utils.h" #include "test/cpp/util/create_test_channel.h" -DECLARE_bool(enable_ssl); +DECLARE_bool(use_tls); DECLARE_bool(use_prod_roots); DECLARE_int32(server_port); DECLARE_string(server_host); @@ -99,27 +99,27 @@ std::shared_ptr CreateChannelForTestCase( if (test_case == "compute_engine_creds") { std::shared_ptr creds; - GPR_ASSERT(FLAGS_enable_ssl); + GPR_ASSERT(FLAGS_use_tls); creds = GoogleComputeEngineCredentials(); return CreateTestChannel(host_port, FLAGS_server_host_override, - FLAGS_enable_ssl, FLAGS_use_prod_roots, creds); + FLAGS_use_tls, FLAGS_use_prod_roots, creds); } else if (test_case == "jwt_token_creds") { std::shared_ptr creds; - GPR_ASSERT(FLAGS_enable_ssl); + GPR_ASSERT(FLAGS_use_tls); grpc::string json_key = GetServiceAccountJsonKey(); std::chrono::seconds token_lifetime = std::chrono::hours(1); creds = ServiceAccountJWTAccessCredentials(json_key, token_lifetime.count()); return CreateTestChannel(host_port, FLAGS_server_host_override, - FLAGS_enable_ssl, FLAGS_use_prod_roots, creds); + FLAGS_use_tls, FLAGS_use_prod_roots, creds); } else if (test_case == "oauth2_auth_token") { grpc::string raw_token = GetOauth2AccessToken(); std::shared_ptr creds = AccessTokenCredentials(raw_token); return CreateTestChannel(host_port, FLAGS_server_host_override, - FLAGS_enable_ssl, FLAGS_use_prod_roots, creds); + FLAGS_use_tls, FLAGS_use_prod_roots, creds); } else { return CreateTestChannel(host_port, FLAGS_server_host_override, - FLAGS_enable_ssl, FLAGS_use_prod_roots); + FLAGS_use_tls, FLAGS_use_prod_roots); } } diff --git a/test/cpp/interop/server.cc b/test/cpp/interop/server.cc index 03b65324473..c0e1ec943d7 100644 --- a/test/cpp/interop/server.cc +++ b/test/cpp/interop/server.cc @@ -54,7 +54,7 @@ #include "test/proto/empty.grpc.pb.h" #include "test/proto/messages.grpc.pb.h" -DEFINE_bool(enable_ssl, false, "Whether to use ssl/tls."); +DEFINE_bool(use_tls, false, "Whether to use tls."); DEFINE_int32(port, 0, "Server port."); using grpc::Server; diff --git a/test/cpp/interop/server_helper.cc b/test/cpp/interop/server_helper.cc index 015198354e9..45707508466 100644 --- a/test/cpp/interop/server_helper.cc +++ b/test/cpp/interop/server_helper.cc @@ -41,13 +41,13 @@ #include "src/core/surface/call.h" #include "test/core/end2end/data/ssl_test_data.h" -DECLARE_bool(enable_ssl); +DECLARE_bool(use_tls); namespace grpc { namespace testing { std::shared_ptr CreateInteropServerCredentials() { - if (FLAGS_enable_ssl) { + if (FLAGS_use_tls) { SslServerCredentialsOptions::PemKeyCertPair pkcp = {test_server1_key, test_server1_cert}; SslServerCredentialsOptions ssl_opts; diff --git a/tools/dockerfile/grpc_cxx/Dockerfile b/tools/dockerfile/grpc_cxx/Dockerfile index ac09e25e404..82887df95c7 100644 --- a/tools/dockerfile/grpc_cxx/Dockerfile +++ b/tools/dockerfile/grpc_cxx/Dockerfile @@ -54,4 +54,4 @@ ADD service_account service_account ADD cacerts cacerts ENV GRPC_DEFAULT_SSL_ROOTS_FILE_PATH /cacerts/roots.pem -CMD ["/var/local/git/grpc/bins/opt/interop_server", "--enable_ssl", "--port=8010"] +CMD ["/var/local/git/grpc/bins/opt/interop_server", "--use_tls", "--port=8010"] diff --git a/tools/gce_setup/grpc_docker.sh b/tools/gce_setup/grpc_docker.sh index 84263ad6b99..fdb77363273 100755 --- a/tools/gce_setup/grpc_docker.sh +++ b/tools/gce_setup/grpc_docker.sh @@ -1477,7 +1477,7 @@ grpc_cloud_prod_auth_compute_engine_creds_gen_node_cmd() { # cmd=$($grpc_gen_test_cmd $flags) grpc_interop_gen_cxx_cmd() { local cmd_prefix="sudo docker run grpc/cxx"; - local test_script="/var/local/git/grpc/bins/opt/interop_client --enable_ssl"; + local test_script="/var/local/git/grpc/bins/opt/interop_client --use_tls"; local the_cmd="$cmd_prefix $test_script $@"; echo $the_cmd } @@ -1489,7 +1489,7 @@ grpc_interop_gen_cxx_cmd() { # cmd=$($grpc_gen_test_cmd $flags) grpc_cloud_prod_gen_cxx_cmd() { local cmd_prefix="sudo docker run grpc/cxx"; - local test_script="/var/local/git/grpc/bins/opt/interop_client --enable_ssl --use_prod_roots"; + local test_script="/var/local/git/grpc/bins/opt/interop_client --use_tls --use_prod_roots"; local gfe_flags=$(_grpc_prod_gfe_flags) local the_cmd="$cmd_prefix $test_script $gfe_flags $@"; echo $the_cmd @@ -1502,7 +1502,7 @@ grpc_cloud_prod_gen_cxx_cmd() { # cmd=$($grpc_gen_test_cmd $flags) grpc_cloud_prod_auth_service_account_creds_gen_cxx_cmd() { local cmd_prefix="sudo docker run grpc/cxx"; - local test_script="/var/local/git/grpc/bins/opt/interop_client --enable_ssl --use_prod_roots"; + local test_script="/var/local/git/grpc/bins/opt/interop_client --use_tls --use_prod_roots"; local gfe_flags=$(_grpc_prod_gfe_flags) local added_gfe_flags=$(_grpc_svc_acc_test_flags) local the_cmd="$cmd_prefix $test_script $gfe_flags $added_gfe_flags $@"; @@ -1516,7 +1516,7 @@ grpc_cloud_prod_auth_service_account_creds_gen_cxx_cmd() { # cmd=$($grpc_gen_test_cmd $flags) grpc_cloud_prod_auth_compute_engine_creds_gen_cxx_cmd() { local cmd_prefix="sudo docker run grpc/cxx"; - local test_script="/var/local/git/grpc/bins/opt/interop_client --enable_ssl --use_prod_roots"; + local test_script="/var/local/git/grpc/bins/opt/interop_client --use_tls --use_prod_roots"; local gfe_flags=$(_grpc_prod_gfe_flags) local added_gfe_flags=$(_grpc_gce_test_flags) local the_cmd="$cmd_prefix $test_script $gfe_flags $added_gfe_flags $@"; @@ -1530,7 +1530,7 @@ grpc_cloud_prod_auth_compute_engine_creds_gen_cxx_cmd() { # cmd=$($grpc_gen_test_cmd $flags) grpc_cloud_prod_auth_jwt_token_creds_gen_cxx_cmd() { local cmd_prefix="sudo docker run grpc/cxx"; - local test_script="/var/local/git/grpc/bins/opt/interop_client --enable_ssl --use_prod_roots"; + local test_script="/var/local/git/grpc/bins/opt/interop_client --use_tls --use_prod_roots"; local gfe_flags=$(_grpc_prod_gfe_flags) local added_gfe_flags=$(_grpc_jwt_token_test_flags) local the_cmd="$cmd_prefix $test_script $gfe_flags $added_gfe_flags $@"; From 18802c778601fd560b3b31c681fbe89ddc1c2409 Mon Sep 17 00:00:00 2001 From: yang-g Date: Mon, 21 Sep 2015 13:08:29 -0700 Subject: [PATCH 48/79] change objc --- src/objective-c/tests/run_tests.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/objective-c/tests/run_tests.sh b/src/objective-c/tests/run_tests.sh index 7b133c1782b..598f4e7fa1d 100755 --- a/src/objective-c/tests/run_tests.sh +++ b/src/objective-c/tests/run_tests.sh @@ -37,7 +37,7 @@ cd $(dirname $0) # Run the tests server. ../../../bins/$CONFIG/interop_server --port=5050 & -../../../bins/$CONFIG/interop_server --port=5051 --enable_ssl & +../../../bins/$CONFIG/interop_server --port=5051 --use_tls & # Kill them when this script exits. trap 'kill -9 `jobs -p`' EXIT From 54db83d06d9655dcc8ef1c1359538bc1e13031d6 Mon Sep 17 00:00:00 2001 From: yang-g Date: Thu, 1 Oct 2015 11:42:05 -0700 Subject: [PATCH 49/79] fix run_interop_tests.py --- tools/run_tests/run_interop_tests.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/tools/run_tests/run_interop_tests.py b/tools/run_tests/run_interop_tests.py index a2fb1243cc4..6445513fbed 100755 --- a/tools/run_tests/run_interop_tests.py +++ b/tools/run_tests/run_interop_tests.py @@ -53,8 +53,7 @@ _CLOUD_TO_CLOUD_BASE_ARGS = [ # supported by C core SslCredentials instead. _SSL_CERT_ENV = { 'SSL_CERT_FILE':'/usr/local/share/grpc/roots.pem' } -# TODO(jtatttermusch) unify usage of --enable_ssl, --use_tls and --use_tls=true - +# TODO(jtatttermusch) unify usage of --use_tls and --use_tls=true class CXXLanguage: @@ -64,11 +63,11 @@ class CXXLanguage: def cloud_to_prod_args(self): return (self.client_cmdline_base + _CLOUD_TO_PROD_BASE_ARGS + - ['--enable_ssl','--use_prod_roots']) + ['--use_tls=true','--use_prod_roots']) def cloud_to_cloud_args(self): return (self.client_cmdline_base + _CLOUD_TO_CLOUD_BASE_ARGS + - ['--enable_ssl']) + ['--use_tls=true']) def cloud_to_prod_env(self): return None @@ -327,4 +326,4 @@ else: jobset.message('FAILED', 'Some tests failed', do_newline=True) tree = ET.ElementTree(root) -tree.write('report.xml', encoding='UTF-8') \ No newline at end of file +tree.write('report.xml', encoding='UTF-8') From 35155ae997e07ea3928a24be91bc6643efa2c31a Mon Sep 17 00:00:00 2001 From: murgatroid99 Date: Thu, 1 Oct 2015 12:02:30 -0700 Subject: [PATCH 50/79] Fixed missing item in Node library file list --- src/node/package.json | 1 + 1 file changed, 1 insertion(+) diff --git a/src/node/package.json b/src/node/package.json index 22f94757ce6..67946adc6fb 100644 --- a/src/node/package.json +++ b/src/node/package.json @@ -52,6 +52,7 @@ "cli", "examples", "ext", + "health_check", "interop", "src", "test" From 759f59a18354beefa75ffa1f31172121bbf255f2 Mon Sep 17 00:00:00 2001 From: yang-g Date: Fri, 2 Oct 2015 10:38:22 -0700 Subject: [PATCH 51/79] handle closed transport at the end of a read --- src/core/transport/chttp2_transport.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/transport/chttp2_transport.c b/src/core/transport/chttp2_transport.c index 0202d53abdb..58d5bdc7850 100644 --- a/src/core/transport/chttp2_transport.c +++ b/src/core/transport/chttp2_transport.c @@ -1136,7 +1136,7 @@ static void recv_data(grpc_exec_ctx *exec_ctx, void *tp, int success) { grpc_chttp2_publish_reads(exec_ctx, &t->global, &t->parsing); t->parsing_active = 0; } - if (!success || i != t->read_buffer.count) { + if (!success || i != t->read_buffer.count || t->closed) { drop_connection(exec_ctx, t); read_error_locked(exec_ctx, t); } else if (!t->closed) { From 91ad018c0026dc231e73ede1db17ef5e329d453c Mon Sep 17 00:00:00 2001 From: Jan Tattermusch Date: Thu, 1 Oct 2015 09:22:03 -0700 Subject: [PATCH 52/79] Build and run per-language containers for interop tests --- .../build_docker_and_run_interop_tests.sh | 111 ------ tools/jenkins/build_interop_image.sh | 93 +++++ tools/jenkins/grpc_interop_csharp/Dockerfile | 92 +++++ .../grpc_interop_csharp/build_interop.sh | 44 +++ tools/jenkins/grpc_interop_cxx/Dockerfile | 75 ++++ .../jenkins/grpc_interop_cxx/build_interop.sh | 42 +++ tools/jenkins/grpc_interop_java/Dockerfile | 58 ++++ .../build_interop.sh} | 12 +- tools/jenkins/grpc_interop_node/Dockerfile | 79 +++++ .../build_interop.sh} | 24 +- tools/jenkins/grpc_interop_php/Dockerfile | 112 ++++++ .../build_interop.sh} | 40 +-- tools/jenkins/grpc_interop_ruby/Dockerfile | 87 +++++ .../grpc_interop_ruby/build_interop.sh | 43 +++ tools/run_tests/dockerjob.py | 112 ++++++ tools/run_tests/jobset.py | 11 +- tools/run_tests/run_interop_tests.py | 326 +++++++++++++----- 17 files changed, 1115 insertions(+), 246 deletions(-) delete mode 100755 tools/jenkins/build_docker_and_run_interop_tests.sh create mode 100755 tools/jenkins/build_interop_image.sh create mode 100644 tools/jenkins/grpc_interop_csharp/Dockerfile create mode 100755 tools/jenkins/grpc_interop_csharp/build_interop.sh create mode 100644 tools/jenkins/grpc_interop_cxx/Dockerfile create mode 100755 tools/jenkins/grpc_interop_cxx/build_interop.sh create mode 100644 tools/jenkins/grpc_interop_java/Dockerfile rename tools/jenkins/{docker_run_interop_tests.sh => grpc_interop_java/build_interop.sh} (85%) create mode 100644 tools/jenkins/grpc_interop_node/Dockerfile rename tools/jenkins/{docker_run_interop_servers.sh => grpc_interop_node/build_interop.sh} (65%) create mode 100644 tools/jenkins/grpc_interop_php/Dockerfile rename tools/jenkins/{docker_prepare_interop_tests.sh => grpc_interop_php/build_interop.sh} (67%) create mode 100644 tools/jenkins/grpc_interop_ruby/Dockerfile create mode 100755 tools/jenkins/grpc_interop_ruby/build_interop.sh create mode 100755 tools/run_tests/dockerjob.py diff --git a/tools/jenkins/build_docker_and_run_interop_tests.sh b/tools/jenkins/build_docker_and_run_interop_tests.sh deleted file mode 100755 index d2d56d947bf..00000000000 --- a/tools/jenkins/build_docker_and_run_interop_tests.sh +++ /dev/null @@ -1,111 +0,0 @@ -#!/bin/bash -# Copyright 2015, Google Inc. -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are -# met: -# -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# * Redistributions in binary form must reproduce the above -# copyright notice, this list of conditions and the following disclaimer -# in the documentation and/or other materials provided with the -# distribution. -# * Neither the name of Google Inc. nor the names of its -# contributors may be used to endorse or promote products derived from -# this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# -# This script is invoked by run_interop_tests.py to accommodate -# "interop tests under docker" scenario. You should never need to call this -# script on your own. - -set -ex - -cd `dirname $0`/../.. -git_root=`pwd` -cd - - -mkdir -p /tmp/ccache - -# Use image name based on Dockerfile checksum -DOCKER_IMAGE_NAME=grpc_jenkins_slave${docker_suffix}_`sha1sum tools/jenkins/grpc_jenkins_slave/Dockerfile | cut -f1 -d\ ` - -# Make sure docker image has been built. Should be instantaneous if so. -docker build -t $DOCKER_IMAGE_NAME tools/jenkins/grpc_jenkins_slave$docker_suffix - -# Create a local branch so the child Docker script won't complain -git branch -f jenkins-docker - -# Make sure the CID files are gone. -rm -f prepare.cid server.cid client.cid - -# Prepare image for interop tests -docker run \ - -e CCACHE_DIR=/tmp/ccache \ - -i $TTY_FLAG \ - -v "$git_root:/var/local/jenkins/grpc" \ - -v /tmp/ccache:/tmp/ccache \ - --cidfile=prepare.cid \ - $DOCKER_IMAGE_NAME \ - bash -l /var/local/jenkins/grpc/tools/jenkins/docker_prepare_interop_tests.sh || DOCKER_FAILED="true" - -PREPARE_CID=`cat prepare.cid` - -# Create image from the container, we will spawn one docker for clients -# and one for servers. -INTEROP_IMAGE=interop_`uuidgen` -docker commit $PREPARE_CID $INTEROP_IMAGE -# remove container, possibly killing it first -docker rm -f $PREPARE_CID || true -echo "Successfully built image $INTEROP_IMAGE" - -# run interop servers under docker in the background -docker run \ - -d -i \ - $SERVERS_DOCKER_EXTRA_ARGS \ - --cidfile=server.cid \ - $INTEROP_IMAGE bash -l /var/local/git/grpc/tools/jenkins/docker_run_interop_servers.sh - -SERVER_CID=`cat server.cid` - -SERVER_PORTS="" -for tuple in $SERVER_PORT_TUPLES -do - # lookup under which port docker exposes given internal port - exposed_port=`docker port $SERVER_CID ${tuple#*:} | awk -F ":" '{print $NF}'` - - # override the port for corresponding cloud_to_cloud server - SERVER_PORTS+=" --override_server ${tuple%:*}=localhost:$exposed_port" - echo "${tuple%:*} server is exposed under port $exposed_port" -done - -# run interop clients -docker run \ - -e "RUN_TESTS_COMMAND=$RUN_TESTS_COMMAND $SERVER_PORTS" \ - -w /var/local/git/grpc \ - -i $TTY_FLAG \ - --net=host \ - --cidfile=client.cid \ - $INTEROP_IMAGE bash -l /var/local/git/grpc/tools/jenkins/docker_run_interop_tests.sh || DOCKER_FAILED="true" - -CLIENT_CID=`cat client.cid` - -echo "killing and removing server container $SERVER_CID" -docker rm -f $SERVER_CID || true - -docker cp $CLIENT_CID:/var/local/git/grpc/report.xml $git_root -docker rm -f $CLIENT_CID || true -docker rmi -f $DOCKER_IMAGE_NAME || true diff --git a/tools/jenkins/build_interop_image.sh b/tools/jenkins/build_interop_image.sh new file mode 100755 index 00000000000..b5958588f2b --- /dev/null +++ b/tools/jenkins/build_interop_image.sh @@ -0,0 +1,93 @@ +#!/bin/bash +# Copyright 2015, Google Inc. +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are +# met: +# +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above +# copyright notice, this list of conditions and the following disclaimer +# in the documentation and/or other materials provided with the +# distribution. +# * Neither the name of Google Inc. nor the names of its +# contributors may be used to endorse or promote products derived from +# this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# +# This script is invoked by run_interop_tests.py to build the docker image +# for interop testing. You should never need to call this script on your own. + +set -x + +cd `dirname $0`/../.. +GRPC_ROOT=`pwd` +MOUNT_ARGS="-v $GRPC_ROOT:/var/local/jenkins/grpc" + +GRPC_JAVA_ROOT=`cd ../grpc-java && pwd` +if [ "$GRPC_JAVA_ROOT" != "" ] +then + MOUNT_ARGS+=" -v $GRPC_JAVA_ROOT:/var/local/jenkins/grpc-java" +else + echo "WARNING: grpc-java not found, it won't be mounted to the docker container." +fi + +GRPC_GO_ROOT=`cd ../grpc-go && pwd` +if [ "$GRPC_GO_ROOT" != "" ] +then + MOUNT_ARGS+=" -v $GRPC_GO_ROOT:/var/local/jenkins/grpc-go" +else + echo "WARNING: grpc-go not found, it won't be mounted to the docker container." +fi + +mkdir -p /tmp/ccache + +# Params: +# INTEROP_IMAGE - name of tag of the final interop image +# BASE_NAME - base name used to locate the base Dockerfile and build script +# TTY_FLAG - optional -t flag to make docker allocate tty. + +# Use image name based on Dockerfile checksum +BASE_IMAGE=${BASE_NAME}_base:`sha1sum tools/jenkins/$BASE_NAME/Dockerfile | cut -f1 -d\ ` + +# Make sure base docker image has been built. Should be instantaneous if so. +docker build -t $BASE_IMAGE --force-rm=true tools/jenkins/$BASE_NAME || exit $? + +# Create a local branch so the child Docker script won't complain +git branch -f jenkins-docker + +CIDFILE=`mktemp -u --suffix=.cid` + +# Prepare image for interop tests, commit it on success. +(docker run \ + -e CCACHE_DIR=/tmp/ccache \ + -i $TTY_FLAG \ + $MOUNT_ARGS \ + -v /tmp/ccache:/tmp/ccache \ + --cidfile=$CIDFILE \ + $BASE_IMAGE \ + bash -l /var/local/jenkins/grpc/tools/jenkins/$BASE_NAME/build_interop.sh \ + && docker commit `cat $CIDFILE` $INTEROP_IMAGE \ + && echo "Successfully built image $INTEROP_IMAGE") +EXITCODE=$? + +# remove intermediate container, possibly killing it first +docker rm -f `cat $CIDFILE` + +# remove the cidfile +rm -rf `cat $CIDFILE` + +exit $EXITCODE diff --git a/tools/jenkins/grpc_interop_csharp/Dockerfile b/tools/jenkins/grpc_interop_csharp/Dockerfile new file mode 100644 index 00000000000..3789cd32038 --- /dev/null +++ b/tools/jenkins/grpc_interop_csharp/Dockerfile @@ -0,0 +1,92 @@ +# Copyright 2015, Google Inc. +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are +# met: +# +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above +# copyright notice, this list of conditions and the following disclaimer +# in the documentation and/or other materials provided with the +# distribution. +# * Neither the name of Google Inc. nor the names of its +# contributors may be used to endorse or promote products derived from +# this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +# A work-in-progress Dockerfile that allows running gRPC test suites +# inside a docker container. + +FROM debian:jessie + +# Install Git. +RUN apt-get update && apt-get install -y \ + autoconf \ + autotools-dev \ + build-essential \ + bzip2 \ + ccache \ + curl \ + gcc \ + gcc-multilib \ + git \ + gyp \ + libc6 \ + libc6-dbg \ + libc6-dev \ + libgtest-dev \ + libtool \ + make \ + strace \ + python-dev \ + python-setuptools \ + python-yaml \ + telnet \ + unzip \ + wget \ + zip && apt-get clean + +# Prepare ccache +RUN ln -s /usr/bin/ccache /usr/local/bin/gcc +RUN ln -s /usr/bin/ccache /usr/local/bin/g++ +RUN ln -s /usr/bin/ccache /usr/local/bin/cc +RUN ln -s /usr/bin/ccache /usr/local/bin/c++ +RUN ln -s /usr/bin/ccache /usr/local/bin/clang +RUN ln -s /usr/bin/ccache /usr/local/bin/clang++ + +################# +# C# dependencies + +# Update to a newer version of mono +RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF +RUN echo "deb http://download.mono-project.com/repo/debian wheezy main" | tee /etc/apt/sources.list.d/mono-xamarin.list +RUN echo "deb http://download.mono-project.com/repo/debian wheezy-apache24-compat main" | tee -a /etc/apt/sources.list.d/mono-xamarin.list +RUN echo "deb http://download.mono-project.com/repo/debian wheezy-libjpeg62-compat main" | tee -a /etc/apt/sources.list.d/mono-xamarin.list +RUN echo "deb http://download.mono-project.com/repo/debian wheezy-libtiff-compat main" | tee -a /etc/apt/sources.list.d/mono-xamarin.list + +# Install dependencies +RUN apt-get update && apt-get -y dist-upgrade && apt-get install -y \ + mono-devel \ + nunit \ + nunit-console \ + monodevelop + +# Download NuGet +RUN cd /var/local && wget www.nuget.org/NuGet.exe +ENV NUGET mono /var/local/NuGet.exe + +# Define the default command. +CMD ["bash"] diff --git a/tools/jenkins/grpc_interop_csharp/build_interop.sh b/tools/jenkins/grpc_interop_csharp/build_interop.sh new file mode 100755 index 00000000000..e91cbed81ea --- /dev/null +++ b/tools/jenkins/grpc_interop_csharp/build_interop.sh @@ -0,0 +1,44 @@ +#!/bin/bash +# Copyright 2015, Google Inc. +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are +# met: +# +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above +# copyright notice, this list of conditions and the following disclaimer +# in the documentation and/or other materials provided with the +# distribution. +# * Neither the name of Google Inc. nor the names of its +# contributors may be used to endorse or promote products derived from +# this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# +# Builds C# interop server and client in a base image. +set -e + +mkdir -p /var/local/git +git clone --recursive /var/local/jenkins/grpc /var/local/git/grpc + +cd /var/local/git/grpc + +make install-certs + +# build C# interop client & server +make install_grpc_csharp_ext +(cd src/csharp && mono /var/local/NuGet.exe restore Grpc.sln) +(cd src/csharp && xbuild Grpc.sln) diff --git a/tools/jenkins/grpc_interop_cxx/Dockerfile b/tools/jenkins/grpc_interop_cxx/Dockerfile new file mode 100644 index 00000000000..1fa19075330 --- /dev/null +++ b/tools/jenkins/grpc_interop_cxx/Dockerfile @@ -0,0 +1,75 @@ +# Copyright 2015, Google Inc. +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are +# met: +# +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above +# copyright notice, this list of conditions and the following disclaimer +# in the documentation and/or other materials provided with the +# distribution. +# * Neither the name of Google Inc. nor the names of its +# contributors may be used to endorse or promote products derived from +# this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +# A work-in-progress Dockerfile that allows running gRPC test suites +# inside a docker container. + +FROM debian:jessie + +# Install Git. +RUN apt-get update && apt-get install -y \ + autoconf \ + autotools-dev \ + build-essential \ + bzip2 \ + ccache \ + curl \ + gcc \ + gcc-multilib \ + git \ + gyp \ + libc6 \ + libc6-dbg \ + libc6-dev \ + libgtest-dev \ + libtool \ + make \ + strace \ + python-dev \ + python-setuptools \ + python-yaml \ + telnet \ + unzip \ + wget \ + zip && apt-get clean + +# Prepare ccache +RUN ln -s /usr/bin/ccache /usr/local/bin/gcc +RUN ln -s /usr/bin/ccache /usr/local/bin/g++ +RUN ln -s /usr/bin/ccache /usr/local/bin/cc +RUN ln -s /usr/bin/ccache /usr/local/bin/c++ +RUN ln -s /usr/bin/ccache /usr/local/bin/clang +RUN ln -s /usr/bin/ccache /usr/local/bin/clang++ + +################## +# C++ dependencies +RUN apt-get update && apt-get -y install libgflags-dev libgtest-dev libc++-dev clang + +# Define the default command. +CMD ["bash"] diff --git a/tools/jenkins/grpc_interop_cxx/build_interop.sh b/tools/jenkins/grpc_interop_cxx/build_interop.sh new file mode 100755 index 00000000000..4163e11ecc7 --- /dev/null +++ b/tools/jenkins/grpc_interop_cxx/build_interop.sh @@ -0,0 +1,42 @@ +#!/bin/bash +# Copyright 2015, Google Inc. +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are +# met: +# +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above +# copyright notice, this list of conditions and the following disclaimer +# in the documentation and/or other materials provided with the +# distribution. +# * Neither the name of Google Inc. nor the names of its +# contributors may be used to endorse or promote products derived from +# this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# +# Builds C++ interop server and client in a base image. +set -e + +mkdir -p /var/local/git +git clone --recursive /var/local/jenkins/grpc /var/local/git/grpc + +cd /var/local/git/grpc + +make install-certs + +# build C++ interop client & server +make interop_client interop_server diff --git a/tools/jenkins/grpc_interop_java/Dockerfile b/tools/jenkins/grpc_interop_java/Dockerfile new file mode 100644 index 00000000000..1ec24a95e38 --- /dev/null +++ b/tools/jenkins/grpc_interop_java/Dockerfile @@ -0,0 +1,58 @@ +# Copyright 2015, Google Inc. +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are +# met: +# +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above +# copyright notice, this list of conditions and the following disclaimer +# in the documentation and/or other materials provided with the +# distribution. +# * Neither the name of Google Inc. nor the names of its +# contributors may be used to endorse or promote products derived from +# this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +FROM debian:jessie + +# Install JDK 8 and Git +# +# TODO(temiola): simplify this if/when a simpler process is available. +# +RUN echo oracle-java8-installer shared/accepted-oracle-license-v1-1 select true | /usr/bin/debconf-set-selections && \ + echo "deb http://ppa.launchpad.net/webupd8team/java/ubuntu trusty main" | tee /etc/apt/sources.list.d/webupd8team-java.list && \ + echo "deb-src http://ppa.launchpad.net/webupd8team/java/ubuntu trusty main" | tee -a /etc/apt/sources.list.d/webupd8team-java.list && \ + apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys EEA14886 && \ + apt-get update && \ + apt-get -y install \ + git \ + libapr1 \ + oracle-java8-installer \ + && \ + apt-get clean && rm -r /var/cache/oracle-jdk8-installer/ + +ENV JAVA_HOME /usr/lib/jvm/java-8-oracle +ENV PATH $PATH:$JAVA_HOME/bin + +# Trigger download of as many Gradle artifacts as possible. +RUN git clone --recursive --depth 1 https://github.com/grpc/grpc-java.git && \ + cd grpc-java && \ + ./gradlew build -PskipCodegen=true && \ + rm -r "$(pwd)" + +# Define the default command. +CMD ["bash"] diff --git a/tools/jenkins/docker_run_interop_tests.sh b/tools/jenkins/grpc_interop_java/build_interop.sh similarity index 85% rename from tools/jenkins/docker_run_interop_tests.sh rename to tools/jenkins/grpc_interop_java/build_interop.sh index 29970afb258..4ee2f44e3d5 100755 --- a/tools/jenkins/docker_run_interop_tests.sh +++ b/tools/jenkins/grpc_interop_java/build_interop.sh @@ -28,12 +28,12 @@ # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # -# This script is invoked by build_docker_and_run_interop_tests.sh inside -# a docker container. You should never need to call this script on your own. +# Builds Java interop server and client in a base image. set -e -nvm use 0.12 -rvm use ruby-2.1 +mkdir -p /var/local/git +git clone --recursive --depth 1 /var/local/jenkins/grpc-java /var/local/git/grpc-java -# run the cloud-to-prod interop tests -$RUN_TESTS_COMMAND +cd /var/local/git/grpc-java + +./gradlew :grpc-interop-testing:installDist -PskipCodegen=true diff --git a/tools/jenkins/grpc_interop_node/Dockerfile b/tools/jenkins/grpc_interop_node/Dockerfile new file mode 100644 index 00000000000..587227b9429 --- /dev/null +++ b/tools/jenkins/grpc_interop_node/Dockerfile @@ -0,0 +1,79 @@ +# Copyright 2015, Google Inc. +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are +# met: +# +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above +# copyright notice, this list of conditions and the following disclaimer +# in the documentation and/or other materials provided with the +# distribution. +# * Neither the name of Google Inc. nor the names of its +# contributors may be used to endorse or promote products derived from +# this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +# A work-in-progress Dockerfile that allows running gRPC test suites +# inside a docker container. + +FROM debian:jessie + +# Install Git. +RUN apt-get update && apt-get install -y \ + autoconf \ + autotools-dev \ + build-essential \ + bzip2 \ + ccache \ + curl \ + gcc \ + gcc-multilib \ + git \ + gyp \ + libc6 \ + libc6-dbg \ + libc6-dev \ + libgtest-dev \ + libtool \ + make \ + strace \ + python-dev \ + python-setuptools \ + python-yaml \ + telnet \ + unzip \ + wget \ + zip && apt-get clean + +# Prepare ccache +RUN ln -s /usr/bin/ccache /usr/local/bin/gcc +RUN ln -s /usr/bin/ccache /usr/local/bin/g++ +RUN ln -s /usr/bin/ccache /usr/local/bin/cc +RUN ln -s /usr/bin/ccache /usr/local/bin/c++ +RUN ln -s /usr/bin/ccache /usr/local/bin/clang +RUN ln -s /usr/bin/ccache /usr/local/bin/clang++ + +################## +# Node dependencies + +# Install nvm +RUN touch .profile +RUN curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.25.4/install.sh | bash +RUN /bin/bash -l -c "nvm install 0.12" + +# Define the default command. +CMD ["bash"] diff --git a/tools/jenkins/docker_run_interop_servers.sh b/tools/jenkins/grpc_interop_node/build_interop.sh similarity index 65% rename from tools/jenkins/docker_run_interop_servers.sh rename to tools/jenkins/grpc_interop_node/build_interop.sh index 9f29a65aaa4..55e2a4081bc 100755 --- a/tools/jenkins/docker_run_interop_servers.sh +++ b/tools/jenkins/grpc_interop_node/build_interop.sh @@ -28,23 +28,19 @@ # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # -# This script is invoked by run_jekins.sh. It contains the test logic -# that should run inside a docker container. +# Builds Node interop server and client in a base image. set -e +mkdir -p /var/local/git +git clone --recursive /var/local/jenkins/grpc /var/local/git/grpc + cd /var/local/git/grpc nvm use 0.12 -rvm use ruby-2.1 - -# If port env variable is set, run corresponding interop server on given port in background. -# TODO(jtattermusch): ideally, run_interop_tests.py would generate the commands to run servers. - -[ -z "${SERVER_PORT_cxx}" ] || bins/opt/interop_server --enable_ssl --port=${SERVER_PORT_cxx} & - -[ -z "${SERVER_PORT_node}" ] || node src/node/interop/interop_server.js --use_tls=true --port=${SERVER_PORT_node} & - -[ -z "${SERVER_PORT_ruby}" ] || ruby src/ruby/bin/interop/interop_server.rb --use_tls --port=${SERVER_PORT_ruby} & +nvm alias default 0.12 # prevent the need to run 'nvm use' in every shell -[ -z "${SERVER_PORT_csharp}" ] || (cd src/csharp/Grpc.IntegrationTesting.Server/bin/Debug && mono Grpc.IntegrationTesting.Server.exe --use_tls --port=${SERVER_PORT_csharp}) & +make install-certs -sleep infinity +# build Node interop client & server +npm install -g node-gyp +make install_c -C /var/local/git/grpc +(cd src/node && npm install && node-gyp rebuild) diff --git a/tools/jenkins/grpc_interop_php/Dockerfile b/tools/jenkins/grpc_interop_php/Dockerfile new file mode 100644 index 00000000000..0edc3c174d4 --- /dev/null +++ b/tools/jenkins/grpc_interop_php/Dockerfile @@ -0,0 +1,112 @@ +# Copyright 2015, Google Inc. +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are +# met: +# +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above +# copyright notice, this list of conditions and the following disclaimer +# in the documentation and/or other materials provided with the +# distribution. +# * Neither the name of Google Inc. nor the names of its +# contributors may be used to endorse or promote products derived from +# this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +# A work-in-progress Dockerfile that allows running gRPC test suites +# inside a docker container. + +FROM debian:jessie + +# Install Git. +RUN apt-get update && apt-get install -y \ + autoconf \ + autotools-dev \ + build-essential \ + bzip2 \ + ccache \ + curl \ + gcc \ + gcc-multilib \ + git \ + gyp \ + libc6 \ + libc6-dbg \ + libc6-dev \ + libgtest-dev \ + libtool \ + make \ + strace \ + python-dev \ + python-setuptools \ + python-yaml \ + telnet \ + unzip \ + wget \ + zip && apt-get clean + +# Prepare ccache +RUN ln -s /usr/bin/ccache /usr/local/bin/gcc +RUN ln -s /usr/bin/ccache /usr/local/bin/g++ +RUN ln -s /usr/bin/ccache /usr/local/bin/cc +RUN ln -s /usr/bin/ccache /usr/local/bin/c++ +RUN ln -s /usr/bin/ccache /usr/local/bin/clang +RUN ln -s /usr/bin/ccache /usr/local/bin/clang++ + +################## +# Ruby dependencies + +# Install rvm +RUN gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 +RUN \curl -sSL https://get.rvm.io | bash -s stable + +# Install Ruby 2.1 +RUN /bin/bash -l -c "rvm install ruby-2.1" +RUN /bin/bash -l -c "rvm use --default ruby-2.1" +RUN /bin/bash -l -c "echo 'gem: --no-ri --no-rdoc' > ~/.gemrc" +RUN /bin/bash -l -c "echo 'export PATH=/usr/local/rvm/bin:$PATH' >> ~/.bashrc" +RUN /bin/bash -l -c "echo 'rvm --default use ruby-2.1' >> ~/.bashrc" +RUN /bin/bash -l -c "gem install bundler --no-ri --no-rdoc" + +################## +# PHP dependencies + +# Install dependencies + +RUN /bin/bash -l -c "echo 'deb http://packages.dotdeb.org wheezy-php55 all' \ + >> /etc/apt/sources.list.d/dotdeb.list" +RUN /bin/bash -l -c "echo 'deb-src http://packages.dotdeb.org wheezy-php55 all' \ + >> /etc/apt/sources.list.d/dotdeb.list" +RUN wget http://www.dotdeb.org/dotdeb.gpg -O- | apt-key add - + +RUN apt-get update && apt-get install -y \ + git php5 php5-dev phpunit unzip + +# ronn: a ruby tool used to convert markdown to man pages, used during the +# install of Protobuf extensions +# +# rake: a ruby version of make used to build the PHP Protobuf extension +RUN /bin/bash -l -c "rvm all do gem install ronn rake" + +ENV DEBIAN_FRONTEND noniteractive + +# Install composer +RUN curl -sS https://getcomposer.org/installer | php +RUN mv composer.phar /usr/local/bin/composer + +# Define the default command. +CMD ["bash"] diff --git a/tools/jenkins/docker_prepare_interop_tests.sh b/tools/jenkins/grpc_interop_php/build_interop.sh similarity index 67% rename from tools/jenkins/docker_prepare_interop_tests.sh rename to tools/jenkins/grpc_interop_php/build_interop.sh index a1fe0b72d2f..745dea845d6 100755 --- a/tools/jenkins/docker_prepare_interop_tests.sh +++ b/tools/jenkins/grpc_interop_php/build_interop.sh @@ -28,52 +28,32 @@ # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # -# This script is invoked by run_jekins.sh. It contains the test logic -# that should run inside a docker container. +# Builds PHP interop server and client in a base image. set -e mkdir -p /var/local/git git clone --recursive /var/local/jenkins/grpc /var/local/git/grpc cd /var/local/git/grpc -nvm use 0.12 -rvm use ruby-2.1 +rvm --default use ruby-2.1 -# TODO(jtattermusch): use cleaner way to install root certs -mkdir -p /usr/local/share/grpc -cp etc/roots.pem /usr/local/share/grpc/ +make install-certs -# build C++ interop client & server -make interop_client interop_server +# gRPC core and protobuf need to be installed +make install -# build C# interop client & server -make install_grpc_csharp_ext -(cd src/csharp && mono /var/local/NuGet.exe restore Grpc.sln) -(cd src/csharp && xbuild Grpc.sln) - -# build Node interop client & server -npm install -g node-gyp -make install_c -C /var/local/git/grpc -(cd src/node && npm install && node-gyp rebuild) - -# build Ruby interop client and server -(cd src/ruby && gem update bundler && bundle && rake compile:grpc) - -# TODO(jtattermusch): add python - -# build PHP interop client -# TODO(jtattermusch): prerequisites for PHP should be installed sooner than here. -# Install composer -curl -sS https://getcomposer.org/installer | php -mv composer.phar /usr/local/bin/composer # Download the patched PHP protobuf so that PHP gRPC clients can be generated # from proto3 schemas. git clone https://github.com/stanley-cheung/Protobuf-PHP.git /var/local/git/protobuf-php + (cd src/php/ext/grpc && phpize && ./configure && make) -rvm all do gem install ronn rake + (cd third_party/protobuf && make install) + (cd /var/local/git/protobuf-php \ && rvm all do rake pear:package version=1.0 \ && pear install Protobuf-1.0.tgz) + (cd src/php && composer install) + (cd src/php && protoc-gen-php -i tests/interop/ -o tests/interop/ tests/interop/test.proto) diff --git a/tools/jenkins/grpc_interop_ruby/Dockerfile b/tools/jenkins/grpc_interop_ruby/Dockerfile new file mode 100644 index 00000000000..ff201fa291e --- /dev/null +++ b/tools/jenkins/grpc_interop_ruby/Dockerfile @@ -0,0 +1,87 @@ +# Copyright 2015, Google Inc. +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are +# met: +# +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above +# copyright notice, this list of conditions and the following disclaimer +# in the documentation and/or other materials provided with the +# distribution. +# * Neither the name of Google Inc. nor the names of its +# contributors may be used to endorse or promote products derived from +# this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +# A work-in-progress Dockerfile that allows running gRPC test suites +# inside a docker container. + +FROM debian:jessie + +# Install Git. +RUN apt-get update && apt-get install -y \ + autoconf \ + autotools-dev \ + build-essential \ + bzip2 \ + ccache \ + curl \ + gcc \ + gcc-multilib \ + git \ + gyp \ + libc6 \ + libc6-dbg \ + libc6-dev \ + libgtest-dev \ + libtool \ + make \ + strace \ + python-dev \ + python-setuptools \ + python-yaml \ + telnet \ + unzip \ + wget \ + zip && apt-get clean + +# Prepare ccache +RUN ln -s /usr/bin/ccache /usr/local/bin/gcc +RUN ln -s /usr/bin/ccache /usr/local/bin/g++ +RUN ln -s /usr/bin/ccache /usr/local/bin/cc +RUN ln -s /usr/bin/ccache /usr/local/bin/c++ +RUN ln -s /usr/bin/ccache /usr/local/bin/clang +RUN ln -s /usr/bin/ccache /usr/local/bin/clang++ + + +################## +# Ruby dependencies + +# Install rvm +RUN gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 +RUN \curl -sSL https://get.rvm.io | bash -s stable + +# Install Ruby 2.1 +RUN /bin/bash -l -c "rvm install ruby-2.1" +RUN /bin/bash -l -c "rvm use --default ruby-2.1" +RUN /bin/bash -l -c "echo 'gem: --no-ri --no-rdoc' > ~/.gemrc" +RUN /bin/bash -l -c "echo 'export PATH=/usr/local/rvm/bin:$PATH' >> ~/.bashrc" +RUN /bin/bash -l -c "echo 'rvm --default use ruby-2.1' >> ~/.bashrc" +RUN /bin/bash -l -c "gem install bundler --no-ri --no-rdoc" + +# Define the default command. +CMD ["bash"] diff --git a/tools/jenkins/grpc_interop_ruby/build_interop.sh b/tools/jenkins/grpc_interop_ruby/build_interop.sh new file mode 100755 index 00000000000..7d407e7d0a9 --- /dev/null +++ b/tools/jenkins/grpc_interop_ruby/build_interop.sh @@ -0,0 +1,43 @@ +#!/bin/bash +# Copyright 2015, Google Inc. +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are +# met: +# +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above +# copyright notice, this list of conditions and the following disclaimer +# in the documentation and/or other materials provided with the +# distribution. +# * Neither the name of Google Inc. nor the names of its +# contributors may be used to endorse or promote products derived from +# this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# +# Builds Ruby interop server and client in a base image. +set -e + +mkdir -p /var/local/git +git clone --recursive /var/local/jenkins/grpc /var/local/git/grpc + +cd /var/local/git/grpc +rvm --default use ruby-2.1 + +make install-certs + +# build Ruby interop client and server +(cd src/ruby && gem update bundler && bundle && rake compile:grpc) diff --git a/tools/run_tests/dockerjob.py b/tools/run_tests/dockerjob.py new file mode 100755 index 00000000000..e938a3c2f7f --- /dev/null +++ b/tools/run_tests/dockerjob.py @@ -0,0 +1,112 @@ +# Copyright 2015, Google Inc. +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are +# met: +# +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above +# copyright notice, this list of conditions and the following disclaimer +# in the documentation and/or other materials provided with the +# distribution. +# * Neither the name of Google Inc. nor the names of its +# contributors may be used to endorse or promote products derived from +# this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +"""Helpers to run docker instances as jobs.""" + +import jobset +import tempfile +import time +import uuid +import os +import subprocess + +_DEVNULL = open(os.devnull, 'w') + +def wait_for_file(filepath, timeout_seconds=15): + """Wait until given file exists and returns its content.""" + started = time.time() + while time.time() - started < timeout_seconds: + if os.path.isfile(filepath): + with open(filepath, 'r') as f: + return f.read() + time.sleep(1) + raise Exception('Failed to read file %s.' % filepath) + + +def docker_mapped_port(cid, port): + """Get port mapped to internal given internal port for given container.""" + output = subprocess.check_output('docker port %s %s' % (cid, port), shell=True) + return int(output.split(':', 2)[1]) + + +def finish_jobs(jobs): + """Kills given docker containers and waits for corresponding jobs to finish""" + for job in jobs: + job.kill(suppress_failure=True) + + while any(job.is_running() for job in jobs): + time.sleep(1) + + +def image_exists(image): + """Returns True if given docker image exists.""" + return subprocess.call(['docker','inspect', image], + stdout=_DEVNULL, + stderr=_DEVNULL) == 0 + + +def remove_image(image, skip_nonexistent=False, max_retries=10): + """Attempts to remove docker image with retries.""" + if skip_nonexistent and not image_exists(image): + return True + for attempt in range(0, max_retries): + if subprocess.call(['docker','rmi', '-f', image]) == 0: + return True + time.sleep(2) + print 'Failed to remove docker image %s' % image + return False + + +class DockerJob: + """Encapsulates a job""" + + def __init__(self, spec): + self._spec = spec + self._job = jobset.Job(spec, bin_hash=None, newline_on_success=True, travis=True, add_env={}, xml_report=None) + self._cidfile = spec.cidfile + self._cid = None + + def cid(self): + """Gets cid of this container""" + if not self._cid: + self._cid = wait_for_file(self._cidfile) + return self._cid + + def mapped_port(self, port): + return docker_mapped_port(self.cid(), port) + + def kill(self, suppress_failure=False): + """Sends kill signal to the container.""" + if suppress_failure: + self._job.suppress_failure_message() + return subprocess.call(['docker','kill', self.cid()]) == 0 + + def is_running(self): + """Polls a job and returns True if given job is still running.""" + return self._job.state(jobset.NoCache()) == jobset._RUNNING diff --git a/tools/run_tests/jobset.py b/tools/run_tests/jobset.py index b9ec020f9ef..87be703b4cd 100755 --- a/tools/run_tests/jobset.py +++ b/tools/run_tests/jobset.py @@ -180,6 +180,7 @@ class Job(object): name=self._spec.shortname) if xml_report is not None else None self._retries = 0 self._timeout_retries = 0 + self._suppress_failure_message = False message('START', spec.shortname, do_newline=self._travis) self.start() @@ -220,9 +221,10 @@ class Job(object): self.start() else: self._state = _FAILURE - message('FAILED', '%s [ret=%d, pid=%d]' % ( - self._spec.shortname, self._process.returncode, self._process.pid), - stdout, do_newline=True) + if not self._suppress_failure_message: + message('FAILED', '%s [ret=%d, pid=%d]' % ( + self._spec.shortname, self._process.returncode, self._process.pid), + stdout, do_newline=True) if self._xml_test is not None: ET.SubElement(self._xml_test, 'failure', message='Failure').text else: @@ -254,6 +256,9 @@ class Job(object): self._state = _KILLED self._process.terminate() + def suppress_failure_message(self): + self._suppress_failure_message = True + class Jobset(object): """Manages one run of jobs.""" diff --git a/tools/run_tests/run_interop_tests.py b/tools/run_tests/run_interop_tests.py index a2fb1243cc4..b5c1043e72a 100755 --- a/tools/run_tests/run_interop_tests.py +++ b/tools/run_tests/run_interop_tests.py @@ -31,14 +31,21 @@ """Run interop (cross-language) tests in parallel.""" import argparse +import dockerjob import itertools import xml.etree.cElementTree as ET import jobset import os import subprocess import sys +import tempfile import time +import uuid +ROOT = os.path.abspath(os.path.join(os.path.dirname(sys.argv[0]), '../..')) +os.chdir(ROOT) + +_DEFAULT_SERVER_PORT=8080 _CLOUD_TO_PROD_BASE_ARGS = [ '--server_host_override=grpc-test.sandbox.google.com', @@ -61,6 +68,7 @@ class CXXLanguage: def __init__(self): self.client_cmdline_base = ['bins/opt/interop_client'] self.client_cwd = None + self.server_cwd = None def cloud_to_prod_args(self): return (self.client_cmdline_base + _CLOUD_TO_PROD_BASE_ARGS + @@ -73,6 +81,9 @@ class CXXLanguage: def cloud_to_prod_env(self): return None + def server_args(self): + return ['bins/opt/interop_server', '--enable_ssl'] + def __str__(self): return 'c++' @@ -82,6 +93,7 @@ class CSharpLanguage: def __init__(self): self.client_cmdline_base = ['mono', 'Grpc.IntegrationTesting.Client.exe'] self.client_cwd = 'src/csharp/Grpc.IntegrationTesting.Client/bin/Debug' + self.server_cwd = 'src/csharp/Grpc.IntegrationTesting.Server/bin/Debug' def cloud_to_prod_args(self): return (self.client_cmdline_base + _CLOUD_TO_PROD_BASE_ARGS + @@ -94,15 +106,44 @@ class CSharpLanguage: def cloud_to_prod_env(self): return _SSL_CERT_ENV + def server_args(self): + return ['mono', 'Grpc.IntegrationTesting.Server.exe', '--use_tls'] + def __str__(self): return 'csharp' +class JavaLanguage: + + def __init__(self): + self.client_cmdline_base = ['./run-test-client.sh'] + self.client_cwd = '../grpc-java' + self.server_cwd = '../grpc-java' + + def cloud_to_prod_args(self): + return (self.client_cmdline_base + _CLOUD_TO_PROD_BASE_ARGS + + ['--use_tls=true']) + + def cloud_to_cloud_args(self): + return (self.client_cmdline_base + _CLOUD_TO_CLOUD_BASE_ARGS + + ['--use_tls=true', '--use_test_ca=true']) + + def cloud_to_prod_env(self): + return None + + def server_args(self): + return ['./run-test-server.sh', '--use_tls=true'] + + def __str__(self): + return 'java' + + class NodeLanguage: def __init__(self): self.client_cmdline_base = ['node', 'src/node/interop/interop_client.js'] self.client_cwd = None + self.server_cwd = None def cloud_to_prod_args(self): return (self.client_cmdline_base + _CLOUD_TO_PROD_BASE_ARGS + @@ -115,6 +156,9 @@ class NodeLanguage: def cloud_to_prod_env(self): return _SSL_CERT_ENV + def server_args(self): + return ['node', 'src/node/interop/interop_server.js', '--use_tls=true'] + def __str__(self): return 'node' @@ -145,6 +189,7 @@ class RubyLanguage: def __init__(self): self.client_cmdline_base = ['ruby', 'src/ruby/bin/interop/interop_client.rb'] self.client_cwd = None + self.server_cwd = None def cloud_to_prod_args(self): return (self.client_cmdline_base + _CLOUD_TO_PROD_BASE_ARGS + @@ -157,57 +202,144 @@ class RubyLanguage: def cloud_to_prod_env(self): return _SSL_CERT_ENV + def server_args(self): + return ['ruby', 'src/ruby/bin/interop/interop_server.rb', '--use_tls'] + def __str__(self): return 'ruby' -# TODO(jtattermusch): add php and python once we get them working +# TODO(jtattermusch): python once we get it working _LANGUAGES = { 'c++' : CXXLanguage(), 'csharp' : CSharpLanguage(), + 'java' : JavaLanguage(), 'node' : NodeLanguage(), 'php' : PHPLanguage(), 'ruby' : RubyLanguage(), } -# languages supported as cloud_to_cloud servers +# languages supported as cloud_to_cloud servers # TODO(jtattermusch): enable other languages as servers as well -_SERVERS = { 'c++' : 8010, 'node' : 8040, 'csharp': 8070 } +_SERVERS = ['c++', 'node', 'csharp', 'java'] -# TODO(jtattermusch): add empty_stream once C++ start supporting it. +# TODO(jtattermusch): add empty_stream once C++ starts supporting it. +# TODO(jtattermusch): add timeout_on_sleeping_server once java starts supporting it. # TODO(jtattermusch): add support for auth tests. _TEST_CASES = ['large_unary', 'empty_unary', 'ping_pong', 'client_streaming', 'server_streaming', - 'cancel_after_begin', 'cancel_after_first_response', - 'timeout_on_sleeping_server'] + 'cancel_after_begin', 'cancel_after_first_response'] -def cloud_to_prod_jobspec(language, test_case): +def docker_run_cmdline(cmdline, image, docker_args=[], cwd=None, environ=None): + """Wraps given cmdline array to create 'docker run' cmdline from it.""" + docker_cmdline = ['docker', 'run', '-i', '--rm=true'] + + # turn environ into -e docker args + if environ: + for k,v in environ.iteritems(): + docker_cmdline += ['-e', '%s=%s' % (k,v)] + + # set working directory + workdir = '/var/local/git/grpc' + if cwd: + workdir = os.path.join(workdir, cwd) + docker_cmdline += ['-w', workdir] + + docker_cmdline += docker_args + [image] + cmdline + return docker_cmdline + + +def bash_login_cmdline(cmdline): + """Creates bash -l -c cmdline from args list.""" + # Use login shell: + # * rvm and nvm require it + # * makes error messages clearer if executables are missing + return ['bash', '-l', '-c', ' '.join(cmdline)] + + +def cloud_to_prod_jobspec(language, test_case, docker_image=None): """Creates jobspec for cloud-to-prod interop test""" - cmdline = language.cloud_to_prod_args() + ['--test_case=%s' % test_case] + cmdline = bash_login_cmdline(language.cloud_to_prod_args() + + ['--test_case=%s' % test_case]) + cwd = language.client_cwd + environ = language.cloud_to_prod_env() + if docker_image: + cmdline = docker_run_cmdline(cmdline, image=docker_image, cwd=cwd, environ=environ) + cwd = None + environ = None + test_job = jobset.JobSpec( cmdline=cmdline, - cwd=language.client_cwd, + cwd=cwd, + environ=environ, shortname="cloud_to_prod:%s:%s" % (language, test_case), - environ=language.cloud_to_prod_env(), - timeout_seconds=60) + timeout_seconds=60, + flake_retries=5 if args.allow_flakes else 0, + timeout_retries=2 if args.allow_flakes else 0) return test_job def cloud_to_cloud_jobspec(language, test_case, server_name, server_host, - server_port): + server_port, docker_image=None): """Creates jobspec for cloud-to-cloud interop test""" - cmdline = language.cloud_to_cloud_args() + ['--test_case=%s' % test_case, - '--server_host=%s' % server_host, - '--server_port=%s' % server_port ] + cmdline = bash_login_cmdline(language.cloud_to_cloud_args() + + ['--test_case=%s' % test_case, + '--server_host=%s' % server_host, + '--server_port=%s' % server_port ]) + cwd = language.client_cwd + if docker_image: + cmdline = docker_run_cmdline(cmdline, + image=docker_image, + cwd=cwd, + docker_args=['--net=host']) + cwd = None test_job = jobset.JobSpec( cmdline=cmdline, - cwd=language.client_cwd, + cwd=cwd, shortname="cloud_to_cloud:%s:%s_server:%s" % (language, server_name, test_case), - timeout_seconds=60) + timeout_seconds=60, + flake_retries=5 if args.allow_flakes else 0, + timeout_retries=2 if args.allow_flakes else 0) return test_job + +def server_jobspec(language, docker_image): + """Create jobspec for running a server""" + cidfile = tempfile.mktemp() + cmdline = bash_login_cmdline(language.server_args() + + ['--port=%s' % _DEFAULT_SERVER_PORT]) + docker_cmdline = docker_run_cmdline(cmdline, + image=docker_image, + cwd=language.server_cwd, + docker_args=['-p', str(_DEFAULT_SERVER_PORT), + '--cidfile', cidfile]) + server_job = jobset.JobSpec( + cmdline=docker_cmdline, + shortname="interop_server:%s" % language, + timeout_seconds=30*60) + server_job.cidfile = cidfile + return server_job + + +def build_interop_image_jobspec(language, tag=None): + """Creates jobspec for building interop docker image for a language""" + safelang = str(language).replace("+", "x") + if not tag: + tag = 'grpc_interop_%s:%s' % (safelang, uuid.uuid4()) + env = {'INTEROP_IMAGE': tag, 'BASE_NAME': 'grpc_interop_%s' % safelang} + if not args.travis: + env['TTY_FLAG'] = '-t' + build_job = jobset.JobSpec( + cmdline=['tools/jenkins/build_interop_image.sh'], + environ=env, + shortname="build_docker_%s" % (language), + timeout_seconds=30*60) + build_job.tag = tag + return build_job + + argp = argparse.ArgumentParser(description='Run interop tests.') argp.add_argument('-l', '--language', choices=['all'] + sorted(_LANGUAGES), @@ -243,9 +375,14 @@ argp.add_argument('--use_docker', help='Run all the interop tests under docker. That provides ' + 'additional isolation and prevents the need to install ' + 'language specific prerequisites. Only available on Linux.') +argp.add_argument('--allow_flakes', + default=False, + action='store_const', + const=True, + help="Allow flaky tests to show as passing (re-runs failed tests up to five times)") args = argp.parse_args() -servers = set(s for s in itertools.chain.from_iterable(_SERVERS.iterkeys() +servers = set(s for s in itertools.chain.from_iterable(_SERVERS if x == 'all' else [x] for x in args.server)) @@ -258,73 +395,98 @@ if args.use_docker: print 'copied to the docker environment.' time.sleep(5) - child_argv = [ arg for arg in sys.argv if not arg == '--use_docker' ] - run_tests_cmd = ('tools/run_tests/run_interop_tests.py %s' % - " ".join(child_argv[1:])) - - # cmdline args to pass to the container running servers. - servers_extra_docker_args = '' - server_port_tuples = '' - for server in servers: - port = _SERVERS[server] - servers_extra_docker_args += ' -p %s' % port - servers_extra_docker_args += ' -e SERVER_PORT_%s=%s' % (server.replace("+", "x"), port) - server_port_tuples += ' %s:%s' % (server, port) - - env = os.environ.copy() - env['RUN_TESTS_COMMAND'] = run_tests_cmd - env['SERVERS_DOCKER_EXTRA_ARGS'] = servers_extra_docker_args - env['SERVER_PORT_TUPLES'] = server_port_tuples - if not args.travis: - env['TTY_FLAG'] = '-t' # enables Ctrl-C when not on Jenkins. - - subprocess.check_call(['tools/jenkins/build_docker_and_run_interop_tests.sh'], - shell=True, - env=env) - sys.exit(0) +if not args.use_docker and servers: + print "Running interop servers is only supported with --use_docker option enabled." + sys.exit(1) languages = set(_LANGUAGES[l] for l in itertools.chain.from_iterable( _LANGUAGES.iterkeys() if x == 'all' else [x] for x in args.language)) -jobs = [] -if args.cloud_to_prod: - for language in languages: - for test_case in _TEST_CASES: - test_job = cloud_to_prod_jobspec(language, test_case) - jobs.append(test_job) - -# default servers to "localhost" and the default port -server_addresses = dict((s, ("localhost", _SERVERS[s])) for s in servers) - -for server in args.override_server: - server_name = server[0] - (server_host, server_port) = server[1].split(":") - server_addresses[server_name] = (server_host, server_port) - -for server_name, server_address in server_addresses.iteritems(): - (server_host, server_port) = server_address - for language in languages: - for test_case in _TEST_CASES: - test_job = cloud_to_cloud_jobspec(language, - test_case, - server_name, - server_host, - server_port) - jobs.append(test_job) - -if not jobs: - print "No jobs to run." - sys.exit(1) - -root = ET.Element('testsuites') -testsuite = ET.SubElement(root, 'testsuite', id='1', package='grpc', name='tests') - -if jobset.run(jobs, newline_on_success=True, maxjobs=args.jobs, xml_report=testsuite): - jobset.message('SUCCESS', 'All tests passed', do_newline=True) -else: - jobset.message('FAILED', 'Some tests failed', do_newline=True) - -tree = ET.ElementTree(root) -tree.write('report.xml', encoding='UTF-8') \ No newline at end of file +docker_images={} +if args.use_docker: + # languages for which to build docker images + languages_to_build = set(_LANGUAGES[k] for k in set([str(l) for l in languages] + + [s for s in servers])) + + build_jobs = [] + for l in languages_to_build: + job = build_interop_image_jobspec(l) + docker_images[str(l)] = job.tag + build_jobs.append(job) + + if build_jobs: + jobset.message('START', 'Building interop docker images.', do_newline=True) + if jobset.run(build_jobs, newline_on_success=True, maxjobs=args.jobs): + jobset.message('SUCCESS', 'All docker images built successfully.', do_newline=True) + else: + jobset.message('FAILED', 'Failed to build interop docker images.', do_newline=True) + for image in docker_images.itervalues(): + dockerjob.remove_image(image, skip_nonexistent=True) + exit(1); + +# Start interop servers. +server_jobs={} +server_addresses={} +try: + for s in servers: + lang = str(s) + spec = server_jobspec(_LANGUAGES[lang], docker_images.get(lang)) + job = dockerjob.DockerJob(spec) + server_jobs[lang] = job + server_addresses[lang] = ('localhost', job.mapped_port(_DEFAULT_SERVER_PORT)) + + jobs = [] + if args.cloud_to_prod: + for language in languages: + for test_case in _TEST_CASES: + test_job = cloud_to_prod_jobspec(language, test_case, + docker_image=docker_images.get(str(language))) + jobs.append(test_job) + + for server in args.override_server: + server_name = server[0] + (server_host, server_port) = server[1].split(':') + server_addresses[server_name] = (server_host, server_port) + + for server_name, server_address in server_addresses.iteritems(): + (server_host, server_port) = server_address + for language in languages: + for test_case in _TEST_CASES: + test_job = cloud_to_cloud_jobspec(language, + test_case, + server_name, + server_host, + server_port, + docker_image=docker_images.get(str(language))) + jobs.append(test_job) + + if not jobs: + print "No jobs to run." + for image in docker_images.itervalues(): + dockerjob.remove_image(image, skip_nonexistent=True) + sys.exit(1) + + root = ET.Element('testsuites') + testsuite = ET.SubElement(root, 'testsuite', id='1', package='grpc', name='tests') + + if jobset.run(jobs, newline_on_success=True, maxjobs=args.jobs, xml_report=testsuite): + jobset.message('SUCCESS', 'All tests passed', do_newline=True) + else: + jobset.message('FAILED', 'Some tests failed', do_newline=True) + + tree = ET.ElementTree(root) + tree.write('report.xml', encoding='UTF-8') + +finally: + # Check if servers are still running. + for server, job in server_jobs.iteritems(): + if not job.is_running(): + print 'Server "%s" has exited prematurely.' % server + + dockerjob.finish_jobs([j for j in server_jobs.itervalues()]) + + for image in docker_images.itervalues(): + print 'Removing docker image %s' % image + dockerjob.remove_image(image) From 38a09b78d290cb5930a15bb13f9e9afd4c7a27dc Mon Sep 17 00:00:00 2001 From: David Klempner Date: Fri, 2 Oct 2015 13:37:58 -0700 Subject: [PATCH 53/79] Restore sanity by reformatting grpc_version_string --- src/core/surface/version.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/core/surface/version.c b/src/core/surface/version.c index e559d51448a..4b90e06a043 100644 --- a/src/core/surface/version.c +++ b/src/core/surface/version.c @@ -36,4 +36,6 @@ #include -const char *grpc_version_string(void) { return "0.11.0.0"; } +const char *grpc_version_string(void) { + return "0.11.0.0"; +} From 210a0ea598d44d725518ee68a27ad185fb0c16b0 Mon Sep 17 00:00:00 2001 From: Jan Tattermusch Date: Fri, 2 Oct 2015 15:05:36 -0700 Subject: [PATCH 54/79] tweaking of run_interop_tests.py --- tools/run_tests/dockerjob.py | 5 ++++- tools/run_tests/run_interop_tests.py | 11 +++++++---- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/tools/run_tests/dockerjob.py b/tools/run_tests/dockerjob.py index e938a3c2f7f..11686d46b09 100755 --- a/tools/run_tests/dockerjob.py +++ b/tools/run_tests/dockerjob.py @@ -44,7 +44,10 @@ def wait_for_file(filepath, timeout_seconds=15): while time.time() - started < timeout_seconds: if os.path.isfile(filepath): with open(filepath, 'r') as f: - return f.read() + content = f.read() + # make sure we don't return empty content + if content: + return content time.sleep(1) raise Exception('Failed to read file %s.' % filepath) diff --git a/tools/run_tests/run_interop_tests.py b/tools/run_tests/run_interop_tests.py index 274eaa33363..46b34fea4c0 100755 --- a/tools/run_tests/run_interop_tests.py +++ b/tools/run_tests/run_interop_tests.py @@ -35,6 +35,7 @@ import dockerjob import itertools import xml.etree.cElementTree as ET import jobset +import multiprocessing import os import subprocess import sys @@ -224,10 +225,11 @@ _LANGUAGES = { # TODO(jtattermusch): enable other languages as servers as well _SERVERS = ['c++', 'node', 'csharp', 'java'] +# TODO(jtattermusch): add empty_stream once PHP starts supporting it. # TODO(jtattermusch): add timeout_on_sleeping_server once java starts supporting it. # TODO(jtattermusch): add support for auth tests. _TEST_CASES = ['large_unary', 'empty_unary', 'ping_pong', - 'empty_stream', 'client_streaming', 'server_streaming', + 'client_streaming', 'server_streaming', 'cancel_after_begin', 'cancel_after_first_response'] @@ -274,7 +276,7 @@ def cloud_to_prod_jobspec(language, test_case, docker_image=None): cwd=cwd, environ=environ, shortname="cloud_to_prod:%s:%s" % (language, test_case), - timeout_seconds=60, + timeout_seconds=2*60, flake_retries=5 if args.allow_flakes else 0, timeout_retries=2 if args.allow_flakes else 0) return test_job @@ -299,7 +301,7 @@ def cloud_to_cloud_jobspec(language, test_case, server_name, server_host, cwd=cwd, shortname="cloud_to_cloud:%s:%s_server:%s" % (language, server_name, test_case), - timeout_seconds=60, + timeout_seconds=2*60, flake_retries=5 if args.allow_flakes else 0, timeout_retries=2 if args.allow_flakes else 0) return test_job @@ -346,7 +348,7 @@ argp.add_argument('-l', '--language', nargs='+', default=['all'], help='Clients to run.') -argp.add_argument('-j', '--jobs', default=24, type=int) +argp.add_argument('-j', '--jobs', default=multiprocessing.cpu_count(), type=int) argp.add_argument('--cloud_to_prod', default=False, action='store_const', @@ -437,6 +439,7 @@ try: server_jobs[lang] = job server_addresses[lang] = ('localhost', job.mapped_port(_DEFAULT_SERVER_PORT)) + jobs = [] if args.cloud_to_prod: for language in languages: From 4d97707751dd0912225e14ef469da762b62f6979 Mon Sep 17 00:00:00 2001 From: "Nicolas \"Pixel\" Noble" Date: Fri, 2 Oct 2015 23:52:38 +0200 Subject: [PATCH 55/79] Adding crude html report support. --- .gitignore | 1 + tools/jenkins/build_docker_and_run_tests.sh | 4 ++++ tools/jenkins/docker_run_tests.sh | 14 ++++++++++++++ tools/run_tests/run_node.sh | 8 ++++---- 4 files changed, 23 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index 8dc459ea276..18b42811b28 100644 --- a/.gitignore +++ b/.gitignore @@ -8,6 +8,7 @@ objs python*_virtual_environment # gcov coverage data +reports coverage *.gcno diff --git a/tools/jenkins/build_docker_and_run_tests.sh b/tools/jenkins/build_docker_and_run_tests.sh index 9f97f39e75d..2c562e992aa 100755 --- a/tools/jenkins/build_docker_and_run_tests.sh +++ b/tools/jenkins/build_docker_and_run_tests.sh @@ -74,6 +74,10 @@ then docker cp "$DOCKER_CID:/var/local/git/grpc/$XML_REPORT" $git_root fi +docker cp "$DOCKER_CID:/var/local/git/grpc/reports.zip" $git_root || true +unzip $git_root/reports.zip -d $git_root || true +rm -f reports.zip + # remove the container, possibly killing it first docker rm -f $DOCKER_CID || true diff --git a/tools/jenkins/docker_run_tests.sh b/tools/jenkins/docker_run_tests.sh index 3595a95f5ce..2e39bc6f51e 100755 --- a/tools/jenkins/docker_run_tests.sh +++ b/tools/jenkins/docker_run_tests.sh @@ -42,4 +42,18 @@ git clone --recursive /var/local/jenkins/grpc /var/local/git/grpc nvm use 0.12 rvm use ruby-2.1 +mkdir -p reports + $RUN_TESTS_COMMAND + +cd reports +echo '' > index.html +find . -maxdepth 1 -mindepth 1 -type d | sort | while read d ; do + d=${d#*/} + n=${d//_/ } + echo "$n
" >> index.html +done +echo '' >> index.html +cd .. + +zip -r reports.zip reports diff --git a/tools/run_tests/run_node.sh b/tools/run_tests/run_node.sh index 1043b447db3..e322ab1995a 100755 --- a/tools/run_tests/run_node.sh +++ b/tools/run_tests/run_node.sh @@ -43,13 +43,13 @@ export LD_LIBRARY_PATH=$root/libs/$CONFIG if [ "$CONFIG" = "gcov" ] then - ./node_modules/.bin/istanbul cover ./node_modules/.bin/_mocha -- \ - --timeout 8000 + ./node_modules/.bin/istanbul cover --dir ../../reports/node_coverage \ + ./node_modules/.bin/_mocha -- --timeout 8000 cd build gcov Release/obj.target/grpc/ext/*.o lcov --base-directory . --directory . -c -o coverage.info - genhtml -o ../ext_coverage --num-spaces 2 -t 'Node gRPC test coverage' \ - coverage.info + genhtml -o ../../../reports/node_ext_coverage --num-spaces 2 \ + -t 'Node gRPC test coverage' coverage.info else ./node_modules/mocha/bin/mocha --timeout 8000 fi From 2c1c00055b11bf9d54998ec2ac98e2464e4b07bd Mon Sep 17 00:00:00 2001 From: yang-g Date: Fri, 2 Oct 2015 16:15:05 -0700 Subject: [PATCH 56/79] Pollset can be destroyed again in pollset_work if the called_shutdown is not set here --- src/core/iomgr/pollset_posix.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/core/iomgr/pollset_posix.c b/src/core/iomgr/pollset_posix.c index 82a82cc0644..418502d1c6d 100644 --- a/src/core/iomgr/pollset_posix.c +++ b/src/core/iomgr/pollset_posix.c @@ -354,6 +354,7 @@ static void basic_do_promote(grpc_exec_ctx *exec_ctx, void *args, int success) { if (pollset->shutting_down) { /* We don't care about this pollset anymore. */ if (pollset->in_flight_cbs == 0 && !pollset->called_shutdown) { + pollset->called_shutdown = 1; finish_shutdown(exec_ctx, pollset); } } else if (grpc_fd_is_orphaned(fd)) { From c04610357ca9c7bfc993849a150c40872a13f50a Mon Sep 17 00:00:00 2001 From: yang-g Date: Fri, 2 Oct 2015 16:22:43 -0700 Subject: [PATCH 57/79] The Writes may return false after the server cancels the stream --- test/cpp/end2end/end2end_test.cc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/test/cpp/end2end/end2end_test.cc b/test/cpp/end2end/end2end_test.cc index 0322b2dabef..4ba1ee0c056 100644 --- a/test/cpp/end2end/end2end_test.cc +++ b/test/cpp/end2end/end2end_test.cc @@ -683,10 +683,14 @@ TEST_P(End2endTest, RequestStreamServerEarlyCancelTest) { auto stream = stub_->RequestStream(&context, &response); request.set_message("hello"); int send_messages = 20; - while (send_messages > 0) { + while (send_messages > 10) { EXPECT_TRUE(stream->Write(request)); send_messages--; } + while (send_messages > 0) { + stream->Write(request); + send_messages--; + } stream->WritesDone(); Status s = stream->Finish(); EXPECT_EQ(s.error_code(), StatusCode::CANCELLED); From 861fbcbf22b2aae7d8793051ce6ef598fc6e074a Mon Sep 17 00:00:00 2001 From: Masood Malekghassemi Date: Wed, 19 Aug 2015 16:31:36 -0700 Subject: [PATCH 58/79] Coalesce GRPC_TRACE=surface,batch into GRPC_TRACE=surface --- src/core/surface/call.h | 9 ++++----- src/core/surface/call_log_batch.c | 2 -- src/core/surface/init.c | 1 - 3 files changed, 4 insertions(+), 8 deletions(-) diff --git a/src/core/surface/call.h b/src/core/surface/call.h index 7ac0c92ab73..b1a1045792b 100644 --- a/src/core/surface/call.h +++ b/src/core/surface/call.h @@ -36,6 +36,7 @@ #include "src/core/channel/channel_stack.h" #include "src/core/channel/context.h" +#include "src/core/surface/surface_trace.h" #include #ifdef __cplusplus @@ -128,8 +129,6 @@ grpc_call_stack *grpc_call_get_call_stack(grpc_call *call); /* Given the top call_element, get the call object. */ grpc_call *grpc_call_from_top_element(grpc_call_element *surface_element); -extern int grpc_trace_batch; - void grpc_call_log_batch(char *file, int line, gpr_log_severity severity, grpc_call *call, const grpc_op *ops, size_t nops, void *tag); @@ -155,17 +154,17 @@ void grpc_call_context_set(grpc_call *call, grpc_context_index elem, void *grpc_call_context_get(grpc_call *call, grpc_context_index elem); #define GRPC_CALL_LOG_BATCH(sev, call, ops, nops, tag) \ - if (grpc_trace_batch) grpc_call_log_batch(sev, call, ops, nops, tag) + if (grpc_surface_trace) grpc_call_log_batch(sev, call, ops, nops, tag) #define GRPC_SERVER_LOG_REQUEST_CALL(sev, server, call, details, \ initial_metadata, cq_bound_to_call, \ cq_for_notifications, tag) \ - if (grpc_trace_batch) \ + if (grpc_surface_trace) \ grpc_server_log_request_call(sev, server, call, details, initial_metadata, \ cq_bound_to_call, cq_for_notifications, tag) #define GRPC_SERVER_LOG_SHUTDOWN(sev, server, cq, tag) \ - if (grpc_trace_batch) grpc_server_log_shutdown(sev, server, cq, tag) + if (grpc_surface_trace) grpc_server_log_shutdown(sev, server, cq, tag) gpr_uint8 grpc_call_is_client(grpc_call *call); diff --git a/src/core/surface/call_log_batch.c b/src/core/surface/call_log_batch.c index 5a3ef1e5f4b..2dd9737cf87 100644 --- a/src/core/surface/call_log_batch.c +++ b/src/core/surface/call_log_batch.c @@ -37,8 +37,6 @@ #include #include -int grpc_trace_batch = 0; - static void add_metadata(gpr_strvec *b, const grpc_metadata *md, size_t count) { size_t i; for (i = 0; i < count; i++) { diff --git a/src/core/surface/init.c b/src/core/surface/init.c index 93c27c77bf6..7d7e72440ea 100644 --- a/src/core/surface/init.c +++ b/src/core/surface/init.c @@ -102,7 +102,6 @@ void grpc_init(void) { grpc_register_tracer("surface", &grpc_surface_trace); grpc_register_tracer("http", &grpc_http_trace); grpc_register_tracer("flowctl", &grpc_flowctl_trace); - grpc_register_tracer("batch", &grpc_trace_batch); grpc_register_tracer("connectivity_state", &grpc_connectivity_state_trace); grpc_security_pre_init(); grpc_iomgr_init(); From 76c3d7481f56ad1a9ab928c3e423030fa440a729 Mon Sep 17 00:00:00 2001 From: Masood Malekghassemi Date: Wed, 19 Aug 2015 18:22:53 -0700 Subject: [PATCH 59/79] Add API tracing to gRPC core --- build.json | 2729 +++++++++++++++++ src/core/census/grpc_context.c | 4 + .../resolvers/zookeeper_resolver.c | 2 + src/core/compression/algorithm.c | 13 + src/core/security/credentials.c | 40 + .../security/google_default_credentials.c | 4 + src/core/security/security_context.c | 24 + src/core/security/server_secure_chttp2.c | 5 + src/core/surface/api_trace.c | 36 + src/core/surface/api_trace.h | 65 + src/core/surface/call.c | 13 + src/core/surface/call_details.c | 4 + src/core/surface/channel.c | 24 + src/core/surface/channel_connectivity.c | 12 + src/core/surface/channel_create.c | 4 + src/core/surface/completion_queue.c | 18 + src/core/surface/init.c | 6 + src/core/surface/lame_client.c | 5 + src/core/surface/metadata_array.c | 4 + src/core/surface/secure_channel_create.c | 5 + src/core/surface/server.c | 28 + src/core/surface/server_chttp2.c | 4 + src/core/surface/server_create.c | 3 +- src/core/surface/version.c | 8 +- 24 files changed, 3058 insertions(+), 2 deletions(-) create mode 100644 build.json create mode 100644 src/core/surface/api_trace.c create mode 100644 src/core/surface/api_trace.h diff --git a/build.json b/build.json new file mode 100644 index 00000000000..c68569e9f1a --- /dev/null +++ b/build.json @@ -0,0 +1,2729 @@ +{ + "#1": "This file describes the list of targets and dependencies.", + "#2": "It is used among other things to generate all of our project files.", + "#3": "Please refer to the templates directory for more information.", + "settings": { + "#": "The public version number of the library.", + "version": { + "major": 0, + "minor": 10, + "micro": 1, + "build": 0 + } + }, + "filegroups": [ + { + "name": "census", + "public_headers": [ + "include/grpc/census.h" + ], + "headers": [ + "src/core/census/context.h", + "src/core/census/rpc_stat_id.h" + ], + "src": [ + "src/core/census/context.c", + "src/core/census/initialize.c", + "src/core/census/record_stat.c" + ] + }, + { + "name": "grpc++_base", + "public_headers": [ + "include/grpc++/channel.h", + "include/grpc++/client_context.h", + "include/grpc++/completion_queue.h", + "include/grpc++/create_channel.h", + "include/grpc++/credentials.h", + "include/grpc++/generic/async_generic_service.h", + "include/grpc++/generic/generic_stub.h", + "include/grpc++/impl/call.h", + "include/grpc++/impl/client_unary_call.h", + "include/grpc++/impl/grpc_library.h", + "include/grpc++/impl/proto_utils.h", + "include/grpc++/impl/rpc_method.h", + "include/grpc++/impl/rpc_service_method.h", + "include/grpc++/impl/serialization_traits.h", + "include/grpc++/impl/service_type.h", + "include/grpc++/impl/sync.h", + "include/grpc++/impl/sync_cxx11.h", + "include/grpc++/impl/sync_no_cxx11.h", + "include/grpc++/impl/thd.h", + "include/grpc++/impl/thd_cxx11.h", + "include/grpc++/impl/thd_no_cxx11.h", + "include/grpc++/server.h", + "include/grpc++/server_builder.h", + "include/grpc++/server_context.h", + "include/grpc++/server_credentials.h", + "include/grpc++/support/async_stream.h", + "include/grpc++/support/async_unary_call.h", + "include/grpc++/support/auth_context.h", + "include/grpc++/support/byte_buffer.h", + "include/grpc++/support/channel_arguments.h", + "include/grpc++/support/config.h", + "include/grpc++/support/config_protobuf.h", + "include/grpc++/support/slice.h", + "include/grpc++/support/status.h", + "include/grpc++/support/status_code_enum.h", + "include/grpc++/support/string_ref.h", + "include/grpc++/support/stub_options.h", + "include/grpc++/support/sync_stream.h", + "include/grpc++/support/time.h" + ], + "headers": [ + "src/cpp/client/create_channel_internal.h", + "src/cpp/common/create_auth_context.h", + "src/cpp/server/dynamic_thread_pool.h", + "src/cpp/server/fixed_size_thread_pool.h", + "src/cpp/server/thread_pool_interface.h" + ], + "src": [ + "src/cpp/client/channel.cc", + "src/cpp/client/channel_arguments.cc", + "src/cpp/client/client_context.cc", + "src/cpp/client/create_channel.cc", + "src/cpp/client/create_channel_internal.cc", + "src/cpp/client/credentials.cc", + "src/cpp/client/generic_stub.cc", + "src/cpp/client/insecure_credentials.cc", + "src/cpp/common/call.cc", + "src/cpp/common/completion_queue.cc", + "src/cpp/common/rpc_method.cc", + "src/cpp/proto/proto_utils.cc", + "src/cpp/server/async_generic_service.cc", + "src/cpp/server/create_default_thread_pool.cc", + "src/cpp/server/dynamic_thread_pool.cc", + "src/cpp/server/fixed_size_thread_pool.cc", + "src/cpp/server/insecure_server_credentials.cc", + "src/cpp/server/server.cc", + "src/cpp/server/server_builder.cc", + "src/cpp/server/server_context.cc", + "src/cpp/server/server_credentials.cc", + "src/cpp/util/byte_buffer.cc", + "src/cpp/util/slice.cc", + "src/cpp/util/status.cc", + "src/cpp/util/string_ref.cc", + "src/cpp/util/time.cc" + ] + }, + { + "name": "grpc_base", + "public_headers": [ + "include/grpc/byte_buffer.h", + "include/grpc/byte_buffer_reader.h", + "include/grpc/compression.h", + "include/grpc/grpc.h", + "include/grpc/status.h" + ], + "headers": [ + "src/core/census/grpc_filter.h", + "src/core/channel/channel_args.h", + "src/core/channel/channel_stack.h", + "src/core/channel/client_channel.h", + "src/core/channel/compress_filter.h", + "src/core/channel/connected_channel.h", + "src/core/channel/context.h", + "src/core/channel/http_client_filter.h", + "src/core/channel/http_server_filter.h", + "src/core/channel/noop_filter.h", + "src/core/client_config/client_config.h", + "src/core/client_config/connector.h", + "src/core/client_config/lb_policies/pick_first.h", + "src/core/client_config/lb_policy.h", + "src/core/client_config/resolver.h", + "src/core/client_config/resolver_factory.h", + "src/core/client_config/resolver_registry.h", + "src/core/client_config/resolvers/dns_resolver.h", + "src/core/client_config/resolvers/sockaddr_resolver.h", + "src/core/client_config/subchannel.h", + "src/core/client_config/subchannel_factory.h", + "src/core/client_config/subchannel_factory_decorators/add_channel_arg.h", + "src/core/client_config/subchannel_factory_decorators/merge_channel_args.h", + "src/core/client_config/uri_parser.h", + "src/core/compression/message_compress.h", + "src/core/debug/trace.h", + "src/core/httpcli/format_request.h", + "src/core/httpcli/httpcli.h", + "src/core/httpcli/parser.h", + "src/core/iomgr/alarm.h", + "src/core/iomgr/alarm_heap.h", + "src/core/iomgr/alarm_internal.h", + "src/core/iomgr/endpoint.h", + "src/core/iomgr/endpoint_pair.h", + "src/core/iomgr/fd_posix.h", + "src/core/iomgr/iocp_windows.h", + "src/core/iomgr/iomgr.h", + "src/core/iomgr/iomgr_internal.h", + "src/core/iomgr/iomgr_posix.h", + "src/core/iomgr/pollset.h", + "src/core/iomgr/pollset_posix.h", + "src/core/iomgr/pollset_set.h", + "src/core/iomgr/pollset_set_posix.h", + "src/core/iomgr/pollset_set_windows.h", + "src/core/iomgr/pollset_windows.h", + "src/core/iomgr/resolve_address.h", + "src/core/iomgr/sockaddr.h", + "src/core/iomgr/sockaddr_posix.h", + "src/core/iomgr/sockaddr_utils.h", + "src/core/iomgr/sockaddr_win32.h", + "src/core/iomgr/socket_utils_posix.h", + "src/core/iomgr/socket_windows.h", + "src/core/iomgr/tcp_client.h", + "src/core/iomgr/tcp_posix.h", + "src/core/iomgr/tcp_server.h", + "src/core/iomgr/tcp_windows.h", + "src/core/iomgr/time_averaged_stats.h", + "src/core/iomgr/udp_server.h", + "src/core/iomgr/wakeup_fd_pipe.h", + "src/core/iomgr/wakeup_fd_posix.h", + "src/core/json/json.h", + "src/core/json/json_common.h", + "src/core/json/json_reader.h", + "src/core/json/json_writer.h", + "src/core/profiling/timers.h", + "src/core/profiling/timers_preciseclock.h", + "src/core/statistics/census_interface.h", + "src/core/statistics/census_rpc_stats.h", + "src/core/surface/byte_buffer_queue.h", + "src/core/surface/call.h", + "src/core/surface/channel.h", + "src/core/surface/completion_queue.h", + "src/core/surface/event_string.h", + "src/core/surface/init.h", + "src/core/surface/server.h", + "src/core/surface/surface_trace.h", + "src/core/transport/chttp2/alpn.h", + "src/core/transport/chttp2/bin_encoder.h", + "src/core/transport/chttp2/frame.h", + "src/core/transport/chttp2/frame_data.h", + "src/core/transport/chttp2/frame_goaway.h", + "src/core/transport/chttp2/frame_ping.h", + "src/core/transport/chttp2/frame_rst_stream.h", + "src/core/transport/chttp2/frame_settings.h", + "src/core/transport/chttp2/frame_window_update.h", + "src/core/transport/chttp2/hpack_parser.h", + "src/core/transport/chttp2/hpack_table.h", + "src/core/transport/chttp2/http2_errors.h", + "src/core/transport/chttp2/huffsyms.h", + "src/core/transport/chttp2/incoming_metadata.h", + "src/core/transport/chttp2/internal.h", + "src/core/transport/chttp2/status_conversion.h", + "src/core/transport/chttp2/stream_encoder.h", + "src/core/transport/chttp2/stream_map.h", + "src/core/transport/chttp2/timeout_encoding.h", + "src/core/transport/chttp2/varint.h", + "src/core/transport/chttp2_transport.h", + "src/core/transport/connectivity_state.h", + "src/core/transport/metadata.h", + "src/core/transport/stream_op.h", + "src/core/transport/transport.h", + "src/core/transport/transport_impl.h" + ], + "src": [ + "src/core/census/grpc_context.c", + "src/core/census/grpc_filter.c", + "src/core/channel/channel_args.c", + "src/core/channel/channel_stack.c", + "src/core/channel/client_channel.c", + "src/core/channel/compress_filter.c", + "src/core/channel/connected_channel.c", + "src/core/channel/http_client_filter.c", + "src/core/channel/http_server_filter.c", + "src/core/channel/noop_filter.c", + "src/core/client_config/client_config.c", + "src/core/client_config/connector.c", + "src/core/client_config/lb_policies/pick_first.c", + "src/core/client_config/lb_policy.c", + "src/core/client_config/resolver.c", + "src/core/client_config/resolver_factory.c", + "src/core/client_config/resolver_registry.c", + "src/core/client_config/resolvers/dns_resolver.c", + "src/core/client_config/resolvers/sockaddr_resolver.c", + "src/core/client_config/subchannel.c", + "src/core/client_config/subchannel_factory.c", + "src/core/client_config/subchannel_factory_decorators/add_channel_arg.c", + "src/core/client_config/subchannel_factory_decorators/merge_channel_args.c", + "src/core/client_config/uri_parser.c", + "src/core/compression/algorithm.c", + "src/core/compression/message_compress.c", + "src/core/debug/trace.c", + "src/core/httpcli/format_request.c", + "src/core/httpcli/httpcli.c", + "src/core/httpcli/parser.c", + "src/core/iomgr/alarm.c", + "src/core/iomgr/alarm_heap.c", + "src/core/iomgr/endpoint.c", + "src/core/iomgr/endpoint_pair_posix.c", + "src/core/iomgr/endpoint_pair_windows.c", + "src/core/iomgr/fd_posix.c", + "src/core/iomgr/iocp_windows.c", + "src/core/iomgr/iomgr.c", + "src/core/iomgr/iomgr_posix.c", + "src/core/iomgr/iomgr_windows.c", + "src/core/iomgr/pollset_multipoller_with_epoll.c", + "src/core/iomgr/pollset_multipoller_with_poll_posix.c", + "src/core/iomgr/pollset_posix.c", + "src/core/iomgr/pollset_set_posix.c", + "src/core/iomgr/pollset_set_windows.c", + "src/core/iomgr/pollset_windows.c", + "src/core/iomgr/resolve_address_posix.c", + "src/core/iomgr/resolve_address_windows.c", + "src/core/iomgr/sockaddr_utils.c", + "src/core/iomgr/socket_utils_common_posix.c", + "src/core/iomgr/socket_utils_linux.c", + "src/core/iomgr/socket_utils_posix.c", + "src/core/iomgr/socket_windows.c", + "src/core/iomgr/tcp_client_posix.c", + "src/core/iomgr/tcp_client_windows.c", + "src/core/iomgr/tcp_posix.c", + "src/core/iomgr/tcp_server_posix.c", + "src/core/iomgr/tcp_server_windows.c", + "src/core/iomgr/tcp_windows.c", + "src/core/iomgr/time_averaged_stats.c", + "src/core/iomgr/udp_server.c", + "src/core/iomgr/wakeup_fd_eventfd.c", + "src/core/iomgr/wakeup_fd_nospecial.c", + "src/core/iomgr/wakeup_fd_pipe.c", + "src/core/iomgr/wakeup_fd_posix.c", + "src/core/json/json.c", + "src/core/json/json_reader.c", + "src/core/json/json_string.c", + "src/core/json/json_writer.c", + "src/core/profiling/basic_timers.c", + "src/core/profiling/stap_timers.c", + "src/core/surface/api_trace.c", + "src/core/surface/byte_buffer.c", + "src/core/surface/byte_buffer_queue.c", + "src/core/surface/byte_buffer_reader.c", + "src/core/surface/call.c", + "src/core/surface/call_details.c", + "src/core/surface/call_log_batch.c", + "src/core/surface/channel.c", + "src/core/surface/channel_connectivity.c", + "src/core/surface/channel_create.c", + "src/core/surface/completion_queue.c", + "src/core/surface/event_string.c", + "src/core/surface/init.c", + "src/core/surface/lame_client.c", + "src/core/surface/metadata_array.c", + "src/core/surface/server.c", + "src/core/surface/server_chttp2.c", + "src/core/surface/server_create.c", + "src/core/surface/surface_trace.c", + "src/core/surface/version.c", + "src/core/transport/chttp2/alpn.c", + "src/core/transport/chttp2/bin_encoder.c", + "src/core/transport/chttp2/frame_data.c", + "src/core/transport/chttp2/frame_goaway.c", + "src/core/transport/chttp2/frame_ping.c", + "src/core/transport/chttp2/frame_rst_stream.c", + "src/core/transport/chttp2/frame_settings.c", + "src/core/transport/chttp2/frame_window_update.c", + "src/core/transport/chttp2/hpack_parser.c", + "src/core/transport/chttp2/hpack_table.c", + "src/core/transport/chttp2/huffsyms.c", + "src/core/transport/chttp2/incoming_metadata.c", + "src/core/transport/chttp2/parsing.c", + "src/core/transport/chttp2/status_conversion.c", + "src/core/transport/chttp2/stream_encoder.c", + "src/core/transport/chttp2/stream_lists.c", + "src/core/transport/chttp2/stream_map.c", + "src/core/transport/chttp2/timeout_encoding.c", + "src/core/transport/chttp2/varint.c", + "src/core/transport/chttp2/writing.c", + "src/core/transport/chttp2_transport.c", + "src/core/transport/connectivity_state.c", + "src/core/transport/metadata.c", + "src/core/transport/stream_op.c", + "src/core/transport/transport.c", + "src/core/transport/transport_op_string.c" + ] + }, + { + "name": "grpc_test_util_base", + "headers": [ + "test/core/end2end/cq_verifier.h", + "test/core/end2end/fixtures/proxy.h", + "test/core/iomgr/endpoint_tests.h", + "test/core/security/oauth2_utils.h", + "test/core/util/grpc_profiler.h", + "test/core/util/parse_hexstring.h", + "test/core/util/port.h", + "test/core/util/slice_splitter.h" + ], + "src": [ + "test/core/end2end/cq_verifier.c", + "test/core/end2end/fixtures/proxy.c", + "test/core/iomgr/endpoint_tests.c", + "test/core/security/oauth2_utils.c", + "test/core/util/grpc_profiler.c", + "test/core/util/parse_hexstring.c", + "test/core/util/port_posix.c", + "test/core/util/port_windows.c", + "test/core/util/slice_splitter.c" + ] + } + ], + "libs": [ + { + "name": "gpr", + "build": "all", + "language": "c", + "public_headers": [ + "include/grpc/support/alloc.h", + "include/grpc/support/atm.h", + "include/grpc/support/atm_gcc_atomic.h", + "include/grpc/support/atm_gcc_sync.h", + "include/grpc/support/atm_win32.h", + "include/grpc/support/cmdline.h", + "include/grpc/support/cpu.h", + "include/grpc/support/histogram.h", + "include/grpc/support/host_port.h", + "include/grpc/support/log.h", + "include/grpc/support/log_win32.h", + "include/grpc/support/port_platform.h", + "include/grpc/support/slice.h", + "include/grpc/support/slice_buffer.h", + "include/grpc/support/string_util.h", + "include/grpc/support/subprocess.h", + "include/grpc/support/sync.h", + "include/grpc/support/sync_generic.h", + "include/grpc/support/sync_posix.h", + "include/grpc/support/sync_win32.h", + "include/grpc/support/thd.h", + "include/grpc/support/time.h", + "include/grpc/support/tls.h", + "include/grpc/support/tls_gcc.h", + "include/grpc/support/tls_msvc.h", + "include/grpc/support/tls_pthread.h", + "include/grpc/support/useful.h" + ], + "headers": [ + "src/core/support/env.h", + "src/core/support/file.h", + "src/core/support/murmur_hash.h", + "src/core/support/stack_lockfree.h", + "src/core/support/string.h", + "src/core/support/string_win32.h", + "src/core/support/thd_internal.h" + ], + "src": [ + "src/core/support/alloc.c", + "src/core/support/cmdline.c", + "src/core/support/cpu_iphone.c", + "src/core/support/cpu_linux.c", + "src/core/support/cpu_posix.c", + "src/core/support/cpu_windows.c", + "src/core/support/env_linux.c", + "src/core/support/env_posix.c", + "src/core/support/env_win32.c", + "src/core/support/file.c", + "src/core/support/file_posix.c", + "src/core/support/file_win32.c", + "src/core/support/histogram.c", + "src/core/support/host_port.c", + "src/core/support/log.c", + "src/core/support/log_android.c", + "src/core/support/log_linux.c", + "src/core/support/log_posix.c", + "src/core/support/log_win32.c", + "src/core/support/murmur_hash.c", + "src/core/support/slice.c", + "src/core/support/slice_buffer.c", + "src/core/support/stack_lockfree.c", + "src/core/support/string.c", + "src/core/support/string_posix.c", + "src/core/support/string_win32.c", + "src/core/support/subprocess_posix.c", + "src/core/support/sync.c", + "src/core/support/sync_posix.c", + "src/core/support/sync_win32.c", + "src/core/support/thd.c", + "src/core/support/thd_posix.c", + "src/core/support/thd_win32.c", + "src/core/support/time.c", + "src/core/support/time_posix.c", + "src/core/support/time_win32.c", + "src/core/support/tls_pthread.c" + ], + "secure": "no", + "vs_project_guid": "{B23D3D1A-9438-4EDA-BEB6-9A0A03D17792}" + }, + { + "name": "gpr_test_util", + "build": "private", + "language": "c", + "headers": [ + "test/core/util/test_config.h" + ], + "src": [ + "test/core/util/test_config.c" + ], + "deps": [ + "gpr" + ], + "secure": "no", + "vs_project_guid": "{EAB0A629-17A9-44DB-B5FF-E91A721FE037}" + }, + { + "name": "grpc", + "build": "all", + "language": "c", + "public_headers": [ + "include/grpc/grpc_security.h" + ], + "headers": [ + "src/core/security/auth_filters.h", + "src/core/security/base64.h", + "src/core/security/credentials.h", + "src/core/security/json_token.h", + "src/core/security/jwt_verifier.h", + "src/core/security/secure_endpoint.h", + "src/core/security/secure_transport_setup.h", + "src/core/security/security_connector.h", + "src/core/security/security_context.h", + "src/core/tsi/fake_transport_security.h", + "src/core/tsi/ssl_transport_security.h", + "src/core/tsi/transport_security.h", + "src/core/tsi/transport_security_interface.h" + ], + "src": [ + "src/core/httpcli/httpcli_security_connector.c", + "src/core/security/base64.c", + "src/core/security/client_auth_filter.c", + "src/core/security/credentials.c", + "src/core/security/credentials_metadata.c", + "src/core/security/credentials_posix.c", + "src/core/security/credentials_win32.c", + "src/core/security/google_default_credentials.c", + "src/core/security/json_token.c", + "src/core/security/jwt_verifier.c", + "src/core/security/secure_endpoint.c", + "src/core/security/secure_transport_setup.c", + "src/core/security/security_connector.c", + "src/core/security/security_context.c", + "src/core/security/server_auth_filter.c", + "src/core/security/server_secure_chttp2.c", + "src/core/surface/init_secure.c", + "src/core/surface/secure_channel_create.c", + "src/core/tsi/fake_transport_security.c", + "src/core/tsi/ssl_transport_security.c", + "src/core/tsi/transport_security.c" + ], + "deps": [ + "gpr" + ], + "baselib": true, + "dll": "yes", + "filegroups": [ + "grpc_base", + "census" + ], + "secure": "yes", + "vs_project_guid": "{29D16885-7228-4C31-81ED-5F9187C7F2A9}" + }, + { + "name": "grpc_test_util", + "build": "private", + "language": "c", + "headers": [ + "test/core/end2end/data/ssl_test_data.h" + ], + "src": [ + "test/core/end2end/data/server1_cert.c", + "test/core/end2end/data/server1_key.c", + "test/core/end2end/data/test_root_cert.c" + ], + "deps": [ + "gpr", + "gpr_test_util", + "grpc" + ], + "filegroups": [ + "grpc_test_util_base" + ], + "vs_project_guid": "{17BCAFC0-5FDC-4C94-AEB9-95F3E220614B}" + }, + { + "name": "grpc_test_util_unsecure", + "build": "private", + "language": "c", + "deps": [ + "gpr", + "gpr_test_util", + "grpc" + ], + "filegroups": [ + "grpc_test_util_base" + ], + "secure": "no", + "vs_project_guid": "{0A7E7F92-FDEA-40F1-A9EC-3BA484F98BBF}" + }, + { + "name": "grpc_unsecure", + "build": "all", + "language": "c", + "src": [ + "src/core/surface/init_unsecure.c" + ], + "deps": [ + "gpr" + ], + "baselib": true, + "dll": "yes", + "filegroups": [ + "grpc_base", + "census" + ], + "secure": "no", + "vs_project_guid": "{46CEDFFF-9692-456A-AA24-38B5D6BCF4C5}" + }, + { + "name": "grpc_zookeeper", + "build": "all", + "language": "c", + "public_headers": [ + "include/grpc/grpc_zookeeper.h" + ], + "headers": [ + "src/core/client_config/resolvers/zookeeper_resolver.h" + ], + "src": [ + "src/core/client_config/resolvers/zookeeper_resolver.c" + ], + "deps": [ + "gpr", + "grpc" + ], + "external_deps": [ + "zookeeper" + ], + "secure": "no" + }, + { + "name": "reconnect_server", + "build": "private", + "language": "c", + "headers": [ + "test/core/util/reconnect_server.h" + ], + "src": [ + "test/core/util/reconnect_server.c" + ], + "deps": [ + "grpc_test_util", + "grpc", + "gpr_test_util", + "gpr" + ] + }, + { + "name": "grpc++", + "build": "all", + "language": "c++", + "headers": [ + "src/cpp/client/secure_credentials.h", + "src/cpp/common/secure_auth_context.h", + "src/cpp/server/secure_server_credentials.h" + ], + "src": [ + "src/cpp/client/secure_channel_arguments.cc", + "src/cpp/client/secure_credentials.cc", + "src/cpp/common/auth_property_iterator.cc", + "src/cpp/common/secure_auth_context.cc", + "src/cpp/common/secure_create_auth_context.cc", + "src/cpp/server/secure_server_credentials.cc" + ], + "deps": [ + "gpr", + "grpc" + ], + "baselib": true, + "dll": "yes", + "filegroups": [ + "grpc++_base" + ], + "secure": "check", + "vs_project_guid": "{C187A093-A0FE-489D-A40A-6E33DE0F9FEB}" + }, + { + "name": "grpc++_test_config", + "build": "private", + "language": "c++", + "headers": [ + "test/cpp/util/test_config.h" + ], + "src": [ + "test/cpp/util/test_config.cc" + ] + }, + { + "name": "grpc++_test_util", + "build": "private", + "language": "c++", + "headers": [ + "test/cpp/util/cli_call.h", + "test/cpp/util/create_test_channel.h", + "test/cpp/util/subprocess.h" + ], + "src": [ + "test/cpp/util/messages.proto", + "test/cpp/util/echo.proto", + "test/cpp/util/echo_duplicate.proto", + "test/cpp/util/cli_call.cc", + "test/cpp/util/create_test_channel.cc", + "test/cpp/util/subprocess.cc" + ], + "deps": [ + "grpc++", + "grpc_test_util" + ] + }, + { + "name": "grpc++_unsecure", + "build": "all", + "language": "c++", + "src": [ + "src/cpp/common/insecure_create_auth_context.cc" + ], + "deps": [ + "gpr", + "grpc_unsecure" + ], + "baselib": true, + "dll": "yes", + "filegroups": [ + "grpc++_base" + ], + "secure": "no", + "vs_project_guid": "{6EE56155-DF7C-4F6E-BFC4-F6F776BEB211}" + }, + { + "name": "grpc_plugin_support", + "build": "protoc", + "language": "c++", + "headers": [ + "include/grpc++/support/config.h", + "include/grpc++/support/config_protobuf.h", + "src/compiler/config.h", + "src/compiler/cpp_generator.h", + "src/compiler/cpp_generator_helpers.h", + "src/compiler/csharp_generator.h", + "src/compiler/csharp_generator_helpers.h", + "src/compiler/generator_helpers.h", + "src/compiler/objective_c_generator.h", + "src/compiler/objective_c_generator_helpers.h", + "src/compiler/python_generator.h", + "src/compiler/ruby_generator.h", + "src/compiler/ruby_generator_helpers-inl.h", + "src/compiler/ruby_generator_map-inl.h", + "src/compiler/ruby_generator_string-inl.h" + ], + "src": [ + "src/compiler/cpp_generator.cc", + "src/compiler/csharp_generator.cc", + "src/compiler/objective_c_generator.cc", + "src/compiler/python_generator.cc", + "src/compiler/ruby_generator.cc" + ], + "deps": [], + "secure": "no", + "vs_project_guid": "{B6E81D84-2ACB-41B8-8781-493A944C7817}" + }, + { + "name": "interop_client_helper", + "build": "private", + "language": "c++", + "headers": [ + "test/cpp/interop/client_helper.h" + ], + "src": [ + "test/proto/messages.proto", + "test/cpp/interop/client_helper.cc" + ], + "deps": [ + "grpc++_test_util", + "grpc_test_util", + "grpc++", + "grpc", + "gpr" + ] + }, + { + "name": "interop_client_main", + "build": "private", + "language": "c++", + "headers": [ + "test/cpp/interop/interop_client.h" + ], + "src": [ + "test/proto/empty.proto", + "test/proto/messages.proto", + "test/proto/test.proto", + "test/cpp/interop/client.cc", + "test/cpp/interop/interop_client.cc" + ], + "deps": [ + "interop_client_helper", + "grpc++_test_util", + "grpc_test_util", + "grpc++", + "grpc", + "gpr_test_util", + "gpr", + "grpc++_test_config" + ] + }, + { + "name": "interop_server_helper", + "build": "private", + "language": "c++", + "headers": [ + "test/cpp/interop/server_helper.h" + ], + "src": [ + "test/cpp/interop/server_helper.cc" + ], + "deps": [ + "grpc_test_util", + "grpc++", + "grpc", + "gpr" + ] + }, + { + "name": "interop_server_main", + "build": "private", + "language": "c++", + "src": [ + "test/proto/empty.proto", + "test/proto/messages.proto", + "test/proto/test.proto", + "test/cpp/interop/server.cc" + ], + "deps": [ + "interop_server_helper", + "grpc++_test_util", + "grpc_test_util", + "grpc++", + "grpc", + "gpr_test_util", + "gpr", + "grpc++_test_config" + ] + }, + { + "name": "pubsub_client_lib", + "build": "do_not_build", + "language": "c++", + "headers": [ + "examples/pubsub/publisher.h", + "examples/pubsub/subscriber.h" + ], + "src": [ + "examples/pubsub/label.proto", + "examples/pubsub/empty.proto", + "examples/pubsub/pubsub.proto", + "examples/pubsub/publisher.cc", + "examples/pubsub/subscriber.cc" + ], + "deps": [ + "grpc++", + "grpc", + "gpr" + ] + }, + { + "name": "qps", + "build": "private", + "language": "c++", + "headers": [ + "test/cpp/qps/client.h", + "test/cpp/qps/driver.h", + "test/cpp/qps/histogram.h", + "test/cpp/qps/interarrival.h", + "test/cpp/qps/perf_db_client.h", + "test/cpp/qps/qps_worker.h", + "test/cpp/qps/report.h", + "test/cpp/qps/server.h", + "test/cpp/qps/stats.h", + "test/cpp/qps/timer.h", + "test/cpp/util/benchmark_config.h" + ], + "src": [ + "test/cpp/qps/qpstest.proto", + "test/cpp/qps/perf_db.proto", + "test/cpp/qps/client_async.cc", + "test/cpp/qps/client_sync.cc", + "test/cpp/qps/driver.cc", + "test/cpp/qps/perf_db_client.cc", + "test/cpp/qps/qps_worker.cc", + "test/cpp/qps/report.cc", + "test/cpp/qps/server_async.cc", + "test/cpp/qps/server_sync.cc", + "test/cpp/qps/timer.cc", + "test/cpp/util/benchmark_config.cc" + ], + "deps": [ + "grpc_test_util", + "grpc++_test_util", + "grpc++" + ] + }, + { + "name": "grpc_csharp_ext", + "build": "all", + "language": "csharp", + "src": [ + "src/csharp/ext/grpc_csharp_ext.c" + ], + "deps": [ + "gpr", + "grpc" + ], + "dll": "only", + "vs_project_guid": "{D64C6D63-4458-4A88-AB38-35678384A7E4}" + } + ], + "targets": [ + { + "name": "alarm_heap_test", + "build": "test", + "language": "c", + "src": [ + "test/core/iomgr/alarm_heap_test.c" + ], + "deps": [ + "grpc_test_util", + "grpc", + "gpr_test_util", + "gpr" + ] + }, + { + "name": "alarm_list_test", + "build": "test", + "language": "c", + "src": [ + "test/core/iomgr/alarm_list_test.c" + ], + "deps": [ + "grpc_test_util", + "grpc", + "gpr_test_util", + "gpr" + ] + }, + { + "name": "alarm_test", + "build": "test", + "language": "c", + "src": [ + "test/core/iomgr/alarm_test.c" + ], + "deps": [ + "grpc_test_util", + "grpc", + "gpr_test_util", + "gpr" + ] + }, + { + "name": "alpn_test", + "build": "test", + "language": "c", + "src": [ + "test/core/transport/chttp2/alpn_test.c" + ], + "deps": [ + "grpc_test_util", + "grpc", + "gpr_test_util", + "gpr" + ] + }, + { + "name": "bin_encoder_test", + "build": "test", + "language": "c", + "src": [ + "test/core/transport/chttp2/bin_encoder_test.c" + ], + "deps": [ + "grpc_test_util", + "grpc", + "gpr_test_util", + "gpr" + ] + }, + { + "name": "chttp2_status_conversion_test", + "build": "test", + "language": "c", + "src": [ + "test/core/transport/chttp2/status_conversion_test.c" + ], + "deps": [ + "grpc_test_util", + "grpc", + "gpr_test_util", + "gpr" + ] + }, + { + "name": "chttp2_stream_encoder_test", + "build": "test", + "language": "c", + "src": [ + "test/core/transport/chttp2/stream_encoder_test.c" + ], + "deps": [ + "grpc_test_util", + "grpc", + "gpr_test_util", + "gpr" + ] + }, + { + "name": "chttp2_stream_map_test", + "build": "test", + "language": "c", + "src": [ + "test/core/transport/chttp2/stream_map_test.c" + ], + "deps": [ + "grpc_test_util", + "grpc", + "gpr_test_util", + "gpr" + ] + }, + { + "name": "compression_test", + "build": "test", + "language": "c", + "src": [ + "test/core/compression/compression_test.c" + ], + "deps": [ + "grpc_test_util", + "grpc", + "gpr_test_util", + "gpr" + ] + }, + { + "name": "dualstack_socket_test", + "build": "test", + "language": "c", + "src": [ + "test/core/end2end/dualstack_socket_test.c" + ], + "deps": [ + "grpc_test_util", + "grpc", + "gpr_test_util", + "gpr" + ], + "platforms": [ + "mac", + "linux", + "posix" + ] + }, + { + "name": "fd_conservation_posix_test", + "build": "test", + "language": "c", + "src": [ + "test/core/iomgr/fd_conservation_posix_test.c" + ], + "deps": [ + "grpc_test_util", + "grpc", + "gpr_test_util", + "gpr" + ], + "platforms": [ + "mac", + "linux", + "posix" + ] + }, + { + "name": "fd_posix_test", + "build": "test", + "language": "c", + "src": [ + "test/core/iomgr/fd_posix_test.c" + ], + "deps": [ + "grpc_test_util", + "grpc", + "gpr_test_util", + "gpr" + ], + "platforms": [ + "mac", + "linux", + "posix" + ] + }, + { + "name": "fling_client", + "build": "test", + "run": false, + "language": "c", + "src": [ + "test/core/fling/client.c" + ], + "deps": [ + "grpc_test_util", + "grpc", + "gpr_test_util", + "gpr" + ] + }, + { + "name": "fling_server", + "build": "test", + "run": false, + "language": "c", + "src": [ + "test/core/fling/server.c" + ], + "deps": [ + "grpc_test_util", + "grpc", + "gpr_test_util", + "gpr" + ] + }, + { + "name": "fling_stream_test", + "build": "test", + "language": "c", + "src": [ + "test/core/fling/fling_stream_test.c" + ], + "deps": [ + "grpc_test_util", + "grpc", + "gpr_test_util", + "gpr" + ], + "platforms": [ + "mac", + "linux", + "posix" + ] + }, + { + "name": "fling_test", + "build": "test", + "language": "c", + "src": [ + "test/core/fling/fling_test.c" + ], + "deps": [ + "grpc_test_util", + "grpc", + "gpr_test_util", + "gpr" + ], + "platforms": [ + "mac", + "linux", + "posix" + ] + }, + { + "name": "gen_hpack_tables", + "build": "tool", + "language": "c", + "src": [ + "tools/codegen/core/gen_hpack_tables.c" + ], + "deps": [ + "gpr", + "grpc" + ] + }, + { + "name": "gpr_cmdline_test", + "build": "test", + "language": "c", + "src": [ + "test/core/support/cmdline_test.c" + ], + "deps": [ + "gpr_test_util", + "gpr" + ] + }, + { + "name": "gpr_env_test", + "build": "test", + "language": "c", + "src": [ + "test/core/support/env_test.c" + ], + "deps": [ + "gpr_test_util", + "gpr" + ] + }, + { + "name": "gpr_file_test", + "build": "test", + "language": "c", + "src": [ + "test/core/support/file_test.c" + ], + "deps": [ + "gpr_test_util", + "gpr" + ] + }, + { + "name": "gpr_histogram_test", + "build": "test", + "language": "c", + "src": [ + "test/core/support/histogram_test.c" + ], + "deps": [ + "gpr_test_util", + "gpr" + ] + }, + { + "name": "gpr_host_port_test", + "build": "test", + "language": "c", + "src": [ + "test/core/support/host_port_test.c" + ], + "deps": [ + "gpr_test_util", + "gpr" + ] + }, + { + "name": "gpr_log_test", + "build": "test", + "language": "c", + "src": [ + "test/core/support/log_test.c" + ], + "deps": [ + "gpr_test_util", + "gpr" + ] + }, + { + "name": "gpr_slice_buffer_test", + "build": "test", + "language": "c", + "src": [ + "test/core/support/slice_buffer_test.c" + ], + "deps": [ + "gpr_test_util", + "gpr" + ] + }, + { + "name": "gpr_slice_test", + "build": "test", + "language": "c", + "src": [ + "test/core/support/slice_test.c" + ], + "deps": [ + "gpr_test_util", + "gpr" + ] + }, + { + "name": "gpr_stack_lockfree_test", + "build": "test", + "language": "c", + "src": [ + "test/core/support/stack_lockfree_test.c" + ], + "deps": [ + "gpr_test_util", + "gpr" + ] + }, + { + "name": "gpr_string_test", + "build": "test", + "language": "c", + "src": [ + "test/core/support/string_test.c" + ], + "deps": [ + "gpr_test_util", + "gpr" + ] + }, + { + "name": "gpr_sync_test", + "build": "test", + "language": "c", + "src": [ + "test/core/support/sync_test.c" + ], + "deps": [ + "gpr_test_util", + "gpr" + ] + }, + { + "name": "gpr_thd_test", + "build": "test", + "language": "c", + "src": [ + "test/core/support/thd_test.c" + ], + "deps": [ + "gpr_test_util", + "gpr" + ] + }, + { + "name": "gpr_time_test", + "build": "test", + "language": "c", + "src": [ + "test/core/support/time_test.c" + ], + "deps": [ + "gpr_test_util", + "gpr" + ] + }, + { + "name": "gpr_tls_test", + "build": "test", + "language": "c", + "src": [ + "test/core/support/tls_test.c" + ], + "deps": [ + "gpr_test_util", + "gpr" + ] + }, + { + "name": "gpr_useful_test", + "build": "test", + "language": "c", + "src": [ + "test/core/support/useful_test.c" + ], + "deps": [ + "gpr_test_util", + "gpr" + ] + }, + { + "name": "grpc_auth_context_test", + "build": "test", + "language": "c", + "src": [ + "test/core/security/auth_context_test.c" + ], + "deps": [ + "grpc_test_util", + "grpc", + "gpr_test_util", + "gpr" + ] + }, + { + "name": "grpc_base64_test", + "build": "test", + "language": "c", + "src": [ + "test/core/security/base64_test.c" + ], + "deps": [ + "grpc_test_util", + "grpc", + "gpr_test_util", + "gpr" + ] + }, + { + "name": "grpc_byte_buffer_reader_test", + "build": "test", + "language": "c", + "src": [ + "test/core/surface/byte_buffer_reader_test.c" + ], + "deps": [ + "grpc_test_util", + "grpc", + "gpr_test_util", + "gpr" + ] + }, + { + "name": "grpc_channel_args_test", + "build": "test", + "language": "c", + "src": [ + "test/core/channel/channel_args_test.c" + ], + "deps": [ + "grpc_test_util", + "grpc", + "gpr_test_util", + "gpr" + ] + }, + { + "name": "grpc_channel_stack_test", + "build": "test", + "language": "c", + "src": [ + "test/core/channel/channel_stack_test.c" + ], + "deps": [ + "grpc_test_util", + "grpc", + "gpr_test_util", + "gpr" + ] + }, + { + "name": "grpc_completion_queue_test", + "build": "test", + "language": "c", + "src": [ + "test/core/surface/completion_queue_test.c" + ], + "deps": [ + "grpc_test_util", + "grpc", + "gpr_test_util", + "gpr" + ] + }, + { + "name": "grpc_create_jwt", + "build": "tool", + "language": "c", + "src": [ + "test/core/security/create_jwt.c" + ], + "deps": [ + "grpc_test_util", + "grpc", + "gpr_test_util", + "gpr" + ] + }, + { + "name": "grpc_credentials_test", + "build": "test", + "language": "c", + "src": [ + "test/core/security/credentials_test.c" + ], + "deps": [ + "grpc_test_util", + "grpc", + "gpr_test_util", + "gpr" + ] + }, + { + "name": "grpc_fetch_oauth2", + "build": "tool", + "language": "c", + "src": [ + "test/core/security/fetch_oauth2.c" + ], + "deps": [ + "grpc_test_util", + "grpc", + "gpr_test_util", + "gpr" + ] + }, + { + "name": "grpc_json_token_test", + "build": "test", + "language": "c", + "src": [ + "test/core/security/json_token_test.c" + ], + "deps": [ + "grpc_test_util", + "grpc", + "gpr_test_util", + "gpr" + ] + }, + { + "name": "grpc_jwt_verifier_test", + "build": "test", + "language": "c", + "src": [ + "test/core/security/jwt_verifier_test.c" + ], + "deps": [ + "grpc_test_util", + "grpc", + "gpr_test_util", + "gpr" + ] + }, + { + "name": "grpc_print_google_default_creds_token", + "build": "tool", + "language": "c", + "src": [ + "test/core/security/print_google_default_creds_token.c" + ], + "deps": [ + "grpc_test_util", + "grpc", + "gpr_test_util", + "gpr" + ] + }, + { + "name": "grpc_security_connector_test", + "build": "test", + "language": "c", + "src": [ + "test/core/security/security_connector_test.c" + ], + "deps": [ + "grpc_test_util", + "grpc", + "gpr_test_util", + "gpr" + ] + }, + { + "name": "grpc_stream_op_test", + "build": "test", + "language": "c", + "src": [ + "test/core/transport/stream_op_test.c" + ], + "deps": [ + "grpc_test_util", + "grpc", + "gpr_test_util", + "gpr" + ] + }, + { + "name": "grpc_verify_jwt", + "build": "tool", + "language": "c", + "src": [ + "test/core/security/verify_jwt.c" + ], + "deps": [ + "grpc_test_util", + "grpc", + "gpr_test_util", + "gpr" + ] + }, + { + "name": "hpack_parser_test", + "build": "test", + "language": "c", + "src": [ + "test/core/transport/chttp2/hpack_parser_test.c" + ], + "deps": [ + "grpc_test_util", + "grpc", + "gpr_test_util", + "gpr" + ] + }, + { + "name": "hpack_table_test", + "build": "test", + "language": "c", + "src": [ + "test/core/transport/chttp2/hpack_table_test.c" + ], + "deps": [ + "grpc_test_util", + "grpc", + "gpr_test_util", + "gpr" + ] + }, + { + "name": "httpcli_format_request_test", + "build": "test", + "language": "c", + "src": [ + "test/core/httpcli/format_request_test.c" + ], + "deps": [ + "grpc_test_util", + "grpc", + "gpr_test_util", + "gpr" + ] + }, + { + "name": "httpcli_parser_test", + "build": "test", + "language": "c", + "src": [ + "test/core/httpcli/parser_test.c" + ], + "deps": [ + "grpc_test_util", + "grpc", + "gpr_test_util", + "gpr" + ] + }, + { + "name": "httpcli_test", + "build": "test", + "language": "c", + "src": [ + "test/core/httpcli/httpcli_test.c" + ], + "deps": [ + "grpc_test_util", + "grpc", + "gpr_test_util", + "gpr" + ], + "platforms": [ + "mac", + "linux", + "posix" + ] + }, + { + "name": "json_rewrite", + "build": "test", + "run": false, + "language": "c", + "src": [ + "test/core/json/json_rewrite.c" + ], + "deps": [ + "grpc", + "gpr" + ] + }, + { + "name": "json_rewrite_test", + "build": "test", + "language": "c", + "src": [ + "test/core/json/json_rewrite_test.c" + ], + "deps": [ + "grpc_test_util", + "grpc", + "gpr_test_util", + "gpr" + ] + }, + { + "name": "json_test", + "build": "test", + "language": "c", + "src": [ + "test/core/json/json_test.c" + ], + "deps": [ + "grpc_test_util", + "grpc", + "gpr_test_util", + "gpr" + ] + }, + { + "name": "lame_client_test", + "build": "test", + "language": "c", + "src": [ + "test/core/surface/lame_client_test.c" + ], + "deps": [ + "grpc_test_util", + "grpc", + "gpr_test_util", + "gpr" + ] + }, + { + "name": "low_level_ping_pong_benchmark", + "build": "benchmark", + "language": "c", + "src": [ + "test/core/network_benchmarks/low_level_ping_pong.c" + ], + "deps": [ + "grpc_test_util", + "grpc", + "gpr_test_util", + "gpr" + ] + }, + { + "name": "message_compress_test", + "build": "test", + "language": "c", + "src": [ + "test/core/compression/message_compress_test.c" + ], + "deps": [ + "grpc_test_util", + "grpc", + "gpr_test_util", + "gpr" + ] + }, + { + "name": "multi_init_test", + "build": "test", + "language": "c", + "src": [ + "test/core/surface/multi_init_test.c" + ], + "deps": [ + "grpc_test_util", + "grpc", + "gpr_test_util", + "gpr" + ] + }, + { + "name": "multiple_server_queues_test", + "build": "test", + "language": "c", + "src": [ + "test/core/end2end/multiple_server_queues_test.c" + ], + "deps": [ + "grpc_test_util", + "grpc", + "gpr_test_util", + "gpr" + ] + }, + { + "name": "murmur_hash_test", + "build": "test", + "language": "c", + "src": [ + "test/core/support/murmur_hash_test.c" + ], + "deps": [ + "gpr_test_util", + "gpr" + ] + }, + { + "name": "no_server_test", + "build": "test", + "language": "c", + "src": [ + "test/core/end2end/no_server_test.c" + ], + "deps": [ + "grpc_test_util", + "grpc", + "gpr_test_util", + "gpr" + ] + }, + { + "name": "resolve_address_test", + "build": "test", + "language": "c", + "src": [ + "test/core/iomgr/resolve_address_test.c" + ], + "deps": [ + "grpc_test_util", + "grpc", + "gpr_test_util", + "gpr" + ] + }, + { + "name": "secure_endpoint_test", + "build": "test", + "language": "c", + "src": [ + "test/core/security/secure_endpoint_test.c" + ], + "deps": [ + "grpc_test_util", + "grpc", + "gpr_test_util", + "gpr" + ] + }, + { + "name": "sockaddr_utils_test", + "build": "test", + "language": "c", + "src": [ + "test/core/iomgr/sockaddr_utils_test.c" + ], + "deps": [ + "grpc_test_util", + "grpc", + "gpr_test_util", + "gpr" + ] + }, + { + "name": "tcp_client_posix_test", + "build": "test", + "language": "c", + "src": [ + "test/core/iomgr/tcp_client_posix_test.c" + ], + "deps": [ + "grpc_test_util", + "grpc", + "gpr_test_util", + "gpr" + ], + "platforms": [ + "mac", + "linux", + "posix" + ] + }, + { + "name": "tcp_posix_test", + "build": "test", + "language": "c", + "src": [ + "test/core/iomgr/tcp_posix_test.c" + ], + "deps": [ + "grpc_test_util", + "grpc", + "gpr_test_util", + "gpr" + ], + "platforms": [ + "mac", + "linux", + "posix" + ] + }, + { + "name": "tcp_server_posix_test", + "build": "test", + "language": "c", + "src": [ + "test/core/iomgr/tcp_server_posix_test.c" + ], + "deps": [ + "grpc_test_util", + "grpc", + "gpr_test_util", + "gpr" + ], + "platforms": [ + "mac", + "linux", + "posix" + ] + }, + { + "name": "time_averaged_stats_test", + "build": "test", + "language": "c", + "src": [ + "test/core/iomgr/time_averaged_stats_test.c" + ], + "deps": [ + "grpc_test_util", + "grpc", + "gpr_test_util", + "gpr" + ] + }, + { + "name": "timeout_encoding_test", + "build": "test", + "language": "c", + "src": [ + "test/core/transport/chttp2/timeout_encoding_test.c" + ], + "deps": [ + "grpc_test_util", + "grpc", + "gpr_test_util", + "gpr" + ] + }, + { + "name": "timers_test", + "build": "test", + "language": "c", + "src": [ + "test/core/profiling/timers_test.c" + ], + "deps": [ + "grpc_test_util", + "grpc", + "gpr_test_util", + "gpr" + ] + }, + { + "name": "transport_metadata_test", + "build": "test", + "language": "c", + "src": [ + "test/core/transport/metadata_test.c" + ], + "deps": [ + "grpc_test_util", + "grpc", + "gpr_test_util", + "gpr" + ] + }, + { + "name": "transport_security_test", + "build": "test", + "language": "c", + "src": [ + "test/core/tsi/transport_security_test.c" + ], + "deps": [ + "grpc_test_util", + "grpc", + "gpr_test_util", + "gpr" + ] + }, + { + "name": "udp_server_test", + "build": "test", + "language": "c", + "src": [ + "test/core/iomgr/udp_server_test.c" + ], + "deps": [ + "grpc_test_util", + "grpc", + "gpr_test_util", + "gpr" + ], + "platforms": [ + "posix" + ] + }, + { + "name": "uri_parser_test", + "build": "test", + "language": "c", + "src": [ + "test/core/client_config/uri_parser_test.c" + ], + "deps": [ + "grpc_test_util", + "grpc", + "gpr_test_util", + "gpr" + ] + }, + { + "name": "async_end2end_test", + "build": "test", + "language": "c++", + "src": [ + "test/cpp/end2end/async_end2end_test.cc" + ], + "deps": [ + "grpc++_test_util", + "grpc_test_util", + "grpc++", + "grpc", + "gpr_test_util", + "gpr" + ] + }, + { + "name": "async_streaming_ping_pong_test", + "build": "test", + "language": "c++", + "src": [ + "test/cpp/qps/async_streaming_ping_pong_test.cc" + ], + "deps": [ + "qps", + "grpc++_test_util", + "grpc_test_util", + "grpc++", + "grpc", + "gpr_test_util", + "gpr" + ], + "platforms": [ + "mac", + "linux", + "posix" + ] + }, + { + "name": "async_unary_ping_pong_test", + "build": "test", + "language": "c++", + "src": [ + "test/cpp/qps/async_unary_ping_pong_test.cc" + ], + "deps": [ + "qps", + "grpc++_test_util", + "grpc_test_util", + "grpc++", + "grpc", + "gpr_test_util", + "gpr" + ], + "platforms": [ + "mac", + "linux", + "posix" + ] + }, + { + "name": "auth_property_iterator_test", + "build": "test", + "language": "c++", + "src": [ + "test/cpp/common/auth_property_iterator_test.cc" + ], + "deps": [ + "grpc++", + "grpc", + "gpr" + ] + }, + { + "name": "channel_arguments_test", + "build": "test", + "language": "c++", + "src": [ + "test/cpp/client/channel_arguments_test.cc" + ], + "deps": [ + "grpc++", + "grpc", + "gpr" + ] + }, + { + "name": "cli_call_test", + "build": "test", + "language": "c++", + "src": [ + "test/cpp/util/cli_call_test.cc" + ], + "deps": [ + "grpc++_test_util", + "grpc_test_util", + "grpc++", + "grpc", + "gpr_test_util", + "gpr" + ] + }, + { + "name": "client_crash_test", + "build": "test", + "language": "c++", + "src": [ + "test/cpp/end2end/client_crash_test.cc" + ], + "deps": [ + "grpc++_test_util", + "grpc_test_util", + "grpc++", + "grpc", + "gpr_test_util", + "gpr" + ], + "platforms": [ + "mac", + "linux", + "posix" + ] + }, + { + "name": "client_crash_test_server", + "build": "test", + "run": false, + "language": "c++", + "src": [ + "test/cpp/end2end/client_crash_test_server.cc" + ], + "deps": [ + "grpc++_test_util", + "grpc_test_util", + "grpc++", + "grpc", + "gpr_test_util", + "gpr" + ] + }, + { + "name": "credentials_test", + "build": "test", + "language": "c++", + "src": [ + "test/cpp/client/credentials_test.cc" + ], + "deps": [ + "grpc++", + "grpc", + "gpr" + ] + }, + { + "name": "cxx_byte_buffer_test", + "build": "test", + "language": "c++", + "src": [ + "test/cpp/util/byte_buffer_test.cc" + ], + "deps": [ + "grpc_test_util", + "grpc++", + "grpc", + "gpr_test_util", + "gpr" + ] + }, + { + "name": "cxx_slice_test", + "build": "test", + "language": "c++", + "src": [ + "test/cpp/util/slice_test.cc" + ], + "deps": [ + "grpc_test_util", + "grpc++", + "grpc", + "gpr_test_util", + "gpr" + ] + }, + { + "name": "cxx_string_ref_test", + "build": "test", + "language": "c++", + "src": [ + "test/cpp/util/string_ref_test.cc" + ], + "deps": [ + "grpc++" + ] + }, + { + "name": "cxx_time_test", + "build": "test", + "language": "c++", + "src": [ + "test/cpp/util/time_test.cc" + ], + "deps": [ + "grpc_test_util", + "grpc++", + "grpc", + "gpr_test_util", + "gpr" + ] + }, + { + "name": "end2end_test", + "build": "test", + "language": "c++", + "src": [ + "test/cpp/end2end/end2end_test.cc" + ], + "deps": [ + "grpc++_test_util", + "grpc_test_util", + "grpc++", + "grpc", + "gpr_test_util", + "gpr" + ] + }, + { + "name": "generic_end2end_test", + "build": "test", + "language": "c++", + "src": [ + "test/cpp/end2end/generic_end2end_test.cc" + ], + "deps": [ + "grpc++_test_util", + "grpc_test_util", + "grpc++", + "grpc", + "gpr_test_util", + "gpr" + ] + }, + { + "name": "grpc_cli", + "build": "test", + "run": false, + "language": "c++", + "src": [ + "test/cpp/util/grpc_cli.cc" + ], + "deps": [ + "grpc++_test_util", + "grpc_test_util", + "grpc++", + "grpc", + "gpr_test_util", + "gpr", + "grpc++_test_config" + ] + }, + { + "name": "grpc_cpp_plugin", + "build": "protoc", + "language": "c++", + "src": [ + "src/compiler/cpp_plugin.cc" + ], + "deps": [ + "grpc_plugin_support" + ], + "secure": "no", + "vs_project_guid": "{7E51A25F-AC59-488F-906C-C60FAAE706AA}" + }, + { + "name": "grpc_csharp_plugin", + "build": "protoc", + "language": "c++", + "src": [ + "src/compiler/csharp_plugin.cc" + ], + "deps": [ + "grpc_plugin_support" + ], + "secure": "no", + "vs_project_guid": "{3C813052-A49A-4662-B90A-1ADBEC7EE453}" + }, + { + "name": "grpc_objective_c_plugin", + "build": "protoc", + "language": "c++", + "src": [ + "src/compiler/objective_c_plugin.cc" + ], + "deps": [ + "grpc_plugin_support" + ], + "secure": "no", + "vs_project_guid": "{19564640-CEE6-4921-ABA5-676ED79A36F6}" + }, + { + "name": "grpc_python_plugin", + "build": "protoc", + "language": "c++", + "src": [ + "src/compiler/python_plugin.cc" + ], + "deps": [ + "grpc_plugin_support" + ], + "secure": "no", + "vs_project_guid": "{DF52D501-A6CF-4E6F-BA38-6EBE2E8DAFB2}" + }, + { + "name": "grpc_ruby_plugin", + "build": "protoc", + "language": "c++", + "src": [ + "src/compiler/ruby_plugin.cc" + ], + "deps": [ + "grpc_plugin_support" + ], + "secure": "no", + "vs_project_guid": "{069E9D05-B78B-4751-9252-D21EBAE7DE8E}" + }, + { + "name": "interop_client", + "build": "test", + "run": false, + "language": "c++", + "src": [], + "deps": [ + "interop_client_main", + "interop_client_helper", + "grpc++_test_util", + "grpc_test_util", + "grpc++", + "grpc", + "gpr_test_util", + "gpr", + "grpc++_test_config" + ], + "platforms": [ + "mac", + "linux", + "posix" + ] + }, + { + "name": "interop_server", + "build": "test", + "run": false, + "language": "c++", + "src": [], + "deps": [ + "interop_server_main", + "interop_server_helper", + "grpc++_test_util", + "grpc_test_util", + "grpc++", + "grpc", + "gpr_test_util", + "gpr", + "grpc++_test_config" + ], + "platforms": [ + "mac", + "linux", + "posix" + ] + }, + { + "name": "interop_test", + "build": "test", + "language": "c++", + "src": [ + "test/cpp/interop/interop_test.cc" + ], + "deps": [ + "grpc_test_util", + "grpc", + "gpr_test_util", + "gpr" + ], + "platforms": [ + "mac", + "linux", + "posix" + ] + }, + { + "name": "mock_test", + "build": "test", + "language": "c++", + "src": [ + "test/cpp/end2end/mock_test.cc" + ], + "deps": [ + "grpc++_test_util", + "grpc_test_util", + "grpc++", + "grpc", + "gpr_test_util", + "gpr" + ] + }, + { + "name": "pubsub_client", + "build": "do_not_build", + "run": false, + "language": "c++", + "src": [ + "examples/pubsub/main.cc" + ], + "deps": [ + "pubsub_client_lib", + "grpc_test_util", + "grpc++", + "grpc", + "gpr_test_util", + "gpr", + "grpc++_test_config" + ] + }, + { + "name": "pubsub_publisher_test", + "build": "do_not_build", + "language": "c++", + "src": [ + "examples/pubsub/publisher_test.cc" + ], + "deps": [ + "pubsub_client_lib", + "grpc++_test_util", + "grpc_test_util", + "grpc++", + "grpc", + "gpr_test_util", + "gpr" + ] + }, + { + "name": "pubsub_subscriber_test", + "build": "do_not_build", + "language": "c++", + "src": [ + "examples/pubsub/subscriber_test.cc" + ], + "deps": [ + "pubsub_client_lib", + "grpc++_test_util", + "grpc_test_util", + "grpc++", + "grpc", + "gpr_test_util", + "gpr" + ] + }, + { + "name": "qps_driver", + "build": "benchmark", + "language": "c++", + "src": [ + "test/cpp/qps/qps_driver.cc" + ], + "deps": [ + "qps", + "grpc++_test_util", + "grpc_test_util", + "grpc++", + "grpc", + "gpr_test_util", + "gpr", + "grpc++_test_config" + ] + }, + { + "name": "qps_interarrival_test", + "build": "test", + "run": false, + "language": "c++", + "src": [ + "test/cpp/qps/qps_interarrival_test.cc" + ], + "deps": [ + "qps", + "grpc++_test_util", + "grpc_test_util", + "grpc++", + "grpc", + "gpr_test_util", + "gpr" + ], + "platforms": [ + "mac", + "linux", + "posix" + ] + }, + { + "name": "qps_openloop_test", + "build": "test", + "language": "c++", + "src": [ + "test/cpp/qps/qps_openloop_test.cc" + ], + "deps": [ + "qps", + "grpc++_test_util", + "grpc_test_util", + "grpc++", + "grpc", + "gpr_test_util", + "gpr", + "grpc++_test_config" + ], + "platforms": [ + "mac", + "linux", + "posix" + ] + }, + { + "name": "qps_test", + "build": "test", + "language": "c++", + "src": [ + "test/cpp/qps/qps_test.cc" + ], + "deps": [ + "qps", + "grpc++_test_util", + "grpc_test_util", + "grpc++", + "grpc", + "gpr_test_util", + "gpr", + "grpc++_test_config" + ], + "exclude_configs": [ + "tsan" + ], + "platforms": [ + "mac", + "linux", + "posix" + ] + }, + { + "name": "qps_worker", + "build": "benchmark", + "language": "c++", + "headers": [ + "test/cpp/qps/client.h", + "test/cpp/qps/server.h" + ], + "src": [ + "test/cpp/qps/worker.cc" + ], + "deps": [ + "qps", + "grpc++_test_util", + "grpc_test_util", + "grpc++", + "grpc", + "gpr_test_util", + "gpr", + "grpc++_test_config" + ] + }, + { + "name": "reconnect_interop_client", + "build": "test", + "run": false, + "language": "c++", + "src": [ + "test/proto/empty.proto", + "test/proto/messages.proto", + "test/proto/test.proto", + "test/cpp/interop/reconnect_interop_client.cc" + ], + "deps": [ + "grpc++_test_util", + "grpc_test_util", + "grpc++", + "grpc", + "gpr_test_util", + "gpr", + "grpc++_test_config" + ] + }, + { + "name": "reconnect_interop_server", + "build": "test", + "run": false, + "language": "c++", + "src": [ + "test/proto/empty.proto", + "test/proto/messages.proto", + "test/proto/test.proto", + "test/cpp/interop/reconnect_interop_server.cc" + ], + "deps": [ + "reconnect_server", + "grpc++_test_util", + "grpc_test_util", + "grpc++", + "grpc", + "gpr_test_util", + "gpr", + "grpc++_test_config" + ] + }, + { + "name": "secure_auth_context_test", + "build": "test", + "language": "c++", + "src": [ + "test/cpp/common/secure_auth_context_test.cc" + ], + "deps": [ + "grpc++", + "grpc", + "gpr" + ] + }, + { + "name": "server_crash_test", + "build": "test", + "language": "c++", + "src": [ + "test/cpp/end2end/server_crash_test.cc" + ], + "deps": [ + "grpc++_test_util", + "grpc_test_util", + "grpc++", + "grpc", + "gpr_test_util", + "gpr" + ], + "platforms": [ + "mac", + "linux", + "posix" + ] + }, + { + "name": "server_crash_test_client", + "build": "test", + "run": false, + "language": "c++", + "src": [ + "test/cpp/end2end/server_crash_test_client.cc" + ], + "deps": [ + "grpc++_test_util", + "grpc_test_util", + "grpc++", + "grpc", + "gpr_test_util", + "gpr" + ] + }, + { + "name": "shutdown_test", + "build": "test", + "language": "c++", + "src": [ + "test/cpp/end2end/shutdown_test.cc" + ], + "deps": [ + "grpc++_test_util", + "grpc_test_util", + "grpc++", + "grpc", + "gpr_test_util", + "gpr" + ] + }, + { + "name": "status_test", + "build": "test", + "language": "c++", + "src": [ + "test/cpp/util/status_test.cc" + ], + "deps": [ + "grpc_test_util", + "grpc++", + "grpc", + "gpr_test_util", + "gpr" + ] + }, + { + "name": "sync_streaming_ping_pong_test", + "build": "test", + "language": "c++", + "src": [ + "test/cpp/qps/sync_streaming_ping_pong_test.cc" + ], + "deps": [ + "qps", + "grpc++_test_util", + "grpc_test_util", + "grpc++", + "grpc", + "gpr_test_util", + "gpr" + ], + "platforms": [ + "mac", + "linux", + "posix" + ] + }, + { + "name": "sync_unary_ping_pong_test", + "build": "test", + "language": "c++", + "src": [ + "test/cpp/qps/sync_unary_ping_pong_test.cc" + ], + "deps": [ + "qps", + "grpc++_test_util", + "grpc_test_util", + "grpc++", + "grpc", + "gpr_test_util", + "gpr" + ], + "platforms": [ + "mac", + "linux", + "posix" + ] + }, + { + "name": "thread_stress_test", + "build": "test", + "language": "c++", + "src": [ + "test/cpp/end2end/thread_stress_test.cc" + ], + "deps": [ + "grpc++_test_util", + "grpc_test_util", + "grpc++", + "grpc", + "gpr_test_util", + "gpr" + ] + }, + { + "name": "zookeeper_test", + "build": "test", + "language": "c++", + "src": [ + "test/cpp/end2end/zookeeper_test.cc" + ], + "deps": [ + "grpc++_test_util", + "grpc_test_util", + "grpc++", + "grpc_zookeeper", + "grpc", + "gpr_test_util", + "gpr" + ], + "external_deps": [ + "zookeeper" + ] + } + ] +} diff --git a/src/core/census/grpc_context.c b/src/core/census/grpc_context.c index 429f3ec9db0..4b61382a2c2 100644 --- a/src/core/census/grpc_context.c +++ b/src/core/census/grpc_context.c @@ -33,9 +33,12 @@ #include #include +#include "src/core/surface/api_trace.h" #include "src/core/surface/call.h" void grpc_census_call_set_context(grpc_call *call, census_context *context) { + GRPC_API_TRACE("grpc_census_call_set_context(call=%p, census_context=%p)", 2, + (call, context)); if (census_enabled() == CENSUS_FEATURE_NONE) { return; } @@ -45,5 +48,6 @@ void grpc_census_call_set_context(grpc_call *call, census_context *context) { } census_context *grpc_census_call_get_context(grpc_call *call) { + GRPC_API_TRACE("grpc_census_call_get_context(call=%p)", 1, (call)); return (census_context *)grpc_call_context_get(call, GRPC_CONTEXT_TRACING); } diff --git a/src/core/client_config/resolvers/zookeeper_resolver.c b/src/core/client_config/resolvers/zookeeper_resolver.c index f640a0084ad..136197d4c64 100644 --- a/src/core/client_config/resolvers/zookeeper_resolver.c +++ b/src/core/client_config/resolvers/zookeeper_resolver.c @@ -45,6 +45,7 @@ #include "src/core/client_config/resolver_registry.h" #include "src/core/iomgr/resolve_address.h" #include "src/core/support/string.h" +#include "src/core/surface/api_trace.h" #include "src/core/json/json.h" /** Zookeeper session expiration time in milliseconds */ @@ -487,6 +488,7 @@ static void zookeeper_plugin_init() { } void grpc_zookeeper_register() { + GRPC_API_TRACE("grpc_zookeeper_register(void)", 0, ()); grpc_register_plugin(zookeeper_plugin_init, NULL); } diff --git a/src/core/compression/algorithm.c b/src/core/compression/algorithm.c index 8adde13b1ec..ad7bb8c8133 100644 --- a/src/core/compression/algorithm.c +++ b/src/core/compression/algorithm.c @@ -37,12 +37,19 @@ #include #include +#include "src/core/surface/api_trace.h" + int grpc_compression_algorithm_parse(const char *name, size_t name_length, grpc_compression_algorithm *algorithm) { /* we use strncmp not only because it's safer (even though in this case it * doesn't matter, given that we are comparing against string literals, but * because this way we needn't have "name" nil-terminated (useful for slice * data, for example) */ + GRPC_API_TRACE( + "grpc_compression_algorithm_parse(" + "name=%*.*s, name_length=%lu, algorithm=%p)", 5, + ((int)name_length, (int)name_length, name, + (unsigned long)name_length, algorithm)); if (name_length == 0) { return 0; } @@ -60,6 +67,8 @@ int grpc_compression_algorithm_parse(const char *name, size_t name_length, int grpc_compression_algorithm_name(grpc_compression_algorithm algorithm, char **name) { + GRPC_API_TRACE("grpc_compression_algorithm_parse(algorithm=%d, name=%p)", 2, + ((int)algorithm, name)); switch (algorithm) { case GRPC_COMPRESS_NONE: *name = "identity"; @@ -80,6 +89,8 @@ int grpc_compression_algorithm_name(grpc_compression_algorithm algorithm, * compression algorithms */ grpc_compression_algorithm grpc_compression_algorithm_for_level( grpc_compression_level level) { + GRPC_API_TRACE("grpc_compression_algorithm_for_level(level=%d)", 1, + ((int)level)); switch (level) { case GRPC_COMPRESS_LEVEL_NONE: return GRPC_COMPRESS_NONE; @@ -96,6 +107,8 @@ grpc_compression_algorithm grpc_compression_algorithm_for_level( grpc_compression_level grpc_compression_level_for_algorithm( grpc_compression_algorithm algorithm) { grpc_compression_level clevel; + GRPC_API_TRACE("grpc_compression_level_for_algorithm(algorithm=%d)", 1, + ((int)algorithm)); for (clevel = GRPC_COMPRESS_LEVEL_NONE; clevel < GRPC_COMPRESS_LEVEL_COUNT; ++clevel) { if (grpc_compression_algorithm_for_level(clevel) == algorithm) { diff --git a/src/core/security/credentials.c b/src/core/security/credentials.c index bdd9ab8e9ca..ff67b5d30a8 100644 --- a/src/core/security/credentials.c +++ b/src/core/security/credentials.c @@ -41,6 +41,7 @@ #include "src/core/json/json.h" #include "src/core/httpcli/httpcli.h" #include "src/core/iomgr/iomgr.h" +#include "src/core/surface/api_trace.h" #include "src/core/support/string.h" #include @@ -91,6 +92,7 @@ void grpc_credentials_unref(grpc_credentials *creds) { } void grpc_credentials_release(grpc_credentials *creds) { + GRPC_API_TRACE("grpc_credentials_release(creds=%p)", 1, (creds)); grpc_credentials_unref(creds); } @@ -152,6 +154,7 @@ void grpc_server_credentials_unref(grpc_server_credentials *creds) { } void grpc_server_credentials_release(grpc_server_credentials *creds) { + GRPC_API_TRACE("grpc_server_credentials_release(creds=%p)", 1, (creds)); grpc_server_credentials_unref(creds); } @@ -166,6 +169,11 @@ grpc_security_status grpc_server_credentials_create_security_connector( void grpc_server_credentials_set_auth_metadata_processor( grpc_server_credentials *creds, grpc_auth_metadata_processor processor) { + GRPC_API_TRACE( + "grpc_server_credentials_set_auth_metadata_processor(" + "creds=%p, " + "processor=grpc_auth_metadata_processor { process: %lx, state: %p })", + 3, (creds, (unsigned long)processor.process, processor.state)); if (creds == NULL) return; if (creds->processor.destroy != NULL && creds->processor.state != NULL) { creds->processor.destroy(creds->processor.state); @@ -317,6 +325,10 @@ grpc_credentials *grpc_ssl_credentials_create( const char *pem_root_certs, grpc_ssl_pem_key_cert_pair *pem_key_cert_pair, void *reserved) { grpc_ssl_credentials *c = gpr_malloc(sizeof(grpc_ssl_credentials)); + GRPC_API_TRACE("grpc_ssl_credentials_create(pem_root_certs=%s, " + "pem_key_cert_pair=%p, " + "reserved=%p)", + 3, (pem_root_certs, pem_key_cert_pair, reserved)); GPR_ASSERT(reserved == NULL); memset(c, 0, sizeof(grpc_ssl_credentials)); c->base.type = GRPC_CREDENTIALS_TYPE_SSL; @@ -331,6 +343,12 @@ grpc_server_credentials *grpc_ssl_server_credentials_create( size_t num_key_cert_pairs, int force_client_auth, void *reserved) { grpc_ssl_server_credentials *c = gpr_malloc(sizeof(grpc_ssl_server_credentials)); + GRPC_API_TRACE( + "grpc_ssl_server_credentials_create(" + "pem_root_certs=%s, pem_key_cert_pairs=%p, num_key_cert_pairs=%lu, " + "force_client_auth=%d, reserved=%p)", 5, + (pem_root_certs, pem_key_cert_pairs, (unsigned long)num_key_cert_pairs, + force_client_auth, reserved)); GPR_ASSERT(reserved == NULL); memset(c, 0, sizeof(grpc_ssl_server_credentials)); c->base.type = GRPC_CREDENTIALS_TYPE_SSL; @@ -449,6 +467,14 @@ grpc_service_account_jwt_access_credentials_create_from_auth_json_key( grpc_credentials *grpc_service_account_jwt_access_credentials_create( const char *json_key, gpr_timespec token_lifetime, void *reserved) { + GRPC_API_TRACE( + "grpc_service_account_jwt_access_credentials_create(" + "json_key=%s, " + "token_lifetime=" + "gpr_timespec { tv_sec: %ld, tv_nsec: %d, clock_type: %d }, " + "reserved=%p)", + 5, (json_key, (long)token_lifetime.tv_sec, + token_lifetime.tv_nsec, (int)token_lifetime.clock_type, reserved)); GPR_ASSERT(reserved == NULL); return grpc_service_account_jwt_access_credentials_create_from_auth_json_key( grpc_auth_json_key_create_from_string(json_key), token_lifetime); @@ -659,6 +685,8 @@ grpc_credentials *grpc_google_compute_engine_credentials_create( void *reserved) { grpc_oauth2_token_fetcher_credentials *c = gpr_malloc(sizeof(grpc_oauth2_token_fetcher_credentials)); + GRPC_API_TRACE("grpc_compute_engine_credentials_create(reserved=%p)", 1, + (reserved)); GPR_ASSERT(reserved == NULL); init_oauth2_token_fetcher(c, compute_engine_fetch_oauth2); c->base.vtable = &compute_engine_vtable; @@ -720,6 +748,9 @@ grpc_credentials *grpc_refresh_token_credentials_create_from_auth_refresh_token( grpc_credentials *grpc_google_refresh_token_credentials_create( const char *json_refresh_token, void *reserved) { + GRPC_API_TRACE("grpc_refresh_token_credentials_create(json_refresh_token=%s, " + "reserved=%p)", + 2, (json_refresh_token, reserved)); GPR_ASSERT(reserved == NULL); return grpc_refresh_token_credentials_create_from_auth_refresh_token( grpc_auth_refresh_token_create_from_string(json_refresh_token)); @@ -820,6 +851,9 @@ grpc_credentials *grpc_access_token_credentials_create(const char *access_token, grpc_access_token_credentials *c = gpr_malloc(sizeof(grpc_access_token_credentials)); char *token_md_value; + GRPC_API_TRACE("grpc_access_token_credentials_create(access_token=%s, " + "reserved=%p)", 2, + (access_token, reserved)); GPR_ASSERT(reserved == NULL); memset(c, 0, sizeof(grpc_access_token_credentials)); c->base.type = GRPC_CREDENTIALS_TYPE_OAUTH2; @@ -1056,6 +1090,9 @@ grpc_credentials *grpc_composite_credentials_create(grpc_credentials *creds1, grpc_credentials_array creds1_array; grpc_credentials_array creds2_array; grpc_composite_credentials *c; + GRPC_API_TRACE("grpc_composite_credentials_create(creds1=%p, creds2=%p, " + "reserved=%p)", 3, + (creds1, creds2, reserved)); GPR_ASSERT(reserved == NULL); GPR_ASSERT(creds1 != NULL); GPR_ASSERT(creds2 != NULL); @@ -1158,6 +1195,9 @@ static grpc_credentials_vtable iam_vtable = { grpc_credentials *grpc_google_iam_credentials_create( const char *token, const char *authority_selector, void *reserved) { grpc_google_iam_credentials *c; + GRPC_API_TRACE("grpc_iam_credentials_create(token=%s, authority_selector=%s, " + "reserved=%p)", + 3, (token, authority_selector, reserved)); GPR_ASSERT(reserved == NULL); GPR_ASSERT(token != NULL); GPR_ASSERT(authority_selector != NULL); diff --git a/src/core/security/google_default_credentials.c b/src/core/security/google_default_credentials.c index 7b858428083..45135305b28 100644 --- a/src/core/security/google_default_credentials.c +++ b/src/core/security/google_default_credentials.c @@ -42,6 +42,7 @@ #include "src/core/httpcli/httpcli.h" #include "src/core/support/env.h" #include "src/core/support/file.h" +#include "src/core/surface/api_trace.h" /* -- Constants. -- */ @@ -178,6 +179,9 @@ end: grpc_credentials *grpc_google_default_credentials_create(void) { grpc_credentials *result = NULL; int serving_cached_credentials = 0; + + GRPC_API_TRACE("grpc_google_default_credentials_create(void)", 0, ()); + gpr_once_init(&g_once, init_default_credentials); gpr_mu_lock(&g_mu); diff --git a/src/core/security/security_context.c b/src/core/security/security_context.c index 95d80ba122f..b3cf5204c0d 100644 --- a/src/core/security/security_context.c +++ b/src/core/security/security_context.c @@ -34,6 +34,7 @@ #include #include "src/core/security/security_context.h" +#include "src/core/surface/api_trace.h" #include "src/core/surface/call.h" #include "src/core/support/string.h" @@ -47,6 +48,8 @@ grpc_call_error grpc_call_set_credentials(grpc_call *call, grpc_credentials *creds) { grpc_client_security_context *ctx = NULL; + GRPC_API_TRACE("grpc_call_set_credentials(call=%p, creds=%p)", 2, + (call, creds)); if (!grpc_call_is_client(call)) { gpr_log(GPR_ERROR, "Method is client-side only."); return GRPC_CALL_ERROR_NOT_ON_SERVER; @@ -71,6 +74,7 @@ grpc_call_error grpc_call_set_credentials(grpc_call *call, grpc_auth_context *grpc_call_auth_context(grpc_call *call) { void *sec_ctx = grpc_call_context_get(call, GRPC_CONTEXT_SECURITY); + GRPC_API_TRACE("grpc_call_auth_context(call=%p)", 1, (call)); if (sec_ctx == NULL) return NULL; return grpc_call_is_client(call) ? GRPC_AUTH_CONTEXT_REF( @@ -82,6 +86,7 @@ grpc_auth_context *grpc_call_auth_context(grpc_call *call) { } void grpc_auth_context_release(grpc_auth_context *context) { + GRPC_API_TRACE("grpc_auth_context_release(context=%p)", 1, (context)); GRPC_AUTH_CONTEXT_UNREF(context, "grpc_auth_context_unref"); } @@ -174,6 +179,8 @@ void grpc_auth_context_unref(grpc_auth_context *ctx) { const char *grpc_auth_context_peer_identity_property_name( const grpc_auth_context *ctx) { + GRPC_API_TRACE("grpc_auth_context_peer_identity_property_name(ctx=%p)", 1, + (ctx)); return ctx->peer_identity_property_name; } @@ -182,6 +189,9 @@ int grpc_auth_context_set_peer_identity_property_name(grpc_auth_context *ctx, grpc_auth_property_iterator it = grpc_auth_context_find_properties_by_name(ctx, name); const grpc_auth_property *prop = grpc_auth_property_iterator_next(&it); + GRPC_API_TRACE( + "grpc_auth_context_set_peer_identity_property_name(ctx=%p, name=%s)", 2, + (ctx, name)); if (prop == NULL) { gpr_log(GPR_ERROR, "Property name %s not found in auth context.", name != NULL ? name : "NULL"); @@ -192,12 +202,14 @@ int grpc_auth_context_set_peer_identity_property_name(grpc_auth_context *ctx, } int grpc_auth_context_peer_is_authenticated(const grpc_auth_context *ctx) { + GRPC_API_TRACE("grpc_auth_context_peer_is_authenticated(ctx=%p)", 1, (ctx)); return ctx->peer_identity_property_name == NULL ? 0 : 1; } grpc_auth_property_iterator grpc_auth_context_property_iterator( const grpc_auth_context *ctx) { grpc_auth_property_iterator it = empty_iterator; + GRPC_API_TRACE("grpc_auth_context_property_iterator(ctx=%p)", 1, (ctx)); if (ctx == NULL) return it; it.ctx = ctx; return it; @@ -205,6 +217,7 @@ grpc_auth_property_iterator grpc_auth_context_property_iterator( const grpc_auth_property *grpc_auth_property_iterator_next( grpc_auth_property_iterator *it) { + GRPC_API_TRACE("grpc_auth_property_iterator_next(it=%p)", 1, (it)); if (it == NULL || it->ctx == NULL) return NULL; while (it->index == it->ctx->properties.count) { if (it->ctx->chained == NULL) return NULL; @@ -229,6 +242,8 @@ const grpc_auth_property *grpc_auth_property_iterator_next( grpc_auth_property_iterator grpc_auth_context_find_properties_by_name( const grpc_auth_context *ctx, const char *name) { grpc_auth_property_iterator it = empty_iterator; + GRPC_API_TRACE("grpc_auth_context_find_properties_by_name(ctx=%p, name=%s)", + 2, (ctx, name)); if (ctx == NULL || name == NULL) return empty_iterator; it.ctx = ctx; it.name = name; @@ -237,6 +252,7 @@ grpc_auth_property_iterator grpc_auth_context_find_properties_by_name( grpc_auth_property_iterator grpc_auth_context_peer_identity( const grpc_auth_context *ctx) { + GRPC_API_TRACE("grpc_auth_context_peer_identity(ctx=%p)", 1, (ctx)); if (ctx == NULL) return empty_iterator; return grpc_auth_context_find_properties_by_name( ctx, ctx->peer_identity_property_name); @@ -255,6 +271,11 @@ static void ensure_auth_context_capacity(grpc_auth_context *ctx) { void grpc_auth_context_add_property(grpc_auth_context *ctx, const char *name, const char *value, size_t value_length) { grpc_auth_property *prop; + GRPC_API_TRACE( + "grpc_auth_context_add_property(ctx=%p, name=%s, value=%*.*s, " + "value_length=%lu)", + 6, (ctx, name, (int)value_length, (int)value_length, value, + (unsigned long)value_length)); ensure_auth_context_capacity(ctx); prop = &ctx->properties.array[ctx->properties.count++]; prop->name = gpr_strdup(name); @@ -268,6 +289,9 @@ void grpc_auth_context_add_cstring_property(grpc_auth_context *ctx, const char *name, const char *value) { grpc_auth_property *prop; + GRPC_API_TRACE( + "grpc_auth_context_add_cstring_property(ctx=%p, name=%s, value=%s)", 3, + (ctx, name, value)); ensure_auth_context_capacity(ctx); prop = &ctx->properties.array[ctx->properties.count++]; prop->name = gpr_strdup(name); diff --git a/src/core/security/server_secure_chttp2.c b/src/core/security/server_secure_chttp2.c index a6c515dc34e..3738ed6eb13 100644 --- a/src/core/security/server_secure_chttp2.c +++ b/src/core/security/server_secure_chttp2.c @@ -44,6 +44,7 @@ #include "src/core/security/credentials.h" #include "src/core/security/security_connector.h" #include "src/core/security/security_context.h" +#include "src/core/surface/api_trace.h" #include "src/core/surface/server.h" #include "src/core/transport/chttp2_transport.h" #include @@ -222,6 +223,10 @@ int grpc_server_add_secure_http2_port(grpc_server *server, const char *addr, grpc_security_connector *sc = NULL; grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT; + GRPC_API_TRACE("grpc_server_add_secure_http2_port(" + "server=%p, addr=%s, creds=%p)", + 3, (server, addr, creds)); + /* create security context */ if (creds == NULL) goto error; status = grpc_server_credentials_create_security_connector(creds, &sc); diff --git a/src/core/surface/api_trace.c b/src/core/surface/api_trace.c new file mode 100644 index 00000000000..9f0b900d467 --- /dev/null +++ b/src/core/surface/api_trace.c @@ -0,0 +1,36 @@ +/* + * + * Copyright 2015, Google Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google Inc. nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "src/core/surface/api_trace.h" + +int grpc_api_trace = 0; diff --git a/src/core/surface/api_trace.h b/src/core/surface/api_trace.h new file mode 100644 index 00000000000..7769b191efa --- /dev/null +++ b/src/core/surface/api_trace.h @@ -0,0 +1,65 @@ +/* + * + * Copyright 2015, Google Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google Inc. nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#ifndef GRPC_INTERNAL_CORE_SURFACE_API_TRACE_H +#define GRPC_INTERNAL_CORE_SURFACE_API_TRACE_H + +#include "src/core/debug/trace.h" +#include + +extern int grpc_api_trace; + +/* Provide unwrapping macros because we're in C89 and variadic macros weren't + introduced until C99... */ +#define GRPC_API_TRACE_UNWRAP0() +#define GRPC_API_TRACE_UNWRAP1(a) , a +#define GRPC_API_TRACE_UNWRAP2(a, b) , a, b +#define GRPC_API_TRACE_UNWRAP3(a, b, c) , a, b, c +#define GRPC_API_TRACE_UNWRAP4(a, b, c, d) , a, b, c, d +#define GRPC_API_TRACE_UNWRAP5(a, b, c, d, e) , a, b, c, d, e +#define GRPC_API_TRACE_UNWRAP6(a, b, c, d, e, f) , a, b, c, d, e, f +#define GRPC_API_TRACE_UNWRAP7(a, b, c, d, e, f, g) , a, b, c, d, e, f, g +#define GRPC_API_TRACE_UNWRAP8(a, b, c, d, e, f, g, h) , a, b, c, d, e, f, g, h +#define GRPC_API_TRACE_UNWRAP9(a, b, c, d, e, f, g, h, i) \ + , a, b, c, d, e, f, g, h, i +#define GRPC_API_TRACE_UNWRAP10(a, b, c, d, e, f, g, h, i, j) \ + , a, b, c, d, e, f, g, h, i, j + +/* Due to the limitations of C89's preprocessor, the arity of the var-arg list + 'nargs' must be specified. */ +#define GRPC_API_TRACE(fmt, nargs, args) \ + if (grpc_api_trace) { \ + gpr_log(GPR_INFO, fmt GRPC_API_TRACE_UNWRAP##nargs args ); \ + } + +#endif /* GRPC_INTERNAL_CORE_SURFACE_API_TRACE_H */ diff --git a/src/core/surface/call.c b/src/core/surface/call.c index 0b917f15611..85c27746dca 100644 --- a/src/core/surface/call.c +++ b/src/core/surface/call.c @@ -45,6 +45,7 @@ #include "src/core/iomgr/alarm.h" #include "src/core/profiling/timers.h" #include "src/core/support/string.h" +#include "src/core/surface/api_trace.h" #include "src/core/surface/byte_buffer_queue.h" #include "src/core/surface/call.h" #include "src/core/surface/channel.h" @@ -1280,6 +1281,8 @@ void grpc_call_destroy(grpc_call *c) { grpc_call *parent = c->parent; grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT; + GRPC_API_TRACE("grpc_call_destroy(c=%p)", 1, (c)); + if (parent) { gpr_mu_lock(&parent->mu); if (c == parent->first_child) { @@ -1308,6 +1311,7 @@ void grpc_call_destroy(grpc_call *c) { } grpc_call_error grpc_call_cancel(grpc_call *call, void *reserved) { + GRPC_API_TRACE("grpc_call_cancel(call=%p, reserved=%p)", 2, (call, reserved)); GPR_ASSERT(!reserved); return grpc_call_cancel_with_status(call, GRPC_STATUS_CANCELLED, "Cancelled", NULL); @@ -1319,6 +1323,10 @@ grpc_call_error grpc_call_cancel_with_status(grpc_call *c, void *reserved) { grpc_call_error r; grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT; + GRPC_API_TRACE( + "grpc_call_cancel_with_status(" + "c=%p, status=%d, description=%s, reserved=%p)", + 4, (c, (int)status, description, reserved)); GPR_ASSERT(reserved == NULL); lock(c); r = cancel_with_status(c, status, description); @@ -1386,6 +1394,7 @@ char *grpc_call_get_peer(grpc_call *call) { grpc_call_element *elem = CALL_ELEM_FROM_CALL(call, 0); grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT; char *result = elem->filter->get_peer(&exec_ctx, elem); + GRPC_API_TRACE("grpc_call_get_peer(%p)", 1, (call)); grpc_exec_ctx_finish(&exec_ctx); return result; } @@ -1580,6 +1589,10 @@ grpc_call_error grpc_call_start_batch(grpc_call *call, const grpc_op *ops, grpc_call_error error; grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT; + GRPC_API_TRACE( + "grpc_call_start_batch(call=%p, ops=%p, nops=%lu, tag=%p, reserved=%p)", + 5, (call, ops, (unsigned long)nops, tag, reserved)); + if (reserved != NULL) { error = GRPC_CALL_ERROR; goto done; diff --git a/src/core/surface/call_details.c b/src/core/surface/call_details.c index 65d2d1da5b2..60f0029819c 100644 --- a/src/core/surface/call_details.c +++ b/src/core/surface/call_details.c @@ -36,11 +36,15 @@ #include +#include "src/core/surface/api_trace.h" + void grpc_call_details_init(grpc_call_details* cd) { + GRPC_API_TRACE("grpc_call_details_init(cd=%p)", 1, (cd)); memset(cd, 0, sizeof(*cd)); } void grpc_call_details_destroy(grpc_call_details* cd) { + GRPC_API_TRACE("grpc_call_details_destroy(cd=%p)", 1, (cd)); gpr_free(cd->method); gpr_free(cd->host); } diff --git a/src/core/surface/channel.c b/src/core/surface/channel.c index aed7a79e4ef..3ff11eb0344 100644 --- a/src/core/surface/channel.c +++ b/src/core/surface/channel.c @@ -43,6 +43,7 @@ #include "src/core/client_config/resolver_registry.h" #include "src/core/iomgr/iomgr.h" #include "src/core/support/string.h" +#include "src/core/surface/api_trace.h" #include "src/core/surface/call.h" #include "src/core/surface/init.h" @@ -184,6 +185,7 @@ grpc_channel *grpc_channel_create_from_filters( } char *grpc_channel_get_target(grpc_channel *channel) { + GRPC_API_TRACE("grpc_channel_get_target(channel=%p)", 1, (channel)); return gpr_strdup(channel->target); } @@ -213,6 +215,15 @@ grpc_call *grpc_channel_create_call(grpc_channel *channel, grpc_completion_queue *cq, const char *method, const char *host, gpr_timespec deadline, void *reserved) { + GRPC_API_TRACE( + "grpc_channel_create_call(" + "channel=%p, parent_call=%p, propagation_mask=%x, cq=%p, method=%s, " + "host=%s, " + "deadline=gpr_timespec { tv_sec: %ld, tv_nsec: %d, clock_type: %d }, " + "reserved=%p)", + 10, (channel, parent_call, (unsigned)propagation_mask, cq, method, + host, (long)deadline.tv_sec, deadline.tv_nsec, + (int)deadline.clock_type, reserved)); GPR_ASSERT(!reserved); return grpc_channel_create_call_internal( channel, parent_call, propagation_mask, cq, @@ -230,6 +241,9 @@ grpc_call *grpc_channel_create_call(grpc_channel *channel, void *grpc_channel_register_call(grpc_channel *channel, const char *method, const char *host, void *reserved) { registered_call *rc = gpr_malloc(sizeof(registered_call)); + GRPC_API_TRACE( + "grpc_channel_register_call(channel=%p, method=%s, host=%s, reserved=%p)", + 4, (channel, method, host, reserved)); GPR_ASSERT(!reserved); rc->path = grpc_mdelem_from_metadata_strings( channel->metadata_context, GRPC_MDSTR_REF(channel->path_string), @@ -252,6 +266,15 @@ grpc_call *grpc_channel_create_registered_call( grpc_completion_queue *completion_queue, void *registered_call_handle, gpr_timespec deadline, void *reserved) { registered_call *rc = registered_call_handle; + GRPC_API_TRACE( + "grpc_channel_create_registered_call(" + "channel=%p, parent_call=%p, propagation_mask=%x, completion_queue=%p, " + "registered_call_handle=%p, " + "deadline=gpr_timespec { tv_sec: %ld, tv_nsec: %d, clock_type: %d }, " + "reserved=%p)", + 9, (channel, parent_call, (unsigned)propagation_mask, completion_queue, + registered_call_handle, (long)deadline.tv_sec, deadline.tv_nsec, + (int)deadline.clock_type, reserved)); GPR_ASSERT(!reserved); return grpc_channel_create_call_internal( channel, parent_call, propagation_mask, completion_queue, @@ -317,6 +340,7 @@ void grpc_channel_destroy(grpc_channel *channel) { grpc_transport_op op; grpc_channel_element *elem; grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT; + GRPC_API_TRACE("grpc_channel_destroy(channel=%p)", 1, (channel)); memset(&op, 0, sizeof(op)); op.disconnect = 1; elem = grpc_channel_stack_element(CHANNEL_STACK_FROM_CHANNEL(channel), 0); diff --git a/src/core/surface/channel_connectivity.c b/src/core/surface/channel_connectivity.c index 47cbab154f8..bef3d387fc9 100644 --- a/src/core/surface/channel_connectivity.c +++ b/src/core/surface/channel_connectivity.c @@ -38,6 +38,7 @@ #include "src/core/channel/client_channel.h" #include "src/core/iomgr/alarm.h" +#include "src/core/surface/api_trace.h" #include "src/core/surface/completion_queue.h" grpc_connectivity_state grpc_channel_check_connectivity_state( @@ -47,6 +48,9 @@ grpc_connectivity_state grpc_channel_check_connectivity_state( grpc_channel_stack_last_element(grpc_channel_get_channel_stack(channel)); grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT; grpc_connectivity_state state; + GRPC_API_TRACE( + "grpc_channel_check_connectivity_state(channel=%p, try_to_connect=%d)", + 2, (channel, try_to_connect)); if (client_channel_elem->filter != &grpc_client_channel_filter) { gpr_log(GPR_ERROR, "grpc_channel_check_connectivity_state called on something that is " @@ -175,6 +179,14 @@ void grpc_channel_watch_connectivity_state( grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT; state_watcher *w = gpr_malloc(sizeof(*w)); + GRPC_API_TRACE( + "grpc_channel_watch_connectivity_state(" + "channel=%p, last_observed_state=%d, " + "deadline=gpr_timespec { tv_sec: %ld, tv_nsec: %d, clock_type: %d }, " + "cq=%p, tag=%p)", + 7, (channel, (int)last_observed_state, (long)deadline.tv_sec, + deadline.tv_nsec, (int)deadline.clock_type, cq, tag)); + grpc_cq_begin_op(cq); gpr_mu_init(&w->mu); diff --git a/src/core/surface/channel_create.c b/src/core/surface/channel_create.c index 05591ce27f9..51d9130b63d 100644 --- a/src/core/surface/channel_create.c +++ b/src/core/surface/channel_create.c @@ -45,6 +45,7 @@ #include "src/core/channel/http_client_filter.h" #include "src/core/client_config/resolver_registry.h" #include "src/core/iomgr/tcp_client.h" +#include "src/core/surface/api_trace.h" #include "src/core/surface/channel.h" #include "src/core/transport/chttp2_transport.h" @@ -184,6 +185,9 @@ grpc_channel *grpc_insecure_channel_create(const char *target, grpc_mdctx *mdctx = grpc_mdctx_create(); grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT; size_t n = 0; + GRPC_API_TRACE( + "grpc_insecure_channel_create(target=%p, args=%p, reserved=%p)", 3, + (target, args, reserved)); GPR_ASSERT(!reserved); if (grpc_channel_args_is_census_enabled(args)) { filters[n++] = &grpc_client_census_filter; diff --git a/src/core/surface/completion_queue.c b/src/core/surface/completion_queue.c index 5dac8ebcf8b..a6b32d27aa1 100644 --- a/src/core/surface/completion_queue.c +++ b/src/core/surface/completion_queue.c @@ -38,6 +38,7 @@ #include "src/core/iomgr/pollset.h" #include "src/core/support/string.h" +#include "src/core/surface/api_trace.h" #include "src/core/surface/call.h" #include "src/core/surface/event_string.h" #include "src/core/surface/surface_trace.h" @@ -75,6 +76,7 @@ static void on_pollset_destroy_done(grpc_exec_ctx *exec_ctx, void *cc, grpc_completion_queue *grpc_completion_queue_create(void *reserved) { grpc_completion_queue *cc = gpr_malloc(sizeof(grpc_completion_queue)); + GRPC_API_TRACE("grpc_completion_queue_create(reserved=%p)", 1, (reserved)); GPR_ASSERT(!reserved); memset(cc, 0, sizeof(*cc)); /* Initial ref is dropped by grpc_completion_queue_shutdown */ @@ -182,6 +184,13 @@ grpc_event grpc_completion_queue_next(grpc_completion_queue *cc, gpr_timespec now; grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT; + GRPC_API_TRACE( + "grpc_completion_queue_next(" + "cc=%p, " + "deadline=gpr_timespec { tv_sec: %ld, tv_nsec: %d, clock_type: %d }, " + "reserved=%p)", + 5, (cc, (long)deadline.tv_sec, deadline.tv_nsec, + (int)deadline.clock_type, reserved)); GPR_ASSERT(!reserved); deadline = gpr_convert_clock_type(deadline, GPR_CLOCK_MONOTONIC); @@ -259,6 +268,13 @@ grpc_event grpc_completion_queue_pluck(grpc_completion_queue *cc, void *tag, int first_loop = 1; grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT; + GRPC_API_TRACE( + "grpc_completion_queue_pluck(" + "cc=%p, tag=%p, " + "deadline=gpr_timespec { tv_sec: %ld, tv_nsec: %d, clock_type: %d }, " + "reserved=%p)", + 6, (cc, tag, (long)deadline.tv_sec, deadline.tv_nsec, + (int)deadline.clock_type, reserved)); GPR_ASSERT(!reserved); deadline = gpr_convert_clock_type(deadline, GPR_CLOCK_MONOTONIC); @@ -324,6 +340,7 @@ done: to zero here, then enter shutdown mode and wake up any waiters */ void grpc_completion_queue_shutdown(grpc_completion_queue *cc) { grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT; + GRPC_API_TRACE("grpc_completion_queue_shutdown(cc=%p)", 1, (cc)); gpr_mu_lock(GRPC_POLLSET_MU(&cc->pollset)); if (cc->shutdown_called) { gpr_mu_unlock(GRPC_POLLSET_MU(&cc->pollset)); @@ -343,6 +360,7 @@ void grpc_completion_queue_shutdown(grpc_completion_queue *cc) { } void grpc_completion_queue_destroy(grpc_completion_queue *cc) { + GRPC_API_TRACE("grpc_completion_queue_destroy(cc=%p)", 1, (cc)); grpc_completion_queue_shutdown(cc); GRPC_CQ_INTERNAL_UNREF(cc, "destroy"); } diff --git a/src/core/surface/init.c b/src/core/surface/init.c index 7d7e72440ea..96ab5ecb60b 100644 --- a/src/core/surface/init.c +++ b/src/core/surface/init.c @@ -49,6 +49,7 @@ #include "src/core/debug/trace.h" #include "src/core/iomgr/iomgr.h" #include "src/core/profiling/timers.h" +#include "src/core/surface/api_trace.h" #include "src/core/surface/call.h" #include "src/core/surface/init.h" #include "src/core/surface/surface_trace.h" @@ -75,6 +76,8 @@ static grpc_plugin g_all_of_the_plugins[MAX_PLUGINS]; static int g_number_of_plugins = 0; void grpc_register_plugin(void (*init)(void), void (*destroy)(void)) { + GRPC_API_TRACE("grpc_register_plugin(init=%lx, destroy=%lx)", 2, + ((unsigned long)init, (unsigned long)destroy)); GPR_ASSERT(g_number_of_plugins != MAX_PLUGINS); g_all_of_the_plugins[g_number_of_plugins].init = init; g_all_of_the_plugins[g_number_of_plugins].destroy = destroy; @@ -98,6 +101,7 @@ void grpc_init(void) { #ifdef GPR_POSIX_SOCKET grpc_register_resolver_type(grpc_unix_resolver_factory_create()); #endif + grpc_register_tracer("api", &grpc_api_trace); grpc_register_tracer("channel", &grpc_trace_channel); grpc_register_tracer("surface", &grpc_surface_trace); grpc_register_tracer("http", &grpc_http_trace); @@ -120,10 +124,12 @@ void grpc_init(void) { } } gpr_mu_unlock(&g_init_mu); + GRPC_API_TRACE("grpc_init(void)", 0, ()); } void grpc_shutdown(void) { int i; + GRPC_API_TRACE("grpc_shutdown(void)", 0, ()); gpr_mu_lock(&g_init_mu); if (--g_initializations == 0) { grpc_iomgr_shutdown(); diff --git a/src/core/surface/lame_client.c b/src/core/surface/lame_client.c index 9e14ce2191a..d2462d8c999 100644 --- a/src/core/surface/lame_client.c +++ b/src/core/surface/lame_client.c @@ -37,6 +37,7 @@ #include "src/core/channel/channel_stack.h" #include "src/core/support/string.h" +#include "src/core/surface/api_trace.h" #include "src/core/surface/channel.h" #include "src/core/surface/call.h" #include @@ -151,6 +152,10 @@ grpc_channel *grpc_lame_client_channel_create(const char *target, channel = grpc_channel_create_from_filters(&exec_ctx, target, filters, 1, NULL, grpc_mdctx_create(), 1); elem = grpc_channel_stack_element(grpc_channel_get_channel_stack(channel), 0); + GRPC_API_TRACE( + "grpc_lame_client_channel_create(target=%s, error_code=%d, " + "error_message=%s)", + 3, (target, (int)error_code, error_message)); GPR_ASSERT(elem->filter == &lame_filter); chand = (channel_data *)elem->channel_data; chand->error_code = error_code; diff --git a/src/core/surface/metadata_array.c b/src/core/surface/metadata_array.c index 648c5792667..4c7bf17835a 100644 --- a/src/core/surface/metadata_array.c +++ b/src/core/surface/metadata_array.c @@ -36,10 +36,14 @@ #include +#include "src/core/surface/api_trace.h" + void grpc_metadata_array_init(grpc_metadata_array* array) { + GRPC_API_TRACE("grpc_metadata_array_init(array=%p)", 1, (array)); memset(array, 0, sizeof(*array)); } void grpc_metadata_array_destroy(grpc_metadata_array* array) { + GRPC_API_TRACE("grpc_metadata_array_destroy(array=%p)", 1, (array)); gpr_free(array->metadata); } diff --git a/src/core/surface/secure_channel_create.c b/src/core/surface/secure_channel_create.c index d6070a54a89..7fe43b0eaa5 100644 --- a/src/core/surface/secure_channel_create.c +++ b/src/core/surface/secure_channel_create.c @@ -47,6 +47,7 @@ #include "src/core/iomgr/tcp_client.h" #include "src/core/security/auth_filters.h" #include "src/core/security/credentials.h" +#include "src/core/surface/api_trace.h" #include "src/core/surface/channel.h" #include "src/core/transport/chttp2_transport.h" #include "src/core/tsi/transport_security_interface.h" @@ -246,7 +247,11 @@ grpc_channel *grpc_secure_channel_create(grpc_credentials *creds, grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT; size_t n = 0; + GRPC_API_TRACE("grpc_secure_channel_create(creds=%p, target=%s, args=%p, " + "reserved=%p)", 4, + (creds, target, args, reserved)); GPR_ASSERT(reserved == NULL); + if (grpc_find_security_connector_in_args(args) != NULL) { gpr_log(GPR_ERROR, "Cannot set security context in channel args."); grpc_exec_ctx_finish(&exec_ctx); diff --git a/src/core/surface/server.c b/src/core/surface/server.c index e3ce88b3e60..ebd2ef9af35 100644 --- a/src/core/surface/server.c +++ b/src/core/surface/server.c @@ -48,6 +48,7 @@ #include "src/core/iomgr/iomgr.h" #include "src/core/support/stack_lockfree.h" #include "src/core/support/string.h" +#include "src/core/surface/api_trace.h" #include "src/core/surface/call.h" #include "src/core/surface/channel.h" #include "src/core/surface/completion_queue.h" @@ -776,6 +777,9 @@ void grpc_server_register_completion_queue(grpc_server *server, grpc_completion_queue *cq, void *reserved) { size_t i, n; + GRPC_API_TRACE( + "grpc_server_register_completion_queue(server=%p, cq=%p, reserved=%p)", 3, + (server, cq, reserved)); GPR_ASSERT(!reserved); for (i = 0; i < server->cq_count; i++) { if (server->cqs[i] == cq) return; @@ -854,6 +858,8 @@ static int streq(const char *a, const char *b) { void *grpc_server_register_method(grpc_server *server, const char *method, const char *host) { registered_method *m; + GRPC_API_TRACE("grpc_server_register_method(server=%p, method=%s, host=%s)", + 3, (server, method, host)); if (!method) { gpr_log(GPR_ERROR, "grpc_server_register_method method string cannot be NULL"); @@ -881,6 +887,8 @@ void grpc_server_start(grpc_server *server) { size_t i; grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT; + GRPC_API_TRACE("grpc_server_start(server=%p)", 1, (server)); + server->pollsets = gpr_malloc(sizeof(grpc_pollset *) * server->cq_count); for (i = 0; i < server->cq_count; i++) { server->pollsets[i] = grpc_cq_pollset(server->cqs[i]); @@ -1011,6 +1019,9 @@ void grpc_server_shutdown_and_notify(grpc_server *server, channel_broadcaster broadcaster; grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT; + GRPC_API_TRACE("grpc_server_shutdown_and_notify(server=%p, cq=%p, tag=%p)", 3, + (server, cq, tag)); + GRPC_SERVER_LOG_SHUTDOWN(GPR_INFO, server, cq, tag); /* lock, and gather up some stuff to do */ @@ -1063,6 +1074,8 @@ void grpc_server_cancel_all_calls(grpc_server *server) { channel_broadcaster broadcaster; grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT; + GRPC_API_TRACE("grpc_server_cancel_all_calls(server=%p)", 1, (server)); + gpr_mu_lock(&server->mu_global); channel_broadcaster_init(server, &broadcaster); gpr_mu_unlock(&server->mu_global); @@ -1075,6 +1088,8 @@ void grpc_server_destroy(grpc_server *server) { listener *l; grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT; + GRPC_API_TRACE("grpc_server_destroy(server=%p)", 1, (server)); + gpr_mu_lock(&server->mu_global); GPR_ASSERT(gpr_atm_acq_load(&server->shutdown_flag) || !server->listeners); GPR_ASSERT(server->listeners_destroyed == num_listeners(server)); @@ -1169,6 +1184,12 @@ grpc_call_error grpc_server_request_call( grpc_call_error error; grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT; requested_call *rc = gpr_malloc(sizeof(*rc)); + GRPC_API_TRACE( + "grpc_server_request_call(" + "server=%p, call=%p, details=%p, initial_metadata=%p, " + "cq_bound_to_call=%p, cq_for_notification=%p, tag%p)", + 7, (server, call, details, initial_metadata, cq_bound_to_call, + cq_for_notification, tag)); GRPC_SERVER_LOG_REQUEST_CALL(GPR_INFO, server, call, details, initial_metadata, cq_bound_to_call, cq_for_notification, tag); @@ -1202,6 +1223,13 @@ grpc_call_error grpc_server_request_registered_call( grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT; requested_call *rc = gpr_malloc(sizeof(*rc)); registered_method *rm = rmp; + GRPC_API_TRACE( + "grpc_server_request_registered_call(" + "server=%p, rmp=%p, call=%p, deadline=%p, initial_metadata=%p, " + "optional_payload=%p, cq_bound_to_call=%p, cq_for_notification=%p, " + "tag=%p)", + 9, (server, rmp, call, deadline, initial_metadata, optional_payload, + cq_bound_to_call, cq_for_notification, tag)); if (!grpc_cq_is_server_cq(cq_for_notification)) { gpr_free(rc); error = GRPC_CALL_ERROR_NOT_SERVER_COMPLETION_QUEUE; diff --git a/src/core/surface/server_chttp2.c b/src/core/surface/server_chttp2.c index 3904ce969dd..580b91573c2 100644 --- a/src/core/surface/server_chttp2.c +++ b/src/core/surface/server_chttp2.c @@ -36,6 +36,7 @@ #include "src/core/channel/http_server_filter.h" #include "src/core/iomgr/resolve_address.h" #include "src/core/iomgr/tcp_server.h" +#include "src/core/surface/api_trace.h" #include "src/core/surface/server.h" #include "src/core/transport/chttp2_transport.h" #include @@ -92,6 +93,9 @@ int grpc_server_add_insecure_http2_port(grpc_server *server, const char *addr) { int port_temp; grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT; + GRPC_API_TRACE("grpc_server_add_insecure_http2_port(server=%p, addr=%s)", 2, + (server, addr)); + resolved = grpc_blocking_resolve_address(addr, "http"); if (!resolved) { goto error; diff --git a/src/core/surface/server_create.c b/src/core/surface/server_create.c index fc7ae820f53..c7811a6d881 100644 --- a/src/core/surface/server_create.c +++ b/src/core/surface/server_create.c @@ -32,13 +32,14 @@ */ #include +#include "src/core/surface/api_trace.h" #include "src/core/surface/completion_queue.h" #include "src/core/surface/server.h" #include "src/core/channel/compress_filter.h" grpc_server *grpc_server_create(const grpc_channel_args *args, void *reserved) { const grpc_channel_filter *filters[] = {&grpc_compress_filter}; - (void)reserved; + GRPC_API_TRACE("grpc_server_create(%p, %p)", 2, (args, reserved)); return grpc_server_create_from_filters(filters, GPR_ARRAY_SIZE(filters), args); } diff --git a/src/core/surface/version.c b/src/core/surface/version.c index e559d51448a..8eb3ceea70f 100644 --- a/src/core/surface/version.c +++ b/src/core/surface/version.c @@ -36,4 +36,10 @@ #include -const char *grpc_version_string(void) { return "0.11.0.0"; } +#include "src/core/surface/api_trace.h" + +const char *grpc_version_string(void) { + GRPC_API_TRACE("grpc_version_string(void)", 0, ()); + return "0.11.0.0"; +} + From fe1093c3a8d59c6bdc97eef6f6ade784df99204b Mon Sep 17 00:00:00 2001 From: Masood Malekghassemi Date: Wed, 19 Aug 2015 19:15:24 -0700 Subject: [PATCH 60/79] Update build tools --- BUILD | 3 + Makefile | 2 + gRPC.podspec | 1 + tools/doxygen/Doxyfile.core.internal | 1 + tools/run_tests/sources_and_headers.json | 2 + vsprojects/grpc/grpc.vcxproj | 659 +++++++++++++ vsprojects/grpc/grpc.vcxproj.filters | 874 ++++++++++++++++++ .../grpc_unsecure/grpc_unsecure.vcxproj | 597 ++++++++++++ .../grpc_unsecure.vcxproj.filters | 766 +++++++++++++++ 9 files changed, 2905 insertions(+) create mode 100644 vsprojects/grpc/grpc.vcxproj create mode 100644 vsprojects/grpc/grpc.vcxproj.filters create mode 100644 vsprojects/grpc_unsecure/grpc_unsecure.vcxproj create mode 100644 vsprojects/grpc_unsecure/grpc_unsecure.vcxproj.filters diff --git a/BUILD b/BUILD index c8118089bef..c4ff5ee7972 100644 --- a/BUILD +++ b/BUILD @@ -356,6 +356,7 @@ cc_library( "src/core/json/json_writer.c", "src/core/profiling/basic_timers.c", "src/core/profiling/stap_timers.c", + "src/core/surface/api_trace.c", "src/core/surface/byte_buffer.c", "src/core/surface/byte_buffer_queue.c", "src/core/surface/byte_buffer_reader.c", @@ -621,6 +622,7 @@ cc_library( "src/core/json/json_writer.c", "src/core/profiling/basic_timers.c", "src/core/profiling/stap_timers.c", + "src/core/surface/api_trace.c", "src/core/surface/byte_buffer.c", "src/core/surface/byte_buffer_queue.c", "src/core/surface/byte_buffer_reader.c", @@ -1145,6 +1147,7 @@ objc_library( "src/core/json/json_writer.c", "src/core/profiling/basic_timers.c", "src/core/profiling/stap_timers.c", + "src/core/surface/api_trace.c", "src/core/surface/byte_buffer.c", "src/core/surface/byte_buffer_queue.c", "src/core/surface/byte_buffer_reader.c", diff --git a/Makefile b/Makefile index e0a7b804721..ca365a8dbe3 100644 --- a/Makefile +++ b/Makefile @@ -4119,6 +4119,7 @@ LIBGRPC_SRC = \ src/core/json/json_writer.c \ src/core/profiling/basic_timers.c \ src/core/profiling/stap_timers.c \ + src/core/surface/api_trace.c \ src/core/surface/byte_buffer.c \ src/core/surface/byte_buffer_queue.c \ src/core/surface/byte_buffer_reader.c \ @@ -4401,6 +4402,7 @@ LIBGRPC_UNSECURE_SRC = \ src/core/json/json_writer.c \ src/core/profiling/basic_timers.c \ src/core/profiling/stap_timers.c \ + src/core/surface/api_trace.c \ src/core/surface/byte_buffer.c \ src/core/surface/byte_buffer_queue.c \ src/core/surface/byte_buffer_reader.c \ diff --git a/gRPC.podspec b/gRPC.podspec index 46823453bab..dfb52a88bf7 100644 --- a/gRPC.podspec +++ b/gRPC.podspec @@ -366,6 +366,7 @@ Pod::Spec.new do |s| 'src/core/json/json_writer.c', 'src/core/profiling/basic_timers.c', 'src/core/profiling/stap_timers.c', + 'src/core/surface/api_trace.c', 'src/core/surface/byte_buffer.c', 'src/core/surface/byte_buffer_queue.c', 'src/core/surface/byte_buffer_reader.c', diff --git a/tools/doxygen/Doxyfile.core.internal b/tools/doxygen/Doxyfile.core.internal index a7a3da4d200..123280ca1b2 100644 --- a/tools/doxygen/Doxyfile.core.internal +++ b/tools/doxygen/Doxyfile.core.internal @@ -991,6 +991,7 @@ src/core/json/json_string.c \ src/core/json/json_writer.c \ src/core/profiling/basic_timers.c \ src/core/profiling/stap_timers.c \ +src/core/surface/api_trace.c \ src/core/surface/byte_buffer.c \ src/core/surface/byte_buffer_queue.c \ src/core/surface/byte_buffer_reader.c \ diff --git a/tools/run_tests/sources_and_headers.json b/tools/run_tests/sources_and_headers.json index 1e5dd11fcd0..8d5c82b8128 100644 --- a/tools/run_tests/sources_and_headers.json +++ b/tools/run_tests/sources_and_headers.json @@ -12596,6 +12596,7 @@ "src/core/security/server_secure_chttp2.c", "src/core/statistics/census_interface.h", "src/core/statistics/census_rpc_stats.h", + "src/core/surface/api_trace.c", "src/core/surface/byte_buffer.c", "src/core/surface/byte_buffer_queue.c", "src/core/surface/byte_buffer_queue.h", @@ -13060,6 +13061,7 @@ "src/core/profiling/timers.h", "src/core/statistics/census_interface.h", "src/core/statistics/census_rpc_stats.h", + "src/core/surface/api_trace.c", "src/core/surface/byte_buffer.c", "src/core/surface/byte_buffer_queue.c", "src/core/surface/byte_buffer_queue.h", diff --git a/vsprojects/grpc/grpc.vcxproj b/vsprojects/grpc/grpc.vcxproj new file mode 100644 index 00000000000..dc1a58b8dd4 --- /dev/null +++ b/vsprojects/grpc/grpc.vcxproj @@ -0,0 +1,659 @@ + + + + + + Debug-DLL + Win32 + + + Debug-DLL + x64 + + + Release-DLL + Win32 + + + Release-DLL + x64 + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {29D16885-7228-4C31-81ED-5F9187C7F2A9} + + + + v100 + + + v110 + + + v120 + + + StaticLibrary + true + Unicode + + + StaticLibrary + false + true + Unicode + + + StaticLibrary + true + Unicode + + + StaticLibrary + false + true + Unicode + + + + + + + + + + + + grpc + static + Debug + Debug + + + grpc + static + Debug + Debug + + + + NotUsing + Level3 + Disabled + WIN32;_DEBUG;_LIB;_USE_32BIT_TIME_T;%(PreprocessorDefinitions) + true + MultiThreadedDebug + + + Windows + true + + + + + NotUsing + Level3 + Disabled + WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions) + true + MultiThreadedDebug + + + Windows + true + + + + + Level3 + NotUsing + MaxSpeed + true + true + WIN32;NDEBUG;_LIB;_USE_32BIT_TIME_T;%(PreprocessorDefinitions) + true + MultiThreaded + + + Windows + true + true + true + + + + + Level3 + NotUsing + MaxSpeed + true + true + WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions) + true + MultiThreaded + + + Windows + true + true + true + + + + + NotUsing + Level3 + Disabled + WIN32;_DEBUG;_LIB;_USE_32BIT_TIME_T;%(PreprocessorDefinitions) + true + MultiThreadedDebug + + + Windows + true + + + + + NotUsing + Level3 + Disabled + WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions) + true + MultiThreadedDebug + + + Windows + true + + + + + Level3 + NotUsing + MaxSpeed + true + true + WIN32;NDEBUG;_LIB;_USE_32BIT_TIME_T;%(PreprocessorDefinitions) + true + MultiThreaded + + + Windows + true + true + true + + + + + Level3 + NotUsing + MaxSpeed + true + true + WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions) + true + MultiThreaded + + + Windows + true + true + true + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {B23D3D1A-9438-4EDA-BEB6-9A0A03D17792} + + + + + + + + + + + + + + + This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. + + + + + + + + diff --git a/vsprojects/grpc/grpc.vcxproj.filters b/vsprojects/grpc/grpc.vcxproj.filters new file mode 100644 index 00000000000..624bac04f5b --- /dev/null +++ b/vsprojects/grpc/grpc.vcxproj.filters @@ -0,0 +1,874 @@ + + + + + src\core\httpcli + + + src\core\security + + + src\core\security + + + src\core\security + + + src\core\security + + + src\core\security + + + src\core\security + + + src\core\security + + + src\core\security + + + src\core\security + + + src\core\security + + + src\core\security + + + src\core\security + + + src\core\security + + + src\core\security + + + src\core\security + + + src\core\surface + + + src\core\surface + + + src\core\tsi + + + src\core\tsi + + + src\core\tsi + + + src\core\census + + + src\core\census + + + src\core\channel + + + src\core\channel + + + src\core\channel + + + src\core\channel + + + src\core\channel + + + src\core\channel + + + src\core\channel + + + src\core\channel + + + src\core\client_config + + + src\core\client_config + + + src\core\client_config\lb_policies + + + src\core\client_config + + + src\core\client_config + + + src\core\client_config + + + src\core\client_config + + + src\core\client_config\resolvers + + + src\core\client_config\resolvers + + + src\core\client_config + + + src\core\client_config + + + src\core\client_config\subchannel_factory_decorators + + + src\core\client_config\subchannel_factory_decorators + + + src\core\client_config + + + src\core\compression + + + src\core\compression + + + src\core\debug + + + src\core\httpcli + + + src\core\httpcli + + + src\core\httpcli + + + src\core\iomgr + + + src\core\iomgr + + + src\core\iomgr + + + src\core\iomgr + + + src\core\iomgr + + + src\core\iomgr + + + src\core\iomgr + + + src\core\iomgr + + + src\core\iomgr + + + src\core\iomgr + + + src\core\iomgr + + + src\core\iomgr + + + src\core\iomgr + + + src\core\iomgr + + + src\core\iomgr + + + src\core\iomgr + + + src\core\iomgr + + + src\core\iomgr + + + src\core\iomgr + + + src\core\iomgr + + + src\core\iomgr + + + src\core\iomgr + + + src\core\iomgr + + + src\core\iomgr + + + src\core\iomgr + + + src\core\iomgr + + + src\core\iomgr + + + src\core\iomgr + + + src\core\iomgr + + + src\core\iomgr + + + src\core\iomgr + + + src\core\iomgr + + + src\core\iomgr + + + src\core\iomgr + + + src\core\iomgr + + + src\core\json + + + src\core\json + + + src\core\json + + + src\core\json + + + src\core\profiling + + + src\core\profiling + + + src\core\surface + + + src\core\surface + + + src\core\surface + + + src\core\surface + + + src\core\surface + + + src\core\surface + + + src\core\surface + + + src\core\surface + + + src\core\surface + + + src\core\surface + + + src\core\surface + + + src\core\surface + + + src\core\surface + + + src\core\surface + + + src\core\surface + + + src\core\surface + + + src\core\surface + + + src\core\surface + + + src\core\surface + + + src\core\surface + + + src\core\transport\chttp2 + + + src\core\transport\chttp2 + + + src\core\transport\chttp2 + + + src\core\transport\chttp2 + + + src\core\transport\chttp2 + + + src\core\transport\chttp2 + + + src\core\transport\chttp2 + + + src\core\transport\chttp2 + + + src\core\transport\chttp2 + + + src\core\transport\chttp2 + + + src\core\transport\chttp2 + + + src\core\transport\chttp2 + + + src\core\transport\chttp2 + + + src\core\transport\chttp2 + + + src\core\transport\chttp2 + + + src\core\transport\chttp2 + + + src\core\transport\chttp2 + + + src\core\transport\chttp2 + + + src\core\transport\chttp2 + + + src\core\transport\chttp2 + + + src\core\transport + + + src\core\transport + + + src\core\transport + + + src\core\transport + + + src\core\transport + + + src\core\transport + + + src\core\census + + + src\core\census + + + src\core\census + + + + + include\grpc + + + include\grpc + + + include\grpc + + + include\grpc + + + include\grpc + + + include\grpc + + + include\grpc + + + + + src\core\security + + + src\core\security + + + src\core\security + + + src\core\security + + + src\core\security + + + src\core\security + + + src\core\security + + + src\core\security + + + src\core\security + + + src\core\tsi + + + src\core\tsi + + + src\core\tsi + + + src\core\tsi + + + src\core\census + + + src\core\channel + + + src\core\channel + + + src\core\channel + + + src\core\channel + + + src\core\channel + + + src\core\channel + + + src\core\channel + + + src\core\channel + + + src\core\channel + + + src\core\client_config + + + src\core\client_config + + + src\core\client_config\lb_policies + + + src\core\client_config + + + src\core\client_config + + + src\core\client_config + + + src\core\client_config + + + src\core\client_config\resolvers + + + src\core\client_config\resolvers + + + src\core\client_config + + + src\core\client_config + + + src\core\client_config\subchannel_factory_decorators + + + src\core\client_config\subchannel_factory_decorators + + + src\core\client_config + + + src\core\compression + + + src\core\debug + + + src\core\httpcli + + + src\core\httpcli + + + src\core\httpcli + + + src\core\iomgr + + + src\core\iomgr + + + src\core\iomgr + + + src\core\iomgr + + + src\core\iomgr + + + src\core\iomgr + + + src\core\iomgr + + + src\core\iomgr + + + src\core\iomgr + + + src\core\iomgr + + + src\core\iomgr + + + src\core\iomgr + + + src\core\iomgr + + + src\core\iomgr + + + src\core\iomgr + + + src\core\iomgr + + + src\core\iomgr + + + src\core\iomgr + + + src\core\iomgr + + + src\core\iomgr + + + src\core\iomgr + + + src\core\iomgr + + + src\core\iomgr + + + src\core\iomgr + + + src\core\iomgr + + + src\core\iomgr + + + src\core\iomgr + + + src\core\iomgr + + + src\core\iomgr + + + src\core\iomgr + + + src\core\iomgr + + + src\core\json + + + src\core\json + + + src\core\json + + + src\core\json + + + src\core\profiling + + + src\core\profiling + + + src\core\statistics + + + src\core\statistics + + + src\core\surface + + + src\core\surface + + + src\core\surface + + + src\core\surface + + + src\core\surface + + + src\core\surface + + + src\core\surface + + + src\core\surface + + + src\core\transport\chttp2 + + + src\core\transport\chttp2 + + + src\core\transport\chttp2 + + + src\core\transport\chttp2 + + + src\core\transport\chttp2 + + + src\core\transport\chttp2 + + + src\core\transport\chttp2 + + + src\core\transport\chttp2 + + + src\core\transport\chttp2 + + + src\core\transport\chttp2 + + + src\core\transport\chttp2 + + + src\core\transport\chttp2 + + + src\core\transport\chttp2 + + + src\core\transport\chttp2 + + + src\core\transport\chttp2 + + + src\core\transport\chttp2 + + + src\core\transport\chttp2 + + + src\core\transport\chttp2 + + + src\core\transport\chttp2 + + + src\core\transport\chttp2 + + + src\core\transport + + + src\core\transport + + + src\core\transport + + + src\core\transport + + + src\core\transport + + + src\core\transport + + + src\core\census + + + src\core\census + + + + + + {968de0a1-346d-b75a-6f19-6a55119b8235} + + + {880c644d-b84f-cfca-98bd-e145f36232ab} + + + {d538af37-07b2-062b-fa2a-d9f882cb2737} + + + {ea745680-21ea-9c5e-679b-64dc40562d08} + + + {fb3aefc2-8205-b0bf-525f-ab5e339f7f76} + + + {d897b6c3-c555-234e-a589-b4f008063615} + + + {e71e6928-b1e3-0616-0961-1505370458ab} + + + {a3eca4d5-f760-61a6-7251-556b828c8b44} + + + {6d97b8d9-2c15-927a-892a-709d073c02ab} + + + {428cdbb1-c777-2c64-79b3-43d6ee413061} + + + {263cb913-dfe6-42a4-096b-cac231f76305} + + + {1da7ef8a-a06d-5499-b3de-19fee4a4214d} + + + {a9bc00ad-835f-c625-c6d9-6a1324f98b9f} + + + {1baf3894-af37-e647-bdbc-95dc17ed0073} + + + {e665cc0e-b994-d7c5-cc18-2007392019f0} + + + {87674b72-0f05-0469-481a-bd8c7af9ad80} + + + {1d850ac6-e639-4eab-5338-4ba40272fcc9} + + + {0ef49896-2313-4a3f-1ce2-716fa0e5c6ca} + + + {aeb18e82-5d25-0aad-8b02-a0a3470073ce} + + + {168fa1b1-1c18-eb55-9a4d-746bc58df2c1} + + + {b8b623c3-a168-a2b1-0d5f-b70a1f1cd8d2} + + + {0b0f9ab1-efa4-7f03-e446-6fb9b5227e84} + + + + diff --git a/vsprojects/grpc_unsecure/grpc_unsecure.vcxproj b/vsprojects/grpc_unsecure/grpc_unsecure.vcxproj new file mode 100644 index 00000000000..2329d3532cc --- /dev/null +++ b/vsprojects/grpc_unsecure/grpc_unsecure.vcxproj @@ -0,0 +1,597 @@ + + + + + Debug-DLL + Win32 + + + Debug-DLL + x64 + + + Release-DLL + Win32 + + + Release-DLL + x64 + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {46CEDFFF-9692-456A-AA24-38B5D6BCF4C5} + + + + v100 + + + v110 + + + v120 + + + StaticLibrary + true + Unicode + + + StaticLibrary + false + true + Unicode + + + StaticLibrary + true + Unicode + + + StaticLibrary + false + true + Unicode + + + + + + + + + + + + grpc_unsecure + static + Debug + + + grpc_unsecure + static + Debug + + + + NotUsing + Level3 + Disabled + WIN32;_DEBUG;_LIB;_USE_32BIT_TIME_T;%(PreprocessorDefinitions) + true + MultiThreadedDebug + + + Windows + true + + + + + NotUsing + Level3 + Disabled + WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions) + true + MultiThreadedDebug + + + Windows + true + + + + + Level3 + NotUsing + MaxSpeed + true + true + WIN32;NDEBUG;_LIB;_USE_32BIT_TIME_T;%(PreprocessorDefinitions) + true + MultiThreaded + + + Windows + true + true + true + + + + + Level3 + NotUsing + MaxSpeed + true + true + WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions) + true + MultiThreaded + + + Windows + true + true + true + + + + + NotUsing + Level3 + Disabled + WIN32;_DEBUG;_LIB;_USE_32BIT_TIME_T;%(PreprocessorDefinitions) + true + MultiThreadedDebug + + + Windows + true + + + + + NotUsing + Level3 + Disabled + WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions) + true + MultiThreadedDebug + + + Windows + true + + + + + Level3 + NotUsing + MaxSpeed + true + true + WIN32;NDEBUG;_LIB;_USE_32BIT_TIME_T;%(PreprocessorDefinitions) + true + MultiThreaded + + + Windows + true + true + true + + + + + Level3 + NotUsing + MaxSpeed + true + true + WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions) + true + MultiThreaded + + + Windows + true + true + true + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {B23D3D1A-9438-4EDA-BEB6-9A0A03D17792} + + + + + + + + + + + + + This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. + + + + + diff --git a/vsprojects/grpc_unsecure/grpc_unsecure.vcxproj.filters b/vsprojects/grpc_unsecure/grpc_unsecure.vcxproj.filters new file mode 100644 index 00000000000..493bae2fb8b --- /dev/null +++ b/vsprojects/grpc_unsecure/grpc_unsecure.vcxproj.filters @@ -0,0 +1,766 @@ + + + + + src\core\surface + + + src\core\census + + + src\core\census + + + src\core\channel + + + src\core\channel + + + src\core\channel + + + src\core\channel + + + src\core\channel + + + src\core\channel + + + src\core\channel + + + src\core\channel + + + src\core\client_config + + + src\core\client_config + + + src\core\client_config\lb_policies + + + src\core\client_config + + + src\core\client_config + + + src\core\client_config + + + src\core\client_config + + + src\core\client_config\resolvers + + + src\core\client_config\resolvers + + + src\core\client_config + + + src\core\client_config + + + src\core\client_config\subchannel_factory_decorators + + + src\core\client_config\subchannel_factory_decorators + + + src\core\client_config + + + src\core\compression + + + src\core\compression + + + src\core\debug + + + src\core\httpcli + + + src\core\httpcli + + + src\core\httpcli + + + src\core\iomgr + + + src\core\iomgr + + + src\core\iomgr + + + src\core\iomgr + + + src\core\iomgr + + + src\core\iomgr + + + src\core\iomgr + + + src\core\iomgr + + + src\core\iomgr + + + src\core\iomgr + + + src\core\iomgr + + + src\core\iomgr + + + src\core\iomgr + + + src\core\iomgr + + + src\core\iomgr + + + src\core\iomgr + + + src\core\iomgr + + + src\core\iomgr + + + src\core\iomgr + + + src\core\iomgr + + + src\core\iomgr + + + src\core\iomgr + + + src\core\iomgr + + + src\core\iomgr + + + src\core\iomgr + + + src\core\iomgr + + + src\core\iomgr + + + src\core\iomgr + + + src\core\iomgr + + + src\core\iomgr + + + src\core\iomgr + + + src\core\iomgr + + + src\core\iomgr + + + src\core\iomgr + + + src\core\iomgr + + + src\core\json + + + src\core\json + + + src\core\json + + + src\core\json + + + src\core\profiling + + + src\core\profiling + + + src\core\surface + + + src\core\surface + + + src\core\surface + + + src\core\surface + + + src\core\surface + + + src\core\surface + + + src\core\surface + + + src\core\surface + + + src\core\surface + + + src\core\surface + + + src\core\surface + + + src\core\surface + + + src\core\surface + + + src\core\surface + + + src\core\surface + + + src\core\surface + + + src\core\surface + + + src\core\surface + + + src\core\surface + + + src\core\surface + + + src\core\transport\chttp2 + + + src\core\transport\chttp2 + + + src\core\transport\chttp2 + + + src\core\transport\chttp2 + + + src\core\transport\chttp2 + + + src\core\transport\chttp2 + + + src\core\transport\chttp2 + + + src\core\transport\chttp2 + + + src\core\transport\chttp2 + + + src\core\transport\chttp2 + + + src\core\transport\chttp2 + + + src\core\transport\chttp2 + + + src\core\transport\chttp2 + + + src\core\transport\chttp2 + + + src\core\transport\chttp2 + + + src\core\transport\chttp2 + + + src\core\transport\chttp2 + + + src\core\transport\chttp2 + + + src\core\transport\chttp2 + + + src\core\transport\chttp2 + + + src\core\transport + + + src\core\transport + + + src\core\transport + + + src\core\transport + + + src\core\transport + + + src\core\transport + + + src\core\census + + + src\core\census + + + src\core\census + + + + + include\grpc + + + include\grpc + + + include\grpc + + + include\grpc + + + include\grpc + + + include\grpc + + + + + src\core\census + + + src\core\channel + + + src\core\channel + + + src\core\channel + + + src\core\channel + + + src\core\channel + + + src\core\channel + + + src\core\channel + + + src\core\channel + + + src\core\channel + + + src\core\client_config + + + src\core\client_config + + + src\core\client_config\lb_policies + + + src\core\client_config + + + src\core\client_config + + + src\core\client_config + + + src\core\client_config + + + src\core\client_config\resolvers + + + src\core\client_config\resolvers + + + src\core\client_config + + + src\core\client_config + + + src\core\client_config\subchannel_factory_decorators + + + src\core\client_config\subchannel_factory_decorators + + + src\core\client_config + + + src\core\compression + + + src\core\debug + + + src\core\httpcli + + + src\core\httpcli + + + src\core\httpcli + + + src\core\iomgr + + + src\core\iomgr + + + src\core\iomgr + + + src\core\iomgr + + + src\core\iomgr + + + src\core\iomgr + + + src\core\iomgr + + + src\core\iomgr + + + src\core\iomgr + + + src\core\iomgr + + + src\core\iomgr + + + src\core\iomgr + + + src\core\iomgr + + + src\core\iomgr + + + src\core\iomgr + + + src\core\iomgr + + + src\core\iomgr + + + src\core\iomgr + + + src\core\iomgr + + + src\core\iomgr + + + src\core\iomgr + + + src\core\iomgr + + + src\core\iomgr + + + src\core\iomgr + + + src\core\iomgr + + + src\core\iomgr + + + src\core\iomgr + + + src\core\iomgr + + + src\core\iomgr + + + src\core\iomgr + + + src\core\iomgr + + + src\core\json + + + src\core\json + + + src\core\json + + + src\core\json + + + src\core\profiling + + + src\core\profiling + + + src\core\statistics + + + src\core\statistics + + + src\core\surface + + + src\core\surface + + + src\core\surface + + + src\core\surface + + + src\core\surface + + + src\core\surface + + + src\core\surface + + + src\core\surface + + + src\core\transport\chttp2 + + + src\core\transport\chttp2 + + + src\core\transport\chttp2 + + + src\core\transport\chttp2 + + + src\core\transport\chttp2 + + + src\core\transport\chttp2 + + + src\core\transport\chttp2 + + + src\core\transport\chttp2 + + + src\core\transport\chttp2 + + + src\core\transport\chttp2 + + + src\core\transport\chttp2 + + + src\core\transport\chttp2 + + + src\core\transport\chttp2 + + + src\core\transport\chttp2 + + + src\core\transport\chttp2 + + + src\core\transport\chttp2 + + + src\core\transport\chttp2 + + + src\core\transport\chttp2 + + + src\core\transport\chttp2 + + + src\core\transport\chttp2 + + + src\core\transport + + + src\core\transport + + + src\core\transport + + + src\core\transport + + + src\core\transport + + + src\core\transport + + + src\core\census + + + src\core\census + + + + + + {10076c7e-7c8e-8005-0c81-64454af2cbc8} + + + {77b9717b-b8d8-dd5f-14bb-a3e96809a70a} + + + {aaf326a1-c884-46ea-875a-cbbd9983e539} + + + {88491077-386b-2039-d14c-0c40136b5f7a} + + + {a7596ee2-afee-3a82-7e6e-bd8b8f904e04} + + + {cc102c4b-66ff-cf4c-2288-d76327e1a183} + + + {02bd7340-02ee-4337-ffa5-0b6ecc7cf60c} + + + {308af086-46c7-fa66-9021-19b1c3d4a6bd} + + + {dd617c24-6f07-fdff-80d5-c8610d6f815e} + + + {64285d1a-ebd0-7637-ae20-15df5ca6cc83} + + + {2e3aca1d-223d-10a1-b282-7f9fc68ee6f5} + + + {6d8d5774-7291-554d-fafa-583463cd3fd9} + + + {1ba3a245-47e7-89b5-b0c9-aca758bd0277} + + + {a9df8b24-ecea-ff6d-8999-d8fa54cd70bf} + + + {443ffc61-1bea-2477-6e54-1ddf8c139264} + + + {7f91d9bf-c9de-835a-d74d-b16f843b89a9} + + + {e084164c-a069-00e3-db35-4e0b1cd6f0b7} + + + {6cd0127e-c24b-d43c-38f5-198db8d4322a} + + + {6687ff98-e36e-c0b1-2756-1bc79edec406} + + + {5fcd6206-f774-9ae6-4b85-305d6a723843} + + + + From 7307b1a706e40be9e497915d72e6009e8b16d358 Mon Sep 17 00:00:00 2001 From: Masood Malekghassemi Date: Thu, 20 Aug 2015 18:49:53 -0700 Subject: [PATCH 61/79] Coalesce GRPC_TRACE=surface with API tracing --- src/core/surface/call.h | 7 ++++--- src/core/surface/init.c | 1 - src/core/surface/surface_trace.c | 36 -------------------------------- src/core/surface/surface_trace.h | 5 ++--- 4 files changed, 6 insertions(+), 43 deletions(-) delete mode 100644 src/core/surface/surface_trace.c diff --git a/src/core/surface/call.h b/src/core/surface/call.h index b1a1045792b..acfedf40cd4 100644 --- a/src/core/surface/call.h +++ b/src/core/surface/call.h @@ -36,6 +36,7 @@ #include "src/core/channel/channel_stack.h" #include "src/core/channel/context.h" +#include "src/core/surface/api_trace.h" #include "src/core/surface/surface_trace.h" #include @@ -154,17 +155,17 @@ void grpc_call_context_set(grpc_call *call, grpc_context_index elem, void *grpc_call_context_get(grpc_call *call, grpc_context_index elem); #define GRPC_CALL_LOG_BATCH(sev, call, ops, nops, tag) \ - if (grpc_surface_trace) grpc_call_log_batch(sev, call, ops, nops, tag) + if (grpc_api_trace) grpc_call_log_batch(sev, call, ops, nops, tag) #define GRPC_SERVER_LOG_REQUEST_CALL(sev, server, call, details, \ initial_metadata, cq_bound_to_call, \ cq_for_notifications, tag) \ - if (grpc_surface_trace) \ + if (grpc_api_trace) \ grpc_server_log_request_call(sev, server, call, details, initial_metadata, \ cq_bound_to_call, cq_for_notifications, tag) #define GRPC_SERVER_LOG_SHUTDOWN(sev, server, cq, tag) \ - if (grpc_surface_trace) grpc_server_log_shutdown(sev, server, cq, tag) + if (grpc_api_trace) grpc_server_log_shutdown(sev, server, cq, tag) gpr_uint8 grpc_call_is_client(grpc_call *call); diff --git a/src/core/surface/init.c b/src/core/surface/init.c index 96ab5ecb60b..95011cab178 100644 --- a/src/core/surface/init.c +++ b/src/core/surface/init.c @@ -103,7 +103,6 @@ void grpc_init(void) { #endif grpc_register_tracer("api", &grpc_api_trace); grpc_register_tracer("channel", &grpc_trace_channel); - grpc_register_tracer("surface", &grpc_surface_trace); grpc_register_tracer("http", &grpc_http_trace); grpc_register_tracer("flowctl", &grpc_flowctl_trace); grpc_register_tracer("connectivity_state", &grpc_connectivity_state_trace); diff --git a/src/core/surface/surface_trace.c b/src/core/surface/surface_trace.c deleted file mode 100644 index 57a0053162a..00000000000 --- a/src/core/surface/surface_trace.c +++ /dev/null @@ -1,36 +0,0 @@ -/* - * - * Copyright 2015, Google Inc. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following disclaimer - * in the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#include "src/core/surface/surface_trace.h" - -int grpc_surface_trace = 0; diff --git a/src/core/surface/surface_trace.h b/src/core/surface/surface_trace.h index 2b4728e2b4b..51329a49842 100644 --- a/src/core/surface/surface_trace.h +++ b/src/core/surface/surface_trace.h @@ -35,12 +35,11 @@ #define GRPC_INTERNAL_CORE_SURFACE_SURFACE_TRACE_H #include "src/core/debug/trace.h" +#include "src/core/surface/api_trace.h" #include -extern int grpc_surface_trace; - #define GRPC_SURFACE_TRACE_RETURNED_EVENT(cq, event) \ - if (grpc_surface_trace) { \ + if (grpc_api_trace) { \ char *_ev = grpc_event_string(event); \ gpr_log(GPR_INFO, "RETURN_EVENT[%p]: %s", cq, _ev); \ gpr_free(_ev); \ From 92298107521cda48f2a29050e9ac0965da470200 Mon Sep 17 00:00:00 2001 From: Masood Malekghassemi Date: Thu, 20 Aug 2015 18:50:17 -0700 Subject: [PATCH 62/79] Update build files --- BUILD | 6 +++--- Makefile | 2 -- build.json | 2 +- gRPC.podspec | 3 ++- tools/doxygen/Doxyfile.core.internal | 2 +- tools/run_tests/sources_and_headers.json | 6 ++++-- vsprojects/grpc/grpc.vcxproj | 3 +-- vsprojects/grpc/grpc.vcxproj.filters | 6 +++--- vsprojects/grpc_unsecure/grpc_unsecure.vcxproj | 3 +-- vsprojects/grpc_unsecure/grpc_unsecure.vcxproj.filters | 6 +++--- 10 files changed, 19 insertions(+), 20 deletions(-) diff --git a/BUILD b/BUILD index c4ff5ee7972..3e2a45b8a0a 100644 --- a/BUILD +++ b/BUILD @@ -220,6 +220,7 @@ cc_library( "src/core/profiling/timers.h", "src/core/statistics/census_interface.h", "src/core/statistics/census_rpc_stats.h", + "src/core/surface/api_trace.h", "src/core/surface/byte_buffer_queue.h", "src/core/surface/call.h", "src/core/surface/channel.h", @@ -374,7 +375,6 @@ cc_library( "src/core/surface/server.c", "src/core/surface/server_chttp2.c", "src/core/surface/server_create.c", - "src/core/surface/surface_trace.c", "src/core/surface/version.c", "src/core/transport/chttp2/alpn.c", "src/core/transport/chttp2/bin_encoder.c", @@ -506,6 +506,7 @@ cc_library( "src/core/profiling/timers.h", "src/core/statistics/census_interface.h", "src/core/statistics/census_rpc_stats.h", + "src/core/surface/api_trace.h", "src/core/surface/byte_buffer_queue.h", "src/core/surface/call.h", "src/core/surface/channel.h", @@ -640,7 +641,6 @@ cc_library( "src/core/surface/server.c", "src/core/surface/server_chttp2.c", "src/core/surface/server_create.c", - "src/core/surface/surface_trace.c", "src/core/surface/version.c", "src/core/transport/chttp2/alpn.c", "src/core/transport/chttp2/bin_encoder.c", @@ -1165,7 +1165,6 @@ objc_library( "src/core/surface/server.c", "src/core/surface/server_chttp2.c", "src/core/surface/server_create.c", - "src/core/surface/surface_trace.c", "src/core/surface/version.c", "src/core/transport/chttp2/alpn.c", "src/core/transport/chttp2/bin_encoder.c", @@ -1294,6 +1293,7 @@ objc_library( "src/core/profiling/timers.h", "src/core/statistics/census_interface.h", "src/core/statistics/census_rpc_stats.h", + "src/core/surface/api_trace.h", "src/core/surface/byte_buffer_queue.h", "src/core/surface/call.h", "src/core/surface/channel.h", diff --git a/Makefile b/Makefile index ca365a8dbe3..8eb94f768a2 100644 --- a/Makefile +++ b/Makefile @@ -4137,7 +4137,6 @@ LIBGRPC_SRC = \ src/core/surface/server.c \ src/core/surface/server_chttp2.c \ src/core/surface/server_create.c \ - src/core/surface/surface_trace.c \ src/core/surface/version.c \ src/core/transport/chttp2/alpn.c \ src/core/transport/chttp2/bin_encoder.c \ @@ -4420,7 +4419,6 @@ LIBGRPC_UNSECURE_SRC = \ src/core/surface/server.c \ src/core/surface/server_chttp2.c \ src/core/surface/server_create.c \ - src/core/surface/surface_trace.c \ src/core/surface/version.c \ src/core/transport/chttp2/alpn.c \ src/core/transport/chttp2/bin_encoder.c \ diff --git a/build.json b/build.json index c68569e9f1a..0a4248c7a8d 100644 --- a/build.json +++ b/build.json @@ -184,6 +184,7 @@ "src/core/profiling/timers_preciseclock.h", "src/core/statistics/census_interface.h", "src/core/statistics/census_rpc_stats.h", + "src/core/surface/api_trace.h", "src/core/surface/byte_buffer_queue.h", "src/core/surface/call.h", "src/core/surface/channel.h", @@ -309,7 +310,6 @@ "src/core/surface/server.c", "src/core/surface/server_chttp2.c", "src/core/surface/server_create.c", - "src/core/surface/surface_trace.c", "src/core/surface/version.c", "src/core/transport/chttp2/alpn.c", "src/core/transport/chttp2/bin_encoder.c", diff --git a/gRPC.podspec b/gRPC.podspec index dfb52a88bf7..2636a38882c 100644 --- a/gRPC.podspec +++ b/gRPC.podspec @@ -223,6 +223,7 @@ Pod::Spec.new do |s| 'src/core/profiling/timers.h', 'src/core/statistics/census_interface.h', 'src/core/statistics/census_rpc_stats.h', + 'src/core/surface/api_trace.h', 'src/core/surface/byte_buffer_queue.h', 'src/core/surface/call.h', 'src/core/surface/channel.h', @@ -384,7 +385,6 @@ Pod::Spec.new do |s| 'src/core/surface/server.c', 'src/core/surface/server_chttp2.c', 'src/core/surface/server_create.c', - 'src/core/surface/surface_trace.c', 'src/core/surface/version.c', 'src/core/transport/chttp2/alpn.c', 'src/core/transport/chttp2/bin_encoder.c', @@ -514,6 +514,7 @@ Pod::Spec.new do |s| 'src/core/profiling/timers.h', 'src/core/statistics/census_interface.h', 'src/core/statistics/census_rpc_stats.h', + 'src/core/surface/api_trace.h', 'src/core/surface/byte_buffer_queue.h', 'src/core/surface/call.h', 'src/core/surface/channel.h', diff --git a/tools/doxygen/Doxyfile.core.internal b/tools/doxygen/Doxyfile.core.internal index 123280ca1b2..5658a102d75 100644 --- a/tools/doxygen/Doxyfile.core.internal +++ b/tools/doxygen/Doxyfile.core.internal @@ -855,6 +855,7 @@ src/core/json/json_writer.h \ src/core/profiling/timers.h \ src/core/statistics/census_interface.h \ src/core/statistics/census_rpc_stats.h \ +src/core/surface/api_trace.h \ src/core/surface/byte_buffer_queue.h \ src/core/surface/call.h \ src/core/surface/channel.h \ @@ -1009,7 +1010,6 @@ src/core/surface/metadata_array.c \ src/core/surface/server.c \ src/core/surface/server_chttp2.c \ src/core/surface/server_create.c \ -src/core/surface/surface_trace.c \ src/core/surface/version.c \ src/core/transport/chttp2/alpn.c \ src/core/transport/chttp2/bin_encoder.c \ diff --git a/tools/run_tests/sources_and_headers.json b/tools/run_tests/sources_and_headers.json index 8d5c82b8128..1ceff15a3be 100644 --- a/tools/run_tests/sources_and_headers.json +++ b/tools/run_tests/sources_and_headers.json @@ -12362,6 +12362,7 @@ "src/core/security/security_context.h", "src/core/statistics/census_interface.h", "src/core/statistics/census_rpc_stats.h", + "src/core/surface/api_trace.h", "src/core/surface/byte_buffer_queue.h", "src/core/surface/call.h", "src/core/surface/channel.h", @@ -12597,6 +12598,7 @@ "src/core/statistics/census_interface.h", "src/core/statistics/census_rpc_stats.h", "src/core/surface/api_trace.c", + "src/core/surface/api_trace.h", "src/core/surface/byte_buffer.c", "src/core/surface/byte_buffer_queue.c", "src/core/surface/byte_buffer_queue.h", @@ -12623,7 +12625,6 @@ "src/core/surface/server.h", "src/core/surface/server_chttp2.c", "src/core/surface/server_create.c", - "src/core/surface/surface_trace.c", "src/core/surface/surface_trace.h", "src/core/surface/version.c", "src/core/transport/chttp2/alpn.c", @@ -12857,6 +12858,7 @@ "src/core/profiling/timers.h", "src/core/statistics/census_interface.h", "src/core/statistics/census_rpc_stats.h", + "src/core/surface/api_trace.h", "src/core/surface/byte_buffer_queue.h", "src/core/surface/call.h", "src/core/surface/channel.h", @@ -13062,6 +13064,7 @@ "src/core/statistics/census_interface.h", "src/core/statistics/census_rpc_stats.h", "src/core/surface/api_trace.c", + "src/core/surface/api_trace.h", "src/core/surface/byte_buffer.c", "src/core/surface/byte_buffer_queue.c", "src/core/surface/byte_buffer_queue.h", @@ -13087,7 +13090,6 @@ "src/core/surface/server.h", "src/core/surface/server_chttp2.c", "src/core/surface/server_create.c", - "src/core/surface/surface_trace.c", "src/core/surface/surface_trace.h", "src/core/surface/version.c", "src/core/transport/chttp2/alpn.c", diff --git a/vsprojects/grpc/grpc.vcxproj b/vsprojects/grpc/grpc.vcxproj index dc1a58b8dd4..c6750948677 100644 --- a/vsprojects/grpc/grpc.vcxproj +++ b/vsprojects/grpc/grpc.vcxproj @@ -310,6 +310,7 @@ + @@ -568,8 +569,6 @@ - - diff --git a/vsprojects/grpc/grpc.vcxproj.filters b/vsprojects/grpc/grpc.vcxproj.filters index 624bac04f5b..5bde4656165 100644 --- a/vsprojects/grpc/grpc.vcxproj.filters +++ b/vsprojects/grpc/grpc.vcxproj.filters @@ -331,9 +331,6 @@ src\core\surface - - src\core\surface - src\core\surface @@ -692,6 +689,9 @@ src\core\statistics + + src\core\surface + src\core\surface diff --git a/vsprojects/grpc_unsecure/grpc_unsecure.vcxproj b/vsprojects/grpc_unsecure/grpc_unsecure.vcxproj index 2329d3532cc..60143f1ab12 100644 --- a/vsprojects/grpc_unsecure/grpc_unsecure.vcxproj +++ b/vsprojects/grpc_unsecure/grpc_unsecure.vcxproj @@ -293,6 +293,7 @@ + @@ -511,8 +512,6 @@ - - diff --git a/vsprojects/grpc_unsecure/grpc_unsecure.vcxproj.filters b/vsprojects/grpc_unsecure/grpc_unsecure.vcxproj.filters index 493bae2fb8b..edfa397e37e 100644 --- a/vsprojects/grpc_unsecure/grpc_unsecure.vcxproj.filters +++ b/vsprojects/grpc_unsecure/grpc_unsecure.vcxproj.filters @@ -271,9 +271,6 @@ src\core\surface - - src\core\surface - src\core\surface @@ -590,6 +587,9 @@ src\core\statistics + + src\core\surface + src\core\surface From cff6469dfc1beb118773961106ae884234a908f5 Mon Sep 17 00:00:00 2001 From: "Nicolas \"Pixel\" Noble" Date: Sat, 3 Oct 2015 02:01:51 +0200 Subject: [PATCH 63/79] Making template agree with clang-format. --- gRPC.podspec | 1 + src/core/surface/version.c | 4 +--- templates/src/core/surface/version.c.template | 5 ++--- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/gRPC.podspec b/gRPC.podspec index 46823453bab..122c16eff85 100644 --- a/gRPC.podspec +++ b/gRPC.podspec @@ -46,6 +46,7 @@ Pod::Spec.new do |s| s.source = { :git => 'https://github.com/grpc/grpc.git', :tag => "release-#{version.gsub(/\./, '_')}-objectivec-#{version}" } + s.ios.deployment_target = '7.1' s.osx.deployment_target = '10.9' s.requires_arc = true diff --git a/src/core/surface/version.c b/src/core/surface/version.c index 4b90e06a043..e559d51448a 100644 --- a/src/core/surface/version.c +++ b/src/core/surface/version.c @@ -36,6 +36,4 @@ #include -const char *grpc_version_string(void) { - return "0.11.0.0"; -} +const char *grpc_version_string(void) { return "0.11.0.0"; } diff --git a/templates/src/core/surface/version.c.template b/templates/src/core/surface/version.c.template index 3e6840460fa..31a5af99cae 100644 --- a/templates/src/core/surface/version.c.template +++ b/templates/src/core/surface/version.c.template @@ -38,6 +38,5 @@ #include - const char *grpc_version_string(void) { - return "${settings.version.major}.${settings.version.minor}.${settings.version.micro}.${settings.version.build}"; - } + const char *grpc_version_string(void) { \ + return "${settings.version.major}.${settings.version.minor}.${settings.version.micro}.${settings.version.build}"; } From 9baaeade7cfca46f79af20f9e9235b80a3aa9735 Mon Sep 17 00:00:00 2001 From: "Nicolas \"Pixel\" Noble" Date: Sat, 3 Oct 2015 02:25:02 +0200 Subject: [PATCH 64/79] Get sanity to output more interesting information if it fails. --- tools/buildgen/generate_projects.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/buildgen/generate_projects.py b/tools/buildgen/generate_projects.py index c3e2b120516..e0bd6759bd0 100755 --- a/tools/buildgen/generate_projects.py +++ b/tools/buildgen/generate_projects.py @@ -78,8 +78,8 @@ jobset.run(jobs) if test is not None: for s, g in test.iteritems(): if os.path.isfile(g): - assert(0 == os.system('diff %s %s' % (s, g))) + assert 0 == os.system('diff %s %s' % (s, g)), s os.unlink(g) else: - assert(0 == os.system('diff -r %s %s' % (s, g))) + assert 0 == os.system('diff -r %s %s' % (s, g)), s shutil.rmtree(g, ignore_errors=True) From 9260a95062ceb278f2e644a537705cbb4aeca56c Mon Sep 17 00:00:00 2001 From: David Garcia Quintas Date: Sat, 3 Oct 2015 15:53:27 -0700 Subject: [PATCH 65/79] Explicit Python version for port_server --- tools/run_tests/run_tests.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/run_tests/run_tests.py b/tools/run_tests/run_tests.py index 38c06764b9b..51008538f27 100755 --- a/tools/run_tests/run_tests.py +++ b/tools/run_tests/run_tests.py @@ -728,7 +728,7 @@ def _start_port_server(port_server_port): if not running: port_log = open('portlog.txt', 'w') port_server = subprocess.Popen( - ['python', 'tools/run_tests/port_server.py', '-p', '%d' % port_server_port], + ['python2.7', 'tools/run_tests/port_server.py', '-p', '%d' % port_server_port], stderr=subprocess.STDOUT, stdout=port_log) # ensure port server is up From 9a170333d5b6aaa5eba7663cc583ca34a97ba89b Mon Sep 17 00:00:00 2001 From: David Garcia Quintas Date: Sun, 4 Oct 2015 15:40:54 -0700 Subject: [PATCH 66/79] Idem for generate_projects.py --- gRPC.podspec | 1 + tools/buildgen/generate_projects.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/gRPC.podspec b/gRPC.podspec index 46823453bab..122c16eff85 100644 --- a/gRPC.podspec +++ b/gRPC.podspec @@ -46,6 +46,7 @@ Pod::Spec.new do |s| s.source = { :git => 'https://github.com/grpc/grpc.git', :tag => "release-#{version.gsub(/\./, '_')}-objectivec-#{version}" } + s.ios.deployment_target = '7.1' s.osx.deployment_target = '10.9' s.requires_arc = true diff --git a/tools/buildgen/generate_projects.py b/tools/buildgen/generate_projects.py index c3e2b120516..b2c3c26aa62 100755 --- a/tools/buildgen/generate_projects.py +++ b/tools/buildgen/generate_projects.py @@ -55,7 +55,7 @@ for root, dirs, files in os.walk('templates'): out = out_dir + '/' + os.path.splitext(f)[0] if not os.path.exists(out_dir): os.makedirs(out_dir) - cmd = ['python', 'tools/buildgen/mako_renderer.py'] + cmd = ['python2.7', 'tools/buildgen/mako_renderer.py'] for plugin in plugins: cmd.append('-p') cmd.append(plugin) From 985f22e42b2404420264be0b2e21f81d1efd6b52 Mon Sep 17 00:00:00 2001 From: David Garcia Quintas Date: Sun, 4 Oct 2015 23:14:37 -0700 Subject: [PATCH 67/79] Limited number of parallel jobs for generate_projects --- tools/buildgen/generate_projects.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/buildgen/generate_projects.py b/tools/buildgen/generate_projects.py index b2c3c26aa62..5feebf0cac5 100755 --- a/tools/buildgen/generate_projects.py +++ b/tools/buildgen/generate_projects.py @@ -34,6 +34,7 @@ import os import shutil import sys import tempfile +import multiprocessing sys.path.append(os.path.join(os.path.dirname(sys.argv[0]), '..', 'run_tests')) assert sys.argv[1:], 'run generate_projects.sh instead of this directly' @@ -73,7 +74,7 @@ for root, dirs, files in os.walk('templates'): cmd.append(root + '/' + f) jobs.append(jobset.JobSpec(cmd, shortname=out)) -jobset.run(jobs) +jobset.run(jobs, maxjobs=multiprocessing.cpu_count()) if test is not None: for s, g in test.iteritems(): From 4de3e4f41ee7ca14741dc0c857e27b993868324e Mon Sep 17 00:00:00 2001 From: Craig Tiller Date: Mon, 5 Oct 2015 08:55:50 -0700 Subject: [PATCH 68/79] Restore sanity --- BUILD | 9 ++-- Makefile | 4 +- gRPC.podspec | 4 +- src/core/client_config/subchannel.h | 8 ++-- src/core/compression/algorithm.c | 6 +-- src/core/security/credentials.c | 61 +++++++++++++----------- src/core/security/security_context.c | 2 +- src/core/security/server_secure_chttp2.c | 7 +-- src/core/surface/api_trace.h | 12 ++--- src/core/surface/call.c | 2 +- src/core/surface/call.h | 2 +- src/core/surface/channel.c | 22 ++++----- src/core/surface/channel_connectivity.c | 10 ++-- src/core/surface/completion_queue.c | 16 +++---- src/core/surface/lame_client.c | 2 +- src/core/surface/secure_channel_create.c | 7 +-- src/core/surface/server.c | 10 ++-- src/core/surface/surface_trace.h | 2 +- src/core/surface/version.c | 8 +--- tools/doxygen/Doxyfile.core.internal | 3 +- tools/run_tests/sources_and_headers.json | 8 +--- 21 files changed, 98 insertions(+), 107 deletions(-) diff --git a/BUILD b/BUILD index 3e2a45b8a0a..c8118089bef 100644 --- a/BUILD +++ b/BUILD @@ -220,7 +220,6 @@ cc_library( "src/core/profiling/timers.h", "src/core/statistics/census_interface.h", "src/core/statistics/census_rpc_stats.h", - "src/core/surface/api_trace.h", "src/core/surface/byte_buffer_queue.h", "src/core/surface/call.h", "src/core/surface/channel.h", @@ -357,7 +356,6 @@ cc_library( "src/core/json/json_writer.c", "src/core/profiling/basic_timers.c", "src/core/profiling/stap_timers.c", - "src/core/surface/api_trace.c", "src/core/surface/byte_buffer.c", "src/core/surface/byte_buffer_queue.c", "src/core/surface/byte_buffer_reader.c", @@ -375,6 +373,7 @@ cc_library( "src/core/surface/server.c", "src/core/surface/server_chttp2.c", "src/core/surface/server_create.c", + "src/core/surface/surface_trace.c", "src/core/surface/version.c", "src/core/transport/chttp2/alpn.c", "src/core/transport/chttp2/bin_encoder.c", @@ -506,7 +505,6 @@ cc_library( "src/core/profiling/timers.h", "src/core/statistics/census_interface.h", "src/core/statistics/census_rpc_stats.h", - "src/core/surface/api_trace.h", "src/core/surface/byte_buffer_queue.h", "src/core/surface/call.h", "src/core/surface/channel.h", @@ -623,7 +621,6 @@ cc_library( "src/core/json/json_writer.c", "src/core/profiling/basic_timers.c", "src/core/profiling/stap_timers.c", - "src/core/surface/api_trace.c", "src/core/surface/byte_buffer.c", "src/core/surface/byte_buffer_queue.c", "src/core/surface/byte_buffer_reader.c", @@ -641,6 +638,7 @@ cc_library( "src/core/surface/server.c", "src/core/surface/server_chttp2.c", "src/core/surface/server_create.c", + "src/core/surface/surface_trace.c", "src/core/surface/version.c", "src/core/transport/chttp2/alpn.c", "src/core/transport/chttp2/bin_encoder.c", @@ -1147,7 +1145,6 @@ objc_library( "src/core/json/json_writer.c", "src/core/profiling/basic_timers.c", "src/core/profiling/stap_timers.c", - "src/core/surface/api_trace.c", "src/core/surface/byte_buffer.c", "src/core/surface/byte_buffer_queue.c", "src/core/surface/byte_buffer_reader.c", @@ -1165,6 +1162,7 @@ objc_library( "src/core/surface/server.c", "src/core/surface/server_chttp2.c", "src/core/surface/server_create.c", + "src/core/surface/surface_trace.c", "src/core/surface/version.c", "src/core/transport/chttp2/alpn.c", "src/core/transport/chttp2/bin_encoder.c", @@ -1293,7 +1291,6 @@ objc_library( "src/core/profiling/timers.h", "src/core/statistics/census_interface.h", "src/core/statistics/census_rpc_stats.h", - "src/core/surface/api_trace.h", "src/core/surface/byte_buffer_queue.h", "src/core/surface/call.h", "src/core/surface/channel.h", diff --git a/Makefile b/Makefile index 8eb94f768a2..e0a7b804721 100644 --- a/Makefile +++ b/Makefile @@ -4119,7 +4119,6 @@ LIBGRPC_SRC = \ src/core/json/json_writer.c \ src/core/profiling/basic_timers.c \ src/core/profiling/stap_timers.c \ - src/core/surface/api_trace.c \ src/core/surface/byte_buffer.c \ src/core/surface/byte_buffer_queue.c \ src/core/surface/byte_buffer_reader.c \ @@ -4137,6 +4136,7 @@ LIBGRPC_SRC = \ src/core/surface/server.c \ src/core/surface/server_chttp2.c \ src/core/surface/server_create.c \ + src/core/surface/surface_trace.c \ src/core/surface/version.c \ src/core/transport/chttp2/alpn.c \ src/core/transport/chttp2/bin_encoder.c \ @@ -4401,7 +4401,6 @@ LIBGRPC_UNSECURE_SRC = \ src/core/json/json_writer.c \ src/core/profiling/basic_timers.c \ src/core/profiling/stap_timers.c \ - src/core/surface/api_trace.c \ src/core/surface/byte_buffer.c \ src/core/surface/byte_buffer_queue.c \ src/core/surface/byte_buffer_reader.c \ @@ -4419,6 +4418,7 @@ LIBGRPC_UNSECURE_SRC = \ src/core/surface/server.c \ src/core/surface/server_chttp2.c \ src/core/surface/server_create.c \ + src/core/surface/surface_trace.c \ src/core/surface/version.c \ src/core/transport/chttp2/alpn.c \ src/core/transport/chttp2/bin_encoder.c \ diff --git a/gRPC.podspec b/gRPC.podspec index 717e7005ee5..122c16eff85 100644 --- a/gRPC.podspec +++ b/gRPC.podspec @@ -224,7 +224,6 @@ Pod::Spec.new do |s| 'src/core/profiling/timers.h', 'src/core/statistics/census_interface.h', 'src/core/statistics/census_rpc_stats.h', - 'src/core/surface/api_trace.h', 'src/core/surface/byte_buffer_queue.h', 'src/core/surface/call.h', 'src/core/surface/channel.h', @@ -368,7 +367,6 @@ Pod::Spec.new do |s| 'src/core/json/json_writer.c', 'src/core/profiling/basic_timers.c', 'src/core/profiling/stap_timers.c', - 'src/core/surface/api_trace.c', 'src/core/surface/byte_buffer.c', 'src/core/surface/byte_buffer_queue.c', 'src/core/surface/byte_buffer_reader.c', @@ -386,6 +384,7 @@ Pod::Spec.new do |s| 'src/core/surface/server.c', 'src/core/surface/server_chttp2.c', 'src/core/surface/server_create.c', + 'src/core/surface/surface_trace.c', 'src/core/surface/version.c', 'src/core/transport/chttp2/alpn.c', 'src/core/transport/chttp2/bin_encoder.c', @@ -515,7 +514,6 @@ Pod::Spec.new do |s| 'src/core/profiling/timers.h', 'src/core/statistics/census_interface.h', 'src/core/statistics/census_rpc_stats.h', - 'src/core/surface/api_trace.h', 'src/core/surface/byte_buffer_queue.h', 'src/core/surface/call.h', 'src/core/surface/channel.h', diff --git a/src/core/client_config/subchannel.h b/src/core/client_config/subchannel.h index 03e7cd0590d..86b7fa58513 100644 --- a/src/core/client_config/subchannel.h +++ b/src/core/client_config/subchannel.h @@ -64,13 +64,13 @@ typedef struct grpc_subchannel_args grpc_subchannel_args; #define GRPC_SUBCHANNEL_REF_EXTRA_ARGS #endif -void grpc_subchannel_ref( - grpc_subchannel *channel GRPC_SUBCHANNEL_REF_EXTRA_ARGS); +void grpc_subchannel_ref(grpc_subchannel *channel + GRPC_SUBCHANNEL_REF_EXTRA_ARGS); void grpc_subchannel_unref(grpc_exec_ctx *exec_ctx, grpc_subchannel *channel GRPC_SUBCHANNEL_REF_EXTRA_ARGS); -void grpc_subchannel_call_ref( - grpc_subchannel_call *call GRPC_SUBCHANNEL_REF_EXTRA_ARGS); +void grpc_subchannel_call_ref(grpc_subchannel_call *call + GRPC_SUBCHANNEL_REF_EXTRA_ARGS); void grpc_subchannel_call_unref(grpc_exec_ctx *exec_ctx, grpc_subchannel_call *call GRPC_SUBCHANNEL_REF_EXTRA_ARGS); diff --git a/src/core/compression/algorithm.c b/src/core/compression/algorithm.c index ad7bb8c8133..d55e499f5ea 100644 --- a/src/core/compression/algorithm.c +++ b/src/core/compression/algorithm.c @@ -47,9 +47,9 @@ int grpc_compression_algorithm_parse(const char *name, size_t name_length, * data, for example) */ GRPC_API_TRACE( "grpc_compression_algorithm_parse(" - "name=%*.*s, name_length=%lu, algorithm=%p)", 5, - ((int)name_length, (int)name_length, name, - (unsigned long)name_length, algorithm)); + "name=%*.*s, name_length=%lu, algorithm=%p)", + 5, ((int)name_length, (int)name_length, name, (unsigned long)name_length, + algorithm)); if (name_length == 0) { return 0; } diff --git a/src/core/security/credentials.c b/src/core/security/credentials.c index ff67b5d30a8..398db20e8cf 100644 --- a/src/core/security/credentials.c +++ b/src/core/security/credentials.c @@ -171,8 +171,8 @@ void grpc_server_credentials_set_auth_metadata_processor( grpc_server_credentials *creds, grpc_auth_metadata_processor processor) { GRPC_API_TRACE( "grpc_server_credentials_set_auth_metadata_processor(" - "creds=%p, " - "processor=grpc_auth_metadata_processor { process: %lx, state: %p })", + "creds=%p, " + "processor=grpc_auth_metadata_processor { process: %lx, state: %p })", 3, (creds, (unsigned long)processor.process, processor.state)); if (creds == NULL) return; if (creds->processor.destroy != NULL && creds->processor.state != NULL) { @@ -325,10 +325,11 @@ grpc_credentials *grpc_ssl_credentials_create( const char *pem_root_certs, grpc_ssl_pem_key_cert_pair *pem_key_cert_pair, void *reserved) { grpc_ssl_credentials *c = gpr_malloc(sizeof(grpc_ssl_credentials)); - GRPC_API_TRACE("grpc_ssl_credentials_create(pem_root_certs=%s, " - "pem_key_cert_pair=%p, " - "reserved=%p)", - 3, (pem_root_certs, pem_key_cert_pair, reserved)); + GRPC_API_TRACE( + "grpc_ssl_credentials_create(pem_root_certs=%s, " + "pem_key_cert_pair=%p, " + "reserved=%p)", + 3, (pem_root_certs, pem_key_cert_pair, reserved)); GPR_ASSERT(reserved == NULL); memset(c, 0, sizeof(grpc_ssl_credentials)); c->base.type = GRPC_CREDENTIALS_TYPE_SSL; @@ -345,10 +346,10 @@ grpc_server_credentials *grpc_ssl_server_credentials_create( gpr_malloc(sizeof(grpc_ssl_server_credentials)); GRPC_API_TRACE( "grpc_ssl_server_credentials_create(" - "pem_root_certs=%s, pem_key_cert_pairs=%p, num_key_cert_pairs=%lu, " - "force_client_auth=%d, reserved=%p)", 5, - (pem_root_certs, pem_key_cert_pairs, (unsigned long)num_key_cert_pairs, - force_client_auth, reserved)); + "pem_root_certs=%s, pem_key_cert_pairs=%p, num_key_cert_pairs=%lu, " + "force_client_auth=%d, reserved=%p)", + 5, (pem_root_certs, pem_key_cert_pairs, (unsigned long)num_key_cert_pairs, + force_client_auth, reserved)); GPR_ASSERT(reserved == NULL); memset(c, 0, sizeof(grpc_ssl_server_credentials)); c->base.type = GRPC_CREDENTIALS_TYPE_SSL; @@ -469,12 +470,12 @@ grpc_credentials *grpc_service_account_jwt_access_credentials_create( const char *json_key, gpr_timespec token_lifetime, void *reserved) { GRPC_API_TRACE( "grpc_service_account_jwt_access_credentials_create(" - "json_key=%s, " - "token_lifetime=" - "gpr_timespec { tv_sec: %ld, tv_nsec: %d, clock_type: %d }, " - "reserved=%p)", - 5, (json_key, (long)token_lifetime.tv_sec, - token_lifetime.tv_nsec, (int)token_lifetime.clock_type, reserved)); + "json_key=%s, " + "token_lifetime=" + "gpr_timespec { tv_sec: %ld, tv_nsec: %d, clock_type: %d }, " + "reserved=%p)", + 5, (json_key, (long)token_lifetime.tv_sec, token_lifetime.tv_nsec, + (int)token_lifetime.clock_type, reserved)); GPR_ASSERT(reserved == NULL); return grpc_service_account_jwt_access_credentials_create_from_auth_json_key( grpc_auth_json_key_create_from_string(json_key), token_lifetime); @@ -748,9 +749,10 @@ grpc_credentials *grpc_refresh_token_credentials_create_from_auth_refresh_token( grpc_credentials *grpc_google_refresh_token_credentials_create( const char *json_refresh_token, void *reserved) { - GRPC_API_TRACE("grpc_refresh_token_credentials_create(json_refresh_token=%s, " - "reserved=%p)", - 2, (json_refresh_token, reserved)); + GRPC_API_TRACE( + "grpc_refresh_token_credentials_create(json_refresh_token=%s, " + "reserved=%p)", + 2, (json_refresh_token, reserved)); GPR_ASSERT(reserved == NULL); return grpc_refresh_token_credentials_create_from_auth_refresh_token( grpc_auth_refresh_token_create_from_string(json_refresh_token)); @@ -851,9 +853,10 @@ grpc_credentials *grpc_access_token_credentials_create(const char *access_token, grpc_access_token_credentials *c = gpr_malloc(sizeof(grpc_access_token_credentials)); char *token_md_value; - GRPC_API_TRACE("grpc_access_token_credentials_create(access_token=%s, " - "reserved=%p)", 2, - (access_token, reserved)); + GRPC_API_TRACE( + "grpc_access_token_credentials_create(access_token=%s, " + "reserved=%p)", + 2, (access_token, reserved)); GPR_ASSERT(reserved == NULL); memset(c, 0, sizeof(grpc_access_token_credentials)); c->base.type = GRPC_CREDENTIALS_TYPE_OAUTH2; @@ -1090,9 +1093,10 @@ grpc_credentials *grpc_composite_credentials_create(grpc_credentials *creds1, grpc_credentials_array creds1_array; grpc_credentials_array creds2_array; grpc_composite_credentials *c; - GRPC_API_TRACE("grpc_composite_credentials_create(creds1=%p, creds2=%p, " - "reserved=%p)", 3, - (creds1, creds2, reserved)); + GRPC_API_TRACE( + "grpc_composite_credentials_create(creds1=%p, creds2=%p, " + "reserved=%p)", + 3, (creds1, creds2, reserved)); GPR_ASSERT(reserved == NULL); GPR_ASSERT(creds1 != NULL); GPR_ASSERT(creds2 != NULL); @@ -1195,9 +1199,10 @@ static grpc_credentials_vtable iam_vtable = { grpc_credentials *grpc_google_iam_credentials_create( const char *token, const char *authority_selector, void *reserved) { grpc_google_iam_credentials *c; - GRPC_API_TRACE("grpc_iam_credentials_create(token=%s, authority_selector=%s, " - "reserved=%p)", - 3, (token, authority_selector, reserved)); + GRPC_API_TRACE( + "grpc_iam_credentials_create(token=%s, authority_selector=%s, " + "reserved=%p)", + 3, (token, authority_selector, reserved)); GPR_ASSERT(reserved == NULL); GPR_ASSERT(token != NULL); GPR_ASSERT(authority_selector != NULL); diff --git a/src/core/security/security_context.c b/src/core/security/security_context.c index b3cf5204c0d..fb905e0b228 100644 --- a/src/core/security/security_context.c +++ b/src/core/security/security_context.c @@ -273,7 +273,7 @@ void grpc_auth_context_add_property(grpc_auth_context *ctx, const char *name, grpc_auth_property *prop; GRPC_API_TRACE( "grpc_auth_context_add_property(ctx=%p, name=%s, value=%*.*s, " - "value_length=%lu)", + "value_length=%lu)", 6, (ctx, name, (int)value_length, (int)value_length, value, (unsigned long)value_length)); ensure_auth_context_capacity(ctx); diff --git a/src/core/security/server_secure_chttp2.c b/src/core/security/server_secure_chttp2.c index 3738ed6eb13..881e44a3fed 100644 --- a/src/core/security/server_secure_chttp2.c +++ b/src/core/security/server_secure_chttp2.c @@ -223,9 +223,10 @@ int grpc_server_add_secure_http2_port(grpc_server *server, const char *addr, grpc_security_connector *sc = NULL; grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT; - GRPC_API_TRACE("grpc_server_add_secure_http2_port(" - "server=%p, addr=%s, creds=%p)", - 3, (server, addr, creds)); + GRPC_API_TRACE( + "grpc_server_add_secure_http2_port(" + "server=%p, addr=%s, creds=%p)", + 3, (server, addr, creds)); /* create security context */ if (creds == NULL) goto error; diff --git a/src/core/surface/api_trace.h b/src/core/surface/api_trace.h index 7769b191efa..82bbf3b62b3 100644 --- a/src/core/surface/api_trace.h +++ b/src/core/surface/api_trace.h @@ -51,15 +51,15 @@ extern int grpc_api_trace; #define GRPC_API_TRACE_UNWRAP7(a, b, c, d, e, f, g) , a, b, c, d, e, f, g #define GRPC_API_TRACE_UNWRAP8(a, b, c, d, e, f, g, h) , a, b, c, d, e, f, g, h #define GRPC_API_TRACE_UNWRAP9(a, b, c, d, e, f, g, h, i) \ - , a, b, c, d, e, f, g, h, i + , a, b, c, d, e, f, g, h, i #define GRPC_API_TRACE_UNWRAP10(a, b, c, d, e, f, g, h, i, j) \ - , a, b, c, d, e, f, g, h, i, j + , a, b, c, d, e, f, g, h, i, j /* Due to the limitations of C89's preprocessor, the arity of the var-arg list 'nargs' must be specified. */ -#define GRPC_API_TRACE(fmt, nargs, args) \ - if (grpc_api_trace) { \ - gpr_log(GPR_INFO, fmt GRPC_API_TRACE_UNWRAP##nargs args ); \ - } +#define GRPC_API_TRACE(fmt, nargs, args) \ + if (grpc_api_trace) { \ + gpr_log(GPR_INFO, fmt GRPC_API_TRACE_UNWRAP##nargs args); \ + } #endif /* GRPC_INTERNAL_CORE_SURFACE_API_TRACE_H */ diff --git a/src/core/surface/call.c b/src/core/surface/call.c index 85c27746dca..d15a3bcbade 100644 --- a/src/core/surface/call.c +++ b/src/core/surface/call.c @@ -1325,7 +1325,7 @@ grpc_call_error grpc_call_cancel_with_status(grpc_call *c, grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT; GRPC_API_TRACE( "grpc_call_cancel_with_status(" - "c=%p, status=%d, description=%s, reserved=%p)", + "c=%p, status=%d, description=%s, reserved=%p)", 4, (c, (int)status, description, reserved)); GPR_ASSERT(reserved == NULL); lock(c); diff --git a/src/core/surface/call.h b/src/core/surface/call.h index acfedf40cd4..f421a81619f 100644 --- a/src/core/surface/call.h +++ b/src/core/surface/call.h @@ -160,7 +160,7 @@ void *grpc_call_context_get(grpc_call *call, grpc_context_index elem); #define GRPC_SERVER_LOG_REQUEST_CALL(sev, server, call, details, \ initial_metadata, cq_bound_to_call, \ cq_for_notifications, tag) \ - if (grpc_api_trace) \ + if (grpc_api_trace) \ grpc_server_log_request_call(sev, server, call, details, initial_metadata, \ cq_bound_to_call, cq_for_notifications, tag) diff --git a/src/core/surface/channel.c b/src/core/surface/channel.c index 3ff11eb0344..a9a5f828f27 100644 --- a/src/core/surface/channel.c +++ b/src/core/surface/channel.c @@ -217,13 +217,13 @@ grpc_call *grpc_channel_create_call(grpc_channel *channel, gpr_timespec deadline, void *reserved) { GRPC_API_TRACE( "grpc_channel_create_call(" - "channel=%p, parent_call=%p, propagation_mask=%x, cq=%p, method=%s, " - "host=%s, " - "deadline=gpr_timespec { tv_sec: %ld, tv_nsec: %d, clock_type: %d }, " - "reserved=%p)", - 10, (channel, parent_call, (unsigned)propagation_mask, cq, method, - host, (long)deadline.tv_sec, deadline.tv_nsec, - (int)deadline.clock_type, reserved)); + "channel=%p, parent_call=%p, propagation_mask=%x, cq=%p, method=%s, " + "host=%s, " + "deadline=gpr_timespec { tv_sec: %ld, tv_nsec: %d, clock_type: %d }, " + "reserved=%p)", + 10, (channel, parent_call, (unsigned)propagation_mask, cq, method, host, + (long)deadline.tv_sec, deadline.tv_nsec, (int)deadline.clock_type, + reserved)); GPR_ASSERT(!reserved); return grpc_channel_create_call_internal( channel, parent_call, propagation_mask, cq, @@ -268,10 +268,10 @@ grpc_call *grpc_channel_create_registered_call( registered_call *rc = registered_call_handle; GRPC_API_TRACE( "grpc_channel_create_registered_call(" - "channel=%p, parent_call=%p, propagation_mask=%x, completion_queue=%p, " - "registered_call_handle=%p, " - "deadline=gpr_timespec { tv_sec: %ld, tv_nsec: %d, clock_type: %d }, " - "reserved=%p)", + "channel=%p, parent_call=%p, propagation_mask=%x, completion_queue=%p, " + "registered_call_handle=%p, " + "deadline=gpr_timespec { tv_sec: %ld, tv_nsec: %d, clock_type: %d }, " + "reserved=%p)", 9, (channel, parent_call, (unsigned)propagation_mask, completion_queue, registered_call_handle, (long)deadline.tv_sec, deadline.tv_nsec, (int)deadline.clock_type, reserved)); diff --git a/src/core/surface/channel_connectivity.c b/src/core/surface/channel_connectivity.c index bef3d387fc9..f72fb041426 100644 --- a/src/core/surface/channel_connectivity.c +++ b/src/core/surface/channel_connectivity.c @@ -49,8 +49,8 @@ grpc_connectivity_state grpc_channel_check_connectivity_state( grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT; grpc_connectivity_state state; GRPC_API_TRACE( - "grpc_channel_check_connectivity_state(channel=%p, try_to_connect=%d)", - 2, (channel, try_to_connect)); + "grpc_channel_check_connectivity_state(channel=%p, try_to_connect=%d)", 2, + (channel, try_to_connect)); if (client_channel_elem->filter != &grpc_client_channel_filter) { gpr_log(GPR_ERROR, "grpc_channel_check_connectivity_state called on something that is " @@ -181,9 +181,9 @@ void grpc_channel_watch_connectivity_state( GRPC_API_TRACE( "grpc_channel_watch_connectivity_state(" - "channel=%p, last_observed_state=%d, " - "deadline=gpr_timespec { tv_sec: %ld, tv_nsec: %d, clock_type: %d }, " - "cq=%p, tag=%p)", + "channel=%p, last_observed_state=%d, " + "deadline=gpr_timespec { tv_sec: %ld, tv_nsec: %d, clock_type: %d }, " + "cq=%p, tag=%p)", 7, (channel, (int)last_observed_state, (long)deadline.tv_sec, deadline.tv_nsec, (int)deadline.clock_type, cq, tag)); diff --git a/src/core/surface/completion_queue.c b/src/core/surface/completion_queue.c index a6b32d27aa1..e818ccba488 100644 --- a/src/core/surface/completion_queue.c +++ b/src/core/surface/completion_queue.c @@ -186,11 +186,11 @@ grpc_event grpc_completion_queue_next(grpc_completion_queue *cc, GRPC_API_TRACE( "grpc_completion_queue_next(" - "cc=%p, " - "deadline=gpr_timespec { tv_sec: %ld, tv_nsec: %d, clock_type: %d }, " - "reserved=%p)", - 5, (cc, (long)deadline.tv_sec, deadline.tv_nsec, - (int)deadline.clock_type, reserved)); + "cc=%p, " + "deadline=gpr_timespec { tv_sec: %ld, tv_nsec: %d, clock_type: %d }, " + "reserved=%p)", + 5, (cc, (long)deadline.tv_sec, deadline.tv_nsec, (int)deadline.clock_type, + reserved)); GPR_ASSERT(!reserved); deadline = gpr_convert_clock_type(deadline, GPR_CLOCK_MONOTONIC); @@ -270,9 +270,9 @@ grpc_event grpc_completion_queue_pluck(grpc_completion_queue *cc, void *tag, GRPC_API_TRACE( "grpc_completion_queue_pluck(" - "cc=%p, tag=%p, " - "deadline=gpr_timespec { tv_sec: %ld, tv_nsec: %d, clock_type: %d }, " - "reserved=%p)", + "cc=%p, tag=%p, " + "deadline=gpr_timespec { tv_sec: %ld, tv_nsec: %d, clock_type: %d }, " + "reserved=%p)", 6, (cc, tag, (long)deadline.tv_sec, deadline.tv_nsec, (int)deadline.clock_type, reserved)); GPR_ASSERT(!reserved); diff --git a/src/core/surface/lame_client.c b/src/core/surface/lame_client.c index d2462d8c999..e72264fbcdb 100644 --- a/src/core/surface/lame_client.c +++ b/src/core/surface/lame_client.c @@ -154,7 +154,7 @@ grpc_channel *grpc_lame_client_channel_create(const char *target, elem = grpc_channel_stack_element(grpc_channel_get_channel_stack(channel), 0); GRPC_API_TRACE( "grpc_lame_client_channel_create(target=%s, error_code=%d, " - "error_message=%s)", + "error_message=%s)", 3, (target, (int)error_code, error_message)); GPR_ASSERT(elem->filter == &lame_filter); chand = (channel_data *)elem->channel_data; diff --git a/src/core/surface/secure_channel_create.c b/src/core/surface/secure_channel_create.c index 7fe43b0eaa5..1282ee99ed7 100644 --- a/src/core/surface/secure_channel_create.c +++ b/src/core/surface/secure_channel_create.c @@ -247,9 +247,10 @@ grpc_channel *grpc_secure_channel_create(grpc_credentials *creds, grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT; size_t n = 0; - GRPC_API_TRACE("grpc_secure_channel_create(creds=%p, target=%s, args=%p, " - "reserved=%p)", 4, - (creds, target, args, reserved)); + GRPC_API_TRACE( + "grpc_secure_channel_create(creds=%p, target=%s, args=%p, " + "reserved=%p)", + 4, (creds, target, args, reserved)); GPR_ASSERT(reserved == NULL); if (grpc_find_security_connector_in_args(args) != NULL) { diff --git a/src/core/surface/server.c b/src/core/surface/server.c index ebd2ef9af35..819226278dc 100644 --- a/src/core/surface/server.c +++ b/src/core/surface/server.c @@ -1186,8 +1186,8 @@ grpc_call_error grpc_server_request_call( requested_call *rc = gpr_malloc(sizeof(*rc)); GRPC_API_TRACE( "grpc_server_request_call(" - "server=%p, call=%p, details=%p, initial_metadata=%p, " - "cq_bound_to_call=%p, cq_for_notification=%p, tag%p)", + "server=%p, call=%p, details=%p, initial_metadata=%p, " + "cq_bound_to_call=%p, cq_for_notification=%p, tag%p)", 7, (server, call, details, initial_metadata, cq_bound_to_call, cq_for_notification, tag)); GRPC_SERVER_LOG_REQUEST_CALL(GPR_INFO, server, call, details, @@ -1225,9 +1225,9 @@ grpc_call_error grpc_server_request_registered_call( registered_method *rm = rmp; GRPC_API_TRACE( "grpc_server_request_registered_call(" - "server=%p, rmp=%p, call=%p, deadline=%p, initial_metadata=%p, " - "optional_payload=%p, cq_bound_to_call=%p, cq_for_notification=%p, " - "tag=%p)", + "server=%p, rmp=%p, call=%p, deadline=%p, initial_metadata=%p, " + "optional_payload=%p, cq_bound_to_call=%p, cq_for_notification=%p, " + "tag=%p)", 9, (server, rmp, call, deadline, initial_metadata, optional_payload, cq_bound_to_call, cq_for_notification, tag)); if (!grpc_cq_is_server_cq(cq_for_notification)) { diff --git a/src/core/surface/surface_trace.h b/src/core/surface/surface_trace.h index 51329a49842..93b2859ac5b 100644 --- a/src/core/surface/surface_trace.h +++ b/src/core/surface/surface_trace.h @@ -39,7 +39,7 @@ #include #define GRPC_SURFACE_TRACE_RETURNED_EVENT(cq, event) \ - if (grpc_api_trace) { \ + if (grpc_api_trace) { \ char *_ev = grpc_event_string(event); \ gpr_log(GPR_INFO, "RETURN_EVENT[%p]: %s", cq, _ev); \ gpr_free(_ev); \ diff --git a/src/core/surface/version.c b/src/core/surface/version.c index 8eb3ceea70f..e559d51448a 100644 --- a/src/core/surface/version.c +++ b/src/core/surface/version.c @@ -36,10 +36,4 @@ #include -#include "src/core/surface/api_trace.h" - -const char *grpc_version_string(void) { - GRPC_API_TRACE("grpc_version_string(void)", 0, ()); - return "0.11.0.0"; -} - +const char *grpc_version_string(void) { return "0.11.0.0"; } diff --git a/tools/doxygen/Doxyfile.core.internal b/tools/doxygen/Doxyfile.core.internal index 5658a102d75..a7a3da4d200 100644 --- a/tools/doxygen/Doxyfile.core.internal +++ b/tools/doxygen/Doxyfile.core.internal @@ -855,7 +855,6 @@ src/core/json/json_writer.h \ src/core/profiling/timers.h \ src/core/statistics/census_interface.h \ src/core/statistics/census_rpc_stats.h \ -src/core/surface/api_trace.h \ src/core/surface/byte_buffer_queue.h \ src/core/surface/call.h \ src/core/surface/channel.h \ @@ -992,7 +991,6 @@ src/core/json/json_string.c \ src/core/json/json_writer.c \ src/core/profiling/basic_timers.c \ src/core/profiling/stap_timers.c \ -src/core/surface/api_trace.c \ src/core/surface/byte_buffer.c \ src/core/surface/byte_buffer_queue.c \ src/core/surface/byte_buffer_reader.c \ @@ -1010,6 +1008,7 @@ src/core/surface/metadata_array.c \ src/core/surface/server.c \ src/core/surface/server_chttp2.c \ src/core/surface/server_create.c \ +src/core/surface/surface_trace.c \ src/core/surface/version.c \ src/core/transport/chttp2/alpn.c \ src/core/transport/chttp2/bin_encoder.c \ diff --git a/tools/run_tests/sources_and_headers.json b/tools/run_tests/sources_and_headers.json index 1ceff15a3be..1e5dd11fcd0 100644 --- a/tools/run_tests/sources_and_headers.json +++ b/tools/run_tests/sources_and_headers.json @@ -12362,7 +12362,6 @@ "src/core/security/security_context.h", "src/core/statistics/census_interface.h", "src/core/statistics/census_rpc_stats.h", - "src/core/surface/api_trace.h", "src/core/surface/byte_buffer_queue.h", "src/core/surface/call.h", "src/core/surface/channel.h", @@ -12597,8 +12596,6 @@ "src/core/security/server_secure_chttp2.c", "src/core/statistics/census_interface.h", "src/core/statistics/census_rpc_stats.h", - "src/core/surface/api_trace.c", - "src/core/surface/api_trace.h", "src/core/surface/byte_buffer.c", "src/core/surface/byte_buffer_queue.c", "src/core/surface/byte_buffer_queue.h", @@ -12625,6 +12622,7 @@ "src/core/surface/server.h", "src/core/surface/server_chttp2.c", "src/core/surface/server_create.c", + "src/core/surface/surface_trace.c", "src/core/surface/surface_trace.h", "src/core/surface/version.c", "src/core/transport/chttp2/alpn.c", @@ -12858,7 +12856,6 @@ "src/core/profiling/timers.h", "src/core/statistics/census_interface.h", "src/core/statistics/census_rpc_stats.h", - "src/core/surface/api_trace.h", "src/core/surface/byte_buffer_queue.h", "src/core/surface/call.h", "src/core/surface/channel.h", @@ -13063,8 +13060,6 @@ "src/core/profiling/timers.h", "src/core/statistics/census_interface.h", "src/core/statistics/census_rpc_stats.h", - "src/core/surface/api_trace.c", - "src/core/surface/api_trace.h", "src/core/surface/byte_buffer.c", "src/core/surface/byte_buffer_queue.c", "src/core/surface/byte_buffer_queue.h", @@ -13090,6 +13085,7 @@ "src/core/surface/server.h", "src/core/surface/server_chttp2.c", "src/core/surface/server_create.c", + "src/core/surface/surface_trace.c", "src/core/surface/surface_trace.h", "src/core/surface/version.c", "src/core/transport/chttp2/alpn.c", From 2468ff56a43670a3a48c825c25aae905c6f2e63e Mon Sep 17 00:00:00 2001 From: Craig Tiller Date: Mon, 5 Oct 2015 09:00:17 -0700 Subject: [PATCH 69/79] Restore build sanity --- BUILD | 12 ++++++------ Makefile | 4 ++-- build.yaml | 4 ++-- gRPC.podspec | 6 +++--- grpc.gyp | 4 ++-- tools/doxygen/Doxyfile.core.internal | 4 ++-- tools/run_tests/sources_and_headers.json | 12 ++++++------ vsprojects/vcxproj/grpc/grpc.vcxproj | 6 +++--- vsprojects/vcxproj/grpc/grpc.vcxproj.filters | 12 ++++++------ .../vcxproj/grpc_unsecure/grpc_unsecure.vcxproj | 6 +++--- .../grpc_unsecure/grpc_unsecure.vcxproj.filters | 12 ++++++------ 11 files changed, 41 insertions(+), 41 deletions(-) diff --git a/BUILD b/BUILD index c8118089bef..ea1ea26b425 100644 --- a/BUILD +++ b/BUILD @@ -220,6 +220,7 @@ cc_library( "src/core/profiling/timers.h", "src/core/statistics/census_interface.h", "src/core/statistics/census_rpc_stats.h", + "src/core/surface/api_trace.h", "src/core/surface/byte_buffer_queue.h", "src/core/surface/call.h", "src/core/surface/channel.h", @@ -227,7 +228,6 @@ cc_library( "src/core/surface/event_string.h", "src/core/surface/init.h", "src/core/surface/server.h", - "src/core/surface/surface_trace.h", "src/core/transport/chttp2/alpn.h", "src/core/transport/chttp2/bin_encoder.h", "src/core/transport/chttp2/frame.h", @@ -356,6 +356,7 @@ cc_library( "src/core/json/json_writer.c", "src/core/profiling/basic_timers.c", "src/core/profiling/stap_timers.c", + "src/core/surface/api_trace.c", "src/core/surface/byte_buffer.c", "src/core/surface/byte_buffer_queue.c", "src/core/surface/byte_buffer_reader.c", @@ -373,7 +374,6 @@ cc_library( "src/core/surface/server.c", "src/core/surface/server_chttp2.c", "src/core/surface/server_create.c", - "src/core/surface/surface_trace.c", "src/core/surface/version.c", "src/core/transport/chttp2/alpn.c", "src/core/transport/chttp2/bin_encoder.c", @@ -505,6 +505,7 @@ cc_library( "src/core/profiling/timers.h", "src/core/statistics/census_interface.h", "src/core/statistics/census_rpc_stats.h", + "src/core/surface/api_trace.h", "src/core/surface/byte_buffer_queue.h", "src/core/surface/call.h", "src/core/surface/channel.h", @@ -512,7 +513,6 @@ cc_library( "src/core/surface/event_string.h", "src/core/surface/init.h", "src/core/surface/server.h", - "src/core/surface/surface_trace.h", "src/core/transport/chttp2/alpn.h", "src/core/transport/chttp2/bin_encoder.h", "src/core/transport/chttp2/frame.h", @@ -621,6 +621,7 @@ cc_library( "src/core/json/json_writer.c", "src/core/profiling/basic_timers.c", "src/core/profiling/stap_timers.c", + "src/core/surface/api_trace.c", "src/core/surface/byte_buffer.c", "src/core/surface/byte_buffer_queue.c", "src/core/surface/byte_buffer_reader.c", @@ -638,7 +639,6 @@ cc_library( "src/core/surface/server.c", "src/core/surface/server_chttp2.c", "src/core/surface/server_create.c", - "src/core/surface/surface_trace.c", "src/core/surface/version.c", "src/core/transport/chttp2/alpn.c", "src/core/transport/chttp2/bin_encoder.c", @@ -1145,6 +1145,7 @@ objc_library( "src/core/json/json_writer.c", "src/core/profiling/basic_timers.c", "src/core/profiling/stap_timers.c", + "src/core/surface/api_trace.c", "src/core/surface/byte_buffer.c", "src/core/surface/byte_buffer_queue.c", "src/core/surface/byte_buffer_reader.c", @@ -1162,7 +1163,6 @@ objc_library( "src/core/surface/server.c", "src/core/surface/server_chttp2.c", "src/core/surface/server_create.c", - "src/core/surface/surface_trace.c", "src/core/surface/version.c", "src/core/transport/chttp2/alpn.c", "src/core/transport/chttp2/bin_encoder.c", @@ -1291,6 +1291,7 @@ objc_library( "src/core/profiling/timers.h", "src/core/statistics/census_interface.h", "src/core/statistics/census_rpc_stats.h", + "src/core/surface/api_trace.h", "src/core/surface/byte_buffer_queue.h", "src/core/surface/call.h", "src/core/surface/channel.h", @@ -1298,7 +1299,6 @@ objc_library( "src/core/surface/event_string.h", "src/core/surface/init.h", "src/core/surface/server.h", - "src/core/surface/surface_trace.h", "src/core/transport/chttp2/alpn.h", "src/core/transport/chttp2/bin_encoder.h", "src/core/transport/chttp2/frame.h", diff --git a/Makefile b/Makefile index e0a7b804721..8eb94f768a2 100644 --- a/Makefile +++ b/Makefile @@ -4119,6 +4119,7 @@ LIBGRPC_SRC = \ src/core/json/json_writer.c \ src/core/profiling/basic_timers.c \ src/core/profiling/stap_timers.c \ + src/core/surface/api_trace.c \ src/core/surface/byte_buffer.c \ src/core/surface/byte_buffer_queue.c \ src/core/surface/byte_buffer_reader.c \ @@ -4136,7 +4137,6 @@ LIBGRPC_SRC = \ src/core/surface/server.c \ src/core/surface/server_chttp2.c \ src/core/surface/server_create.c \ - src/core/surface/surface_trace.c \ src/core/surface/version.c \ src/core/transport/chttp2/alpn.c \ src/core/transport/chttp2/bin_encoder.c \ @@ -4401,6 +4401,7 @@ LIBGRPC_UNSECURE_SRC = \ src/core/json/json_writer.c \ src/core/profiling/basic_timers.c \ src/core/profiling/stap_timers.c \ + src/core/surface/api_trace.c \ src/core/surface/byte_buffer.c \ src/core/surface/byte_buffer_queue.c \ src/core/surface/byte_buffer_reader.c \ @@ -4418,7 +4419,6 @@ LIBGRPC_UNSECURE_SRC = \ src/core/surface/server.c \ src/core/surface/server_chttp2.c \ src/core/surface/server_create.c \ - src/core/surface/surface_trace.c \ src/core/surface/version.c \ src/core/transport/chttp2/alpn.c \ src/core/transport/chttp2/bin_encoder.c \ diff --git a/build.yaml b/build.yaml index 32dfa34df6e..762bbf39557 100644 --- a/build.yaml +++ b/build.yaml @@ -180,6 +180,7 @@ filegroups: - src/core/profiling/timers.h - src/core/statistics/census_interface.h - src/core/statistics/census_rpc_stats.h + - src/core/surface/api_trace.h - src/core/surface/byte_buffer_queue.h - src/core/surface/call.h - src/core/surface/channel.h @@ -187,7 +188,6 @@ filegroups: - src/core/surface/event_string.h - src/core/surface/init.h - src/core/surface/server.h - - src/core/surface/surface_trace.h - src/core/transport/chttp2/alpn.h - src/core/transport/chttp2/bin_encoder.h - src/core/transport/chttp2/frame.h @@ -293,6 +293,7 @@ filegroups: - src/core/json/json_writer.c - src/core/profiling/basic_timers.c - src/core/profiling/stap_timers.c + - src/core/surface/api_trace.c - src/core/surface/byte_buffer.c - src/core/surface/byte_buffer_queue.c - src/core/surface/byte_buffer_reader.c @@ -310,7 +311,6 @@ filegroups: - src/core/surface/server.c - src/core/surface/server_chttp2.c - src/core/surface/server_create.c - - src/core/surface/surface_trace.c - src/core/surface/version.c - src/core/transport/chttp2/alpn.c - src/core/transport/chttp2/bin_encoder.c diff --git a/gRPC.podspec b/gRPC.podspec index 122c16eff85..01f4e654076 100644 --- a/gRPC.podspec +++ b/gRPC.podspec @@ -224,6 +224,7 @@ Pod::Spec.new do |s| 'src/core/profiling/timers.h', 'src/core/statistics/census_interface.h', 'src/core/statistics/census_rpc_stats.h', + 'src/core/surface/api_trace.h', 'src/core/surface/byte_buffer_queue.h', 'src/core/surface/call.h', 'src/core/surface/channel.h', @@ -231,7 +232,6 @@ Pod::Spec.new do |s| 'src/core/surface/event_string.h', 'src/core/surface/init.h', 'src/core/surface/server.h', - 'src/core/surface/surface_trace.h', 'src/core/transport/chttp2/alpn.h', 'src/core/transport/chttp2/bin_encoder.h', 'src/core/transport/chttp2/frame.h', @@ -367,6 +367,7 @@ Pod::Spec.new do |s| 'src/core/json/json_writer.c', 'src/core/profiling/basic_timers.c', 'src/core/profiling/stap_timers.c', + 'src/core/surface/api_trace.c', 'src/core/surface/byte_buffer.c', 'src/core/surface/byte_buffer_queue.c', 'src/core/surface/byte_buffer_reader.c', @@ -384,7 +385,6 @@ Pod::Spec.new do |s| 'src/core/surface/server.c', 'src/core/surface/server_chttp2.c', 'src/core/surface/server_create.c', - 'src/core/surface/surface_trace.c', 'src/core/surface/version.c', 'src/core/transport/chttp2/alpn.c', 'src/core/transport/chttp2/bin_encoder.c', @@ -514,6 +514,7 @@ Pod::Spec.new do |s| 'src/core/profiling/timers.h', 'src/core/statistics/census_interface.h', 'src/core/statistics/census_rpc_stats.h', + 'src/core/surface/api_trace.h', 'src/core/surface/byte_buffer_queue.h', 'src/core/surface/call.h', 'src/core/surface/channel.h', @@ -521,7 +522,6 @@ Pod::Spec.new do |s| 'src/core/surface/event_string.h', 'src/core/surface/init.h', 'src/core/surface/server.h', - 'src/core/surface/surface_trace.h', 'src/core/transport/chttp2/alpn.h', 'src/core/transport/chttp2/bin_encoder.h', 'src/core/transport/chttp2/frame.h', diff --git a/grpc.gyp b/grpc.gyp index 60179f04ff7..2225ca4e045 100644 --- a/grpc.gyp +++ b/grpc.gyp @@ -248,6 +248,7 @@ 'src/core/json/json_writer.c', 'src/core/profiling/basic_timers.c', 'src/core/profiling/stap_timers.c', + 'src/core/surface/api_trace.c', 'src/core/surface/byte_buffer.c', 'src/core/surface/byte_buffer_queue.c', 'src/core/surface/byte_buffer_reader.c', @@ -265,7 +266,6 @@ 'src/core/surface/server.c', 'src/core/surface/server_chttp2.c', 'src/core/surface/server_create.c', - 'src/core/surface/surface_trace.c', 'src/core/surface/version.c', 'src/core/transport/chttp2/alpn.c', 'src/core/transport/chttp2/bin_encoder.c', @@ -434,6 +434,7 @@ 'src/core/json/json_writer.c', 'src/core/profiling/basic_timers.c', 'src/core/profiling/stap_timers.c', + 'src/core/surface/api_trace.c', 'src/core/surface/byte_buffer.c', 'src/core/surface/byte_buffer_queue.c', 'src/core/surface/byte_buffer_reader.c', @@ -451,7 +452,6 @@ 'src/core/surface/server.c', 'src/core/surface/server_chttp2.c', 'src/core/surface/server_create.c', - 'src/core/surface/surface_trace.c', 'src/core/surface/version.c', 'src/core/transport/chttp2/alpn.c', 'src/core/transport/chttp2/bin_encoder.c', diff --git a/tools/doxygen/Doxyfile.core.internal b/tools/doxygen/Doxyfile.core.internal index a7a3da4d200..a48fe2eca80 100644 --- a/tools/doxygen/Doxyfile.core.internal +++ b/tools/doxygen/Doxyfile.core.internal @@ -855,6 +855,7 @@ src/core/json/json_writer.h \ src/core/profiling/timers.h \ src/core/statistics/census_interface.h \ src/core/statistics/census_rpc_stats.h \ +src/core/surface/api_trace.h \ src/core/surface/byte_buffer_queue.h \ src/core/surface/call.h \ src/core/surface/channel.h \ @@ -862,7 +863,6 @@ src/core/surface/completion_queue.h \ src/core/surface/event_string.h \ src/core/surface/init.h \ src/core/surface/server.h \ -src/core/surface/surface_trace.h \ src/core/transport/chttp2/alpn.h \ src/core/transport/chttp2/bin_encoder.h \ src/core/transport/chttp2/frame.h \ @@ -991,6 +991,7 @@ src/core/json/json_string.c \ src/core/json/json_writer.c \ src/core/profiling/basic_timers.c \ src/core/profiling/stap_timers.c \ +src/core/surface/api_trace.c \ src/core/surface/byte_buffer.c \ src/core/surface/byte_buffer_queue.c \ src/core/surface/byte_buffer_reader.c \ @@ -1008,7 +1009,6 @@ src/core/surface/metadata_array.c \ src/core/surface/server.c \ src/core/surface/server_chttp2.c \ src/core/surface/server_create.c \ -src/core/surface/surface_trace.c \ src/core/surface/version.c \ src/core/transport/chttp2/alpn.c \ src/core/transport/chttp2/bin_encoder.c \ diff --git a/tools/run_tests/sources_and_headers.json b/tools/run_tests/sources_and_headers.json index 1e5dd11fcd0..d48285eb34e 100644 --- a/tools/run_tests/sources_and_headers.json +++ b/tools/run_tests/sources_and_headers.json @@ -12362,6 +12362,7 @@ "src/core/security/security_context.h", "src/core/statistics/census_interface.h", "src/core/statistics/census_rpc_stats.h", + "src/core/surface/api_trace.h", "src/core/surface/byte_buffer_queue.h", "src/core/surface/call.h", "src/core/surface/channel.h", @@ -12369,7 +12370,6 @@ "src/core/surface/event_string.h", "src/core/surface/init.h", "src/core/surface/server.h", - "src/core/surface/surface_trace.h", "src/core/transport/chttp2/alpn.h", "src/core/transport/chttp2/bin_encoder.h", "src/core/transport/chttp2/frame.h", @@ -12596,6 +12596,8 @@ "src/core/security/server_secure_chttp2.c", "src/core/statistics/census_interface.h", "src/core/statistics/census_rpc_stats.h", + "src/core/surface/api_trace.c", + "src/core/surface/api_trace.h", "src/core/surface/byte_buffer.c", "src/core/surface/byte_buffer_queue.c", "src/core/surface/byte_buffer_queue.h", @@ -12622,8 +12624,6 @@ "src/core/surface/server.h", "src/core/surface/server_chttp2.c", "src/core/surface/server_create.c", - "src/core/surface/surface_trace.c", - "src/core/surface/surface_trace.h", "src/core/surface/version.c", "src/core/transport/chttp2/alpn.c", "src/core/transport/chttp2/alpn.h", @@ -12856,6 +12856,7 @@ "src/core/profiling/timers.h", "src/core/statistics/census_interface.h", "src/core/statistics/census_rpc_stats.h", + "src/core/surface/api_trace.h", "src/core/surface/byte_buffer_queue.h", "src/core/surface/call.h", "src/core/surface/channel.h", @@ -12863,7 +12864,6 @@ "src/core/surface/event_string.h", "src/core/surface/init.h", "src/core/surface/server.h", - "src/core/surface/surface_trace.h", "src/core/transport/chttp2/alpn.h", "src/core/transport/chttp2/bin_encoder.h", "src/core/transport/chttp2/frame.h", @@ -13060,6 +13060,8 @@ "src/core/profiling/timers.h", "src/core/statistics/census_interface.h", "src/core/statistics/census_rpc_stats.h", + "src/core/surface/api_trace.c", + "src/core/surface/api_trace.h", "src/core/surface/byte_buffer.c", "src/core/surface/byte_buffer_queue.c", "src/core/surface/byte_buffer_queue.h", @@ -13085,8 +13087,6 @@ "src/core/surface/server.h", "src/core/surface/server_chttp2.c", "src/core/surface/server_create.c", - "src/core/surface/surface_trace.c", - "src/core/surface/surface_trace.h", "src/core/surface/version.c", "src/core/transport/chttp2/alpn.c", "src/core/transport/chttp2/alpn.h", diff --git a/vsprojects/vcxproj/grpc/grpc.vcxproj b/vsprojects/vcxproj/grpc/grpc.vcxproj index e7770af3c24..6d87f4bc7c9 100644 --- a/vsprojects/vcxproj/grpc/grpc.vcxproj +++ b/vsprojects/vcxproj/grpc/grpc.vcxproj @@ -341,6 +341,7 @@ + @@ -348,7 +349,6 @@ - @@ -578,6 +578,8 @@ + + @@ -612,8 +614,6 @@ - - diff --git a/vsprojects/vcxproj/grpc/grpc.vcxproj.filters b/vsprojects/vcxproj/grpc/grpc.vcxproj.filters index a8f82370d91..4c841bc7d53 100644 --- a/vsprojects/vcxproj/grpc/grpc.vcxproj.filters +++ b/vsprojects/vcxproj/grpc/grpc.vcxproj.filters @@ -298,6 +298,9 @@ src\core\profiling + + src\core\surface + src\core\surface @@ -349,9 +352,6 @@ src\core\surface - - src\core\surface - src\core\surface @@ -734,6 +734,9 @@ src\core\statistics + + src\core\surface + src\core\surface @@ -755,9 +758,6 @@ src\core\surface - - src\core\surface - src\core\transport\chttp2 diff --git a/vsprojects/vcxproj/grpc_unsecure/grpc_unsecure.vcxproj b/vsprojects/vcxproj/grpc_unsecure/grpc_unsecure.vcxproj index 82ec8a75480..45741371669 100644 --- a/vsprojects/vcxproj/grpc_unsecure/grpc_unsecure.vcxproj +++ b/vsprojects/vcxproj/grpc_unsecure/grpc_unsecure.vcxproj @@ -320,6 +320,7 @@ + @@ -327,7 +328,6 @@ - @@ -517,6 +517,8 @@ + + @@ -551,8 +553,6 @@ - - diff --git a/vsprojects/vcxproj/grpc_unsecure/grpc_unsecure.vcxproj.filters b/vsprojects/vcxproj/grpc_unsecure/grpc_unsecure.vcxproj.filters index 21355d67f26..ecda41e4c95 100644 --- a/vsprojects/vcxproj/grpc_unsecure/grpc_unsecure.vcxproj.filters +++ b/vsprojects/vcxproj/grpc_unsecure/grpc_unsecure.vcxproj.filters @@ -238,6 +238,9 @@ src\core\profiling + + src\core\surface + src\core\surface @@ -289,9 +292,6 @@ src\core\surface - - src\core\surface - src\core\surface @@ -632,6 +632,9 @@ src\core\statistics + + src\core\surface + src\core\surface @@ -653,9 +656,6 @@ src\core\surface - - src\core\surface - src\core\transport\chttp2 From 0801ce6ef395bef289a14a095ad6a4d7a1ced74d Mon Sep 17 00:00:00 2001 From: Craig Tiller Date: Mon, 5 Oct 2015 09:40:31 -0700 Subject: [PATCH 70/79] Restore include sanity --- BUILD | 3 +++ build.yaml | 1 + gRPC.podspec | 2 ++ tools/doxygen/Doxyfile.core.internal | 1 + tools/run_tests/sources_and_headers.json | 4 ++++ vsprojects/vcxproj/grpc/grpc.vcxproj | 1 + vsprojects/vcxproj/grpc/grpc.vcxproj.filters | 3 +++ vsprojects/vcxproj/grpc_unsecure/grpc_unsecure.vcxproj | 1 + .../vcxproj/grpc_unsecure/grpc_unsecure.vcxproj.filters | 3 +++ 9 files changed, 19 insertions(+) diff --git a/BUILD b/BUILD index ea1ea26b425..3e2a45b8a0a 100644 --- a/BUILD +++ b/BUILD @@ -228,6 +228,7 @@ cc_library( "src/core/surface/event_string.h", "src/core/surface/init.h", "src/core/surface/server.h", + "src/core/surface/surface_trace.h", "src/core/transport/chttp2/alpn.h", "src/core/transport/chttp2/bin_encoder.h", "src/core/transport/chttp2/frame.h", @@ -513,6 +514,7 @@ cc_library( "src/core/surface/event_string.h", "src/core/surface/init.h", "src/core/surface/server.h", + "src/core/surface/surface_trace.h", "src/core/transport/chttp2/alpn.h", "src/core/transport/chttp2/bin_encoder.h", "src/core/transport/chttp2/frame.h", @@ -1299,6 +1301,7 @@ objc_library( "src/core/surface/event_string.h", "src/core/surface/init.h", "src/core/surface/server.h", + "src/core/surface/surface_trace.h", "src/core/transport/chttp2/alpn.h", "src/core/transport/chttp2/bin_encoder.h", "src/core/transport/chttp2/frame.h", diff --git a/build.yaml b/build.yaml index 762bbf39557..98fb0348ca3 100644 --- a/build.yaml +++ b/build.yaml @@ -188,6 +188,7 @@ filegroups: - src/core/surface/event_string.h - src/core/surface/init.h - src/core/surface/server.h + - src/core/surface/surface_trace.h - src/core/transport/chttp2/alpn.h - src/core/transport/chttp2/bin_encoder.h - src/core/transport/chttp2/frame.h diff --git a/gRPC.podspec b/gRPC.podspec index 01f4e654076..717e7005ee5 100644 --- a/gRPC.podspec +++ b/gRPC.podspec @@ -232,6 +232,7 @@ Pod::Spec.new do |s| 'src/core/surface/event_string.h', 'src/core/surface/init.h', 'src/core/surface/server.h', + 'src/core/surface/surface_trace.h', 'src/core/transport/chttp2/alpn.h', 'src/core/transport/chttp2/bin_encoder.h', 'src/core/transport/chttp2/frame.h', @@ -522,6 +523,7 @@ Pod::Spec.new do |s| 'src/core/surface/event_string.h', 'src/core/surface/init.h', 'src/core/surface/server.h', + 'src/core/surface/surface_trace.h', 'src/core/transport/chttp2/alpn.h', 'src/core/transport/chttp2/bin_encoder.h', 'src/core/transport/chttp2/frame.h', diff --git a/tools/doxygen/Doxyfile.core.internal b/tools/doxygen/Doxyfile.core.internal index a48fe2eca80..5658a102d75 100644 --- a/tools/doxygen/Doxyfile.core.internal +++ b/tools/doxygen/Doxyfile.core.internal @@ -863,6 +863,7 @@ src/core/surface/completion_queue.h \ src/core/surface/event_string.h \ src/core/surface/init.h \ src/core/surface/server.h \ +src/core/surface/surface_trace.h \ src/core/transport/chttp2/alpn.h \ src/core/transport/chttp2/bin_encoder.h \ src/core/transport/chttp2/frame.h \ diff --git a/tools/run_tests/sources_and_headers.json b/tools/run_tests/sources_and_headers.json index d48285eb34e..1ceff15a3be 100644 --- a/tools/run_tests/sources_and_headers.json +++ b/tools/run_tests/sources_and_headers.json @@ -12370,6 +12370,7 @@ "src/core/surface/event_string.h", "src/core/surface/init.h", "src/core/surface/server.h", + "src/core/surface/surface_trace.h", "src/core/transport/chttp2/alpn.h", "src/core/transport/chttp2/bin_encoder.h", "src/core/transport/chttp2/frame.h", @@ -12624,6 +12625,7 @@ "src/core/surface/server.h", "src/core/surface/server_chttp2.c", "src/core/surface/server_create.c", + "src/core/surface/surface_trace.h", "src/core/surface/version.c", "src/core/transport/chttp2/alpn.c", "src/core/transport/chttp2/alpn.h", @@ -12864,6 +12866,7 @@ "src/core/surface/event_string.h", "src/core/surface/init.h", "src/core/surface/server.h", + "src/core/surface/surface_trace.h", "src/core/transport/chttp2/alpn.h", "src/core/transport/chttp2/bin_encoder.h", "src/core/transport/chttp2/frame.h", @@ -13087,6 +13090,7 @@ "src/core/surface/server.h", "src/core/surface/server_chttp2.c", "src/core/surface/server_create.c", + "src/core/surface/surface_trace.h", "src/core/surface/version.c", "src/core/transport/chttp2/alpn.c", "src/core/transport/chttp2/alpn.h", diff --git a/vsprojects/vcxproj/grpc/grpc.vcxproj b/vsprojects/vcxproj/grpc/grpc.vcxproj index 6d87f4bc7c9..183edbc05bf 100644 --- a/vsprojects/vcxproj/grpc/grpc.vcxproj +++ b/vsprojects/vcxproj/grpc/grpc.vcxproj @@ -349,6 +349,7 @@ + diff --git a/vsprojects/vcxproj/grpc/grpc.vcxproj.filters b/vsprojects/vcxproj/grpc/grpc.vcxproj.filters index 4c841bc7d53..66ce9ca05be 100644 --- a/vsprojects/vcxproj/grpc/grpc.vcxproj.filters +++ b/vsprojects/vcxproj/grpc/grpc.vcxproj.filters @@ -758,6 +758,9 @@ src\core\surface + + src\core\surface + src\core\transport\chttp2 diff --git a/vsprojects/vcxproj/grpc_unsecure/grpc_unsecure.vcxproj b/vsprojects/vcxproj/grpc_unsecure/grpc_unsecure.vcxproj index 45741371669..b527179f9f3 100644 --- a/vsprojects/vcxproj/grpc_unsecure/grpc_unsecure.vcxproj +++ b/vsprojects/vcxproj/grpc_unsecure/grpc_unsecure.vcxproj @@ -328,6 +328,7 @@ + diff --git a/vsprojects/vcxproj/grpc_unsecure/grpc_unsecure.vcxproj.filters b/vsprojects/vcxproj/grpc_unsecure/grpc_unsecure.vcxproj.filters index ecda41e4c95..7be3c9ec93b 100644 --- a/vsprojects/vcxproj/grpc_unsecure/grpc_unsecure.vcxproj.filters +++ b/vsprojects/vcxproj/grpc_unsecure/grpc_unsecure.vcxproj.filters @@ -656,6 +656,9 @@ src\core\surface + + src\core\surface + src\core\transport\chttp2 From 08005eda53827a3892cc0d68395d5a7f9658b31b Mon Sep 17 00:00:00 2001 From: murgatroid99 Date: Mon, 5 Oct 2015 11:19:34 -0700 Subject: [PATCH 71/79] Removed a pair of racy Node tests --- src/node/test/surface_test.js | 45 ----------------------------------- 1 file changed, 45 deletions(-) diff --git a/src/node/test/surface_test.js b/src/node/test/surface_test.js index d917c7a1712..7af3ad895e2 100644 --- a/src/node/test/surface_test.js +++ b/src/node/test/surface_test.js @@ -707,29 +707,6 @@ describe('Other conditions', function() { proxy.forceShutdown(); }); describe('Cancellation', function() { - it('With a unary call', function(done) { - done = multiDone(done, 2); - proxy_impl.unary = function(parent, callback) { - client.unary(parent.request, function(err, value) { - try { - assert(err); - assert.strictEqual(err.code, grpc.status.CANCELLED); - } finally { - callback(err, value); - done(); - } - }, null, {parent: parent}); - call.cancel(); - }; - proxy.addProtoService(test_service, proxy_impl); - var proxy_port = proxy.bind('localhost:0', server_insecure_creds); - proxy.start(); - var proxy_client = new Client('localhost:' + proxy_port, - grpc.Credentials.createInsecure()); - var call = proxy_client.unary({}, function(err, value) { - done(); - }); - }); it('With a client stream call', function(done) { done = multiDone(done, 2); proxy_impl.clientStream = function(parent, callback) { @@ -753,28 +730,6 @@ describe('Other conditions', function() { done(); }); }); - it('With a server stream call', function(done) { - done = multiDone(done, 2); - proxy_impl.serverStream = function(parent) { - var child = client.serverStream(parent.request, null, - {parent: parent}); - child.on('error', function(err) { - assert(err); - assert.strictEqual(err.code, grpc.status.CANCELLED); - done(); - }); - call.cancel(); - }; - proxy.addProtoService(test_service, proxy_impl); - var proxy_port = proxy.bind('localhost:0', server_insecure_creds); - proxy.start(); - var proxy_client = new Client('localhost:' + proxy_port, - grpc.Credentials.createInsecure()); - var call = proxy_client.serverStream({}); - call.on('error', function(err) { - done(); - }); - }); it('With a bidi stream call', function(done) { done = multiDone(done, 2); proxy_impl.bidiStream = function(parent) { From bae235cd5fdfd10f63308e70eff8e689449e040b Mon Sep 17 00:00:00 2001 From: Craig Tiller Date: Mon, 5 Oct 2015 11:33:36 -0700 Subject: [PATCH 72/79] Fix use-after-free --- src/core/iomgr/pollset_posix.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/core/iomgr/pollset_posix.c b/src/core/iomgr/pollset_posix.c index 90428274843..b663780a02a 100644 --- a/src/core/iomgr/pollset_posix.c +++ b/src/core/iomgr/pollset_posix.c @@ -477,6 +477,7 @@ static void basic_pollset_maybe_work_and_unlock(grpc_exec_ctx *exec_ctx, if (fd) { pfd[2].fd = fd->fd; pfd[2].revents = 0; + GRPC_FD_REF(fd, "basicpoll_begin"); gpr_mu_unlock(&pollset->mu); pfd[2].events = (short)grpc_fd_begin_poll(fd, pollset, POLLIN, POLLOUT, &fd_watcher); @@ -523,6 +524,10 @@ static void basic_pollset_maybe_work_and_unlock(grpc_exec_ctx *exec_ctx, } } } + + if (fd) { + GRPC_FD_UNREF(fd, "basicpoll_begin"); + } } static void basic_pollset_destroy(grpc_pollset *pollset) { From cc1bde76031cd7dab69349147df1f5d663cdae2e Mon Sep 17 00:00:00 2001 From: Jan Tattermusch Date: Mon, 5 Oct 2015 12:47:45 -0700 Subject: [PATCH 73/79] add go support to run_interop_tests.py --- tools/jenkins/grpc_interop_go/Dockerfile | 36 ++++++++++++++ .../jenkins/grpc_interop_go/build_interop.sh | 48 +++++++++++++++++++ tools/run_tests/run_interop_tests.py | 34 +++++++++++-- 3 files changed, 115 insertions(+), 3 deletions(-) create mode 100644 tools/jenkins/grpc_interop_go/Dockerfile create mode 100755 tools/jenkins/grpc_interop_go/build_interop.sh diff --git a/tools/jenkins/grpc_interop_go/Dockerfile b/tools/jenkins/grpc_interop_go/Dockerfile new file mode 100644 index 00000000000..bb60f09f247 --- /dev/null +++ b/tools/jenkins/grpc_interop_go/Dockerfile @@ -0,0 +1,36 @@ +# Copyright 2015, Google Inc. +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are +# met: +# +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above +# copyright notice, this list of conditions and the following disclaimer +# in the documentation and/or other materials provided with the +# distribution. +# * Neither the name of Google Inc. nor the names of its +# contributors may be used to endorse or promote products derived from +# this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +FROM golang:1.4 + +# Using login shell removes Go from path, so we add it. +RUN ln -s /usr/src/go/bin/go /usr/local/bin + +# Define the default command. +CMD ["bash"] diff --git a/tools/jenkins/grpc_interop_go/build_interop.sh b/tools/jenkins/grpc_interop_go/build_interop.sh new file mode 100755 index 00000000000..c8c5eafd481 --- /dev/null +++ b/tools/jenkins/grpc_interop_go/build_interop.sh @@ -0,0 +1,48 @@ +#!/bin/bash +# Copyright 2015, Google Inc. +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are +# met: +# +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above +# copyright notice, this list of conditions and the following disclaimer +# in the documentation and/or other materials provided with the +# distribution. +# * Neither the name of Google Inc. nor the names of its +# contributors may be used to endorse or promote products derived from +# this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# +# Builds Go interop server and client in a base image. +set -e + +# Clone just the grpc-go source code without any dependencies. +# We are cloning from a local git repo that contains the right revision +# to test instead of using "go get" to download from Github directly. +git clone --recursive /var/local/jenkins/grpc-go src/gooogle.golang.org/grpc + +# Get dependencies from GitHub +go get github.com/golang/protobuf/proto +go get golang.org/x/net/context +go get golang.org/x/net/trace +go get golang.org/x/oauth2 +go get google.golang.org/cloud + +# Build the interop client and server +(cd src/google.golang.org/grpc/interop/client && go install) +(cd src/google.golang.org/grpc/interop/server && go install) diff --git a/tools/run_tests/run_interop_tests.py b/tools/run_tests/run_interop_tests.py index 46b34fea4c0..f0935fb5d61 100755 --- a/tools/run_tests/run_interop_tests.py +++ b/tools/run_tests/run_interop_tests.py @@ -61,8 +61,9 @@ _CLOUD_TO_CLOUD_BASE_ARGS = [ # supported by C core SslCredentials instead. _SSL_CERT_ENV = { 'SSL_CERT_FILE':'/usr/local/share/grpc/roots.pem' } -# TODO(jtatttermusch) unify usage of --use_tls and --use_tls=true -# TODO(jtatttermusch) unify usage of --use_prod_roots and --use_test_ca +# TODO(jtattermusch) unify usage of --use_tls and --use_tls=true +# TODO(jtattermusch) unify usage of --use_prod_roots and --use_test_ca +# TODO(jtattermusch) go uses --tls_ca_file instead of --use_test_ca class CXXLanguage: @@ -140,6 +141,32 @@ class JavaLanguage: return 'java' +class GoLanguage: + + def __init__(self): + self.client_cmdline_base = ['go', 'run', 'client.go'] + # TODO: this relies on running inside docker + self.client_cwd = '/go/src/google.golang.org/grpc/interop/client' + self.server_cwd = '/go/src/google.golang.org/grpc/interop/server' + + def cloud_to_prod_args(self): + return (self.client_cmdline_base + _CLOUD_TO_PROD_BASE_ARGS + + ['--use_tls=true', '--tls_ca_file=""']) + + def cloud_to_cloud_args(self): + return (self.client_cmdline_base + _CLOUD_TO_CLOUD_BASE_ARGS + + ['--use_tls=true']) + + def cloud_to_prod_env(self): + return None + + def server_args(self): + return ['go', 'run', 'server.go', '--use_tls=true'] + + def __str__(self): + return 'go' + + class NodeLanguage: def __init__(self): @@ -215,6 +242,7 @@ class RubyLanguage: _LANGUAGES = { 'c++' : CXXLanguage(), 'csharp' : CSharpLanguage(), + 'go' : GoLanguage(), 'java' : JavaLanguage(), 'node' : NodeLanguage(), 'php' : PHPLanguage(), @@ -223,7 +251,7 @@ _LANGUAGES = { # languages supported as cloud_to_cloud servers # TODO(jtattermusch): enable other languages as servers as well -_SERVERS = ['c++', 'node', 'csharp', 'java'] +_SERVERS = ['c++', 'node', 'csharp', 'java', 'go'] # TODO(jtattermusch): add empty_stream once PHP starts supporting it. # TODO(jtattermusch): add timeout_on_sleeping_server once java starts supporting it. From 4b6bc1e8595755a73c8c4e879b322ccad8b3dfe3 Mon Sep 17 00:00:00 2001 From: Jan Tattermusch Date: Mon, 5 Oct 2015 13:06:49 -0700 Subject: [PATCH 74/79] added comment about go dependencies --- tools/jenkins/grpc_interop_go/build_interop.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/jenkins/grpc_interop_go/build_interop.sh b/tools/jenkins/grpc_interop_go/build_interop.sh index c8c5eafd481..78dd4ea9cf5 100755 --- a/tools/jenkins/grpc_interop_go/build_interop.sh +++ b/tools/jenkins/grpc_interop_go/build_interop.sh @@ -37,6 +37,8 @@ set -e git clone --recursive /var/local/jenkins/grpc-go src/gooogle.golang.org/grpc # Get dependencies from GitHub +# NOTE: once grpc-go dependencies change, this needs to be updated manually +# but we don't expect this to happen any time soon. go get github.com/golang/protobuf/proto go get golang.org/x/net/context go get golang.org/x/net/trace From 3bf828f602247b6af2b7ccd45eb45fc86d67b597 Mon Sep 17 00:00:00 2001 From: Craig Tiller Date: Mon, 5 Oct 2015 13:36:25 -0700 Subject: [PATCH 75/79] Add a more useful log message when failing to connect --- src/core/iomgr/tcp_client_posix.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/core/iomgr/tcp_client_posix.c b/src/core/iomgr/tcp_client_posix.c index 346566866a2..aca2691c416 100644 --- a/src/core/iomgr/tcp_client_posix.c +++ b/src/core/iomgr/tcp_client_posix.c @@ -141,7 +141,8 @@ static void on_writable(grpc_exec_ctx *exec_ctx, void *acp, int success) { err = getsockopt(fd->fd, SOL_SOCKET, SO_ERROR, &so_error, &so_error_size); } while (err < 0 && errno == EINTR); if (err < 0) { - gpr_log(GPR_ERROR, "getsockopt(ERROR): %s", strerror(errno)); + gpr_log(GPR_ERROR, "failed to connect to '%s': getsockopt(ERROR): %s", + ac->addr_str, strerror(errno)); goto finish; } else if (so_error != 0) { if (so_error == ENOBUFS) { @@ -166,10 +167,14 @@ static void on_writable(grpc_exec_ctx *exec_ctx, void *acp, int success) { } else { switch (so_error) { case ECONNREFUSED: - gpr_log(GPR_ERROR, "socket error: connection refused"); + gpr_log( + GPR_ERROR, + "failed to connect to '%s': socket error: connection refused", + ac->addr_str); break; default: - gpr_log(GPR_ERROR, "socket error: %d", so_error); + gpr_log(GPR_ERROR, "failed to connect to '%s': socket error: %d", + ac->addr_str, so_error); break; } goto finish; @@ -181,7 +186,8 @@ static void on_writable(grpc_exec_ctx *exec_ctx, void *acp, int success) { goto finish; } } else { - gpr_log(GPR_ERROR, "on_writable failed during connect"); + gpr_log(GPR_ERROR, "failed to connect to '%s': timeout occurred", + ac->addr_str); goto finish; } From c6c3189f3dca4880d05cf0492c28d0988b06367e Mon Sep 17 00:00:00 2001 From: Craig Tiller Date: Mon, 5 Oct 2015 14:00:19 -0700 Subject: [PATCH 76/79] Add more verbose traces for debug output --- test/core/util/port_posix.c | 14 ++++++++++++-- tools/run_tests/run_tests.py | 10 +++++++--- 2 files changed, 19 insertions(+), 5 deletions(-) diff --git a/test/core/util/port_posix.c b/test/core/util/port_posix.c index 887079e0f8a..0a50660586a 100644 --- a/test/core/util/port_posix.c +++ b/test/core/util/port_posix.c @@ -213,15 +213,25 @@ static void got_port_from_server(grpc_exec_ctx *exec_ctx, void *arg, size_t i; int port = 0; portreq *pr = arg; + int failed = 0; + + if (!response) { + failed = 1; + gpr_log(GPR_DEBUG, + "failed port pick from server: retrying [response=NULL]"); + } else if (response->status != 200) { + failed = 1; + gpr_log(GPR_DEBUG, "failed port pick from server: status=%d", + response->status); + } - if (!response || response->status != 200) { + if (failed) { grpc_httpcli_request req; memset(&req, 0, sizeof(req)); GPR_ASSERT(pr->retries < 10); pr->retries++; req.host = pr->server; req.path = "/get"; - gpr_log(GPR_DEBUG, "failed port pick from server: retrying"); sleep(1); grpc_httpcli_get(exec_ctx, pr->ctx, &pr->pollset, &req, GRPC_TIMEOUT_SECONDS_TO_DEADLINE(10), got_port_from_server, diff --git a/tools/run_tests/run_tests.py b/tools/run_tests/run_tests.py index 38c06764b9b..9ed8ef33e1f 100755 --- a/tools/run_tests/run_tests.py +++ b/tools/run_tests/run_tests.py @@ -715,17 +715,21 @@ def _start_port_server(port_server_port): try: version = urllib2.urlopen('http://localhost:%d/version' % port_server_port, timeout=1).read() + print 'detected port server running' running = True except Exception: + print 'failed to detect port server: %s' % sys.exc_info()[0] running = False if running: with open('tools/run_tests/port_server.py') as f: current_version = hashlib.sha1(f.read()).hexdigest() running = (version == current_version) if not running: + print 'port_server version mismatch: killing the old one' urllib2.urlopen('http://localhost:%d/quit' % port_server_port).read() time.sleep(1) if not running: + print 'starting port_server' port_log = open('portlog.txt', 'w') port_server = subprocess.Popen( ['python', 'tools/run_tests/port_server.py', '-p', '%d' % port_server_port], @@ -737,7 +741,7 @@ def _start_port_server(port_server_port): if waits > 10: port_server.kill() if port_server.poll() is not None: - print "port_server failed to start" + print 'port_server failed to start' port_log = open('portlog.txt', 'r').read() print port_log sys.exit(1) @@ -746,11 +750,11 @@ def _start_port_server(port_server_port): timeout=1).read() break except socket.timeout: - print "waiting for port_server" + print 'waiting for port_server: timeout' time.sleep(0.5) waits += 1 except urllib2.URLError: - print "waiting for port_server" + print 'waiting for port_server: urlerror' time.sleep(0.5) waits += 1 except: From 0d6499e7e1fc9c9d4e1b7369a28f1ef95006714f Mon Sep 17 00:00:00 2001 From: Craig Tiller Date: Mon, 5 Oct 2015 14:00:47 -0700 Subject: [PATCH 77/79] Add more verbose traces for port_server usage --- test/core/util/port_posix.c | 14 ++++++++++++-- tools/run_tests/run_tests.py | 10 +++++++--- 2 files changed, 19 insertions(+), 5 deletions(-) diff --git a/test/core/util/port_posix.c b/test/core/util/port_posix.c index 887079e0f8a..0a50660586a 100644 --- a/test/core/util/port_posix.c +++ b/test/core/util/port_posix.c @@ -213,15 +213,25 @@ static void got_port_from_server(grpc_exec_ctx *exec_ctx, void *arg, size_t i; int port = 0; portreq *pr = arg; + int failed = 0; + + if (!response) { + failed = 1; + gpr_log(GPR_DEBUG, + "failed port pick from server: retrying [response=NULL]"); + } else if (response->status != 200) { + failed = 1; + gpr_log(GPR_DEBUG, "failed port pick from server: status=%d", + response->status); + } - if (!response || response->status != 200) { + if (failed) { grpc_httpcli_request req; memset(&req, 0, sizeof(req)); GPR_ASSERT(pr->retries < 10); pr->retries++; req.host = pr->server; req.path = "/get"; - gpr_log(GPR_DEBUG, "failed port pick from server: retrying"); sleep(1); grpc_httpcli_get(exec_ctx, pr->ctx, &pr->pollset, &req, GRPC_TIMEOUT_SECONDS_TO_DEADLINE(10), got_port_from_server, diff --git a/tools/run_tests/run_tests.py b/tools/run_tests/run_tests.py index 38c06764b9b..9ed8ef33e1f 100755 --- a/tools/run_tests/run_tests.py +++ b/tools/run_tests/run_tests.py @@ -715,17 +715,21 @@ def _start_port_server(port_server_port): try: version = urllib2.urlopen('http://localhost:%d/version' % port_server_port, timeout=1).read() + print 'detected port server running' running = True except Exception: + print 'failed to detect port server: %s' % sys.exc_info()[0] running = False if running: with open('tools/run_tests/port_server.py') as f: current_version = hashlib.sha1(f.read()).hexdigest() running = (version == current_version) if not running: + print 'port_server version mismatch: killing the old one' urllib2.urlopen('http://localhost:%d/quit' % port_server_port).read() time.sleep(1) if not running: + print 'starting port_server' port_log = open('portlog.txt', 'w') port_server = subprocess.Popen( ['python', 'tools/run_tests/port_server.py', '-p', '%d' % port_server_port], @@ -737,7 +741,7 @@ def _start_port_server(port_server_port): if waits > 10: port_server.kill() if port_server.poll() is not None: - print "port_server failed to start" + print 'port_server failed to start' port_log = open('portlog.txt', 'r').read() print port_log sys.exit(1) @@ -746,11 +750,11 @@ def _start_port_server(port_server_port): timeout=1).read() break except socket.timeout: - print "waiting for port_server" + print 'waiting for port_server: timeout' time.sleep(0.5) waits += 1 except urllib2.URLError: - print "waiting for port_server" + print 'waiting for port_server: urlerror' time.sleep(0.5) waits += 1 except: From 1447ece09352c0c7a8fbeacad55214d2ff075b0d Mon Sep 17 00:00:00 2001 From: Craig Tiller Date: Mon, 5 Oct 2015 14:44:32 -0700 Subject: [PATCH 78/79] Use sys.executable instead of hard coding python binary string This is necessary to get the right binary on Windows --- tools/run_tests/run_tests.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/run_tests/run_tests.py b/tools/run_tests/run_tests.py index 6764586897a..e938520403d 100755 --- a/tools/run_tests/run_tests.py +++ b/tools/run_tests/run_tests.py @@ -732,7 +732,7 @@ def _start_port_server(port_server_port): print 'starting port_server' port_log = open('portlog.txt', 'w') port_server = subprocess.Popen( - ['python2.7', 'tools/run_tests/port_server.py', '-p', '%d' % port_server_port], + [sys.executable, 'tools/run_tests/port_server.py', '-p', '%d' % port_server_port], stderr=subprocess.STDOUT, stdout=port_log) # ensure port server is up From 7cd632c89ae9f2db2e25e4ece32e6103a5da63c3 Mon Sep 17 00:00:00 2001 From: murgatroid99 Date: Mon, 5 Oct 2015 15:56:18 -0700 Subject: [PATCH 79/79] Re-implemented call propagation tests to avoid race conditions --- src/node/test/surface_test.js | 263 +++++++++++++++++++++------------- 1 file changed, 165 insertions(+), 98 deletions(-) diff --git a/src/node/test/surface_test.js b/src/node/test/surface_test.js index 7af3ad895e2..989fe5fd659 100644 --- a/src/node/test/surface_test.js +++ b/src/node/test/surface_test.js @@ -690,120 +690,187 @@ describe('Other conditions', function() { }); }); }); - describe('Call propagation', function() { - var proxy; - var proxy_impl; - beforeEach(function() { - proxy = new grpc.Server(); - proxy_impl = { - unary: function(call) {}, - clientStream: function(stream) {}, - serverStream: function(stream) {}, - bidiStream: function(stream) {} - }; +}); +describe('Call propagation', function() { + var proxy; + var proxy_impl; + + var test_service; + var Client; + var client; + var server; + before(function() { + var test_proto = ProtoBuf.loadProtoFile(__dirname + '/test_service.proto'); + test_service = test_proto.lookup('TestService'); + server = new grpc.Server(); + server.addProtoService(test_service, { + unary: function(call) {}, + clientStream: function(stream) {}, + serverStream: function(stream) {}, + bidiStream: function(stream) {} }); - afterEach(function() { - console.log('Shutting down server'); - proxy.forceShutdown(); - }); - describe('Cancellation', function() { - it('With a client stream call', function(done) { - done = multiDone(done, 2); - proxy_impl.clientStream = function(parent, callback) { - client.clientStream(function(err, value) { - try { - assert(err); - assert.strictEqual(err.code, grpc.status.CANCELLED); - } finally { - callback(err, value); - done(); - } - }, null, {parent: parent}); - call.cancel(); - }; - proxy.addProtoService(test_service, proxy_impl); - var proxy_port = proxy.bind('localhost:0', server_insecure_creds); - proxy.start(); - var proxy_client = new Client('localhost:' + proxy_port, - grpc.Credentials.createInsecure()); - var call = proxy_client.clientStream(function(err, value) { - done(); - }); + var port = server.bind('localhost:0', server_insecure_creds); + Client = surface_client.makeProtobufClientConstructor(test_service); + client = new Client('localhost:' + port, grpc.Credentials.createInsecure()); + server.start(); + }); + after(function() { + server.forceShutdown(); + }); + beforeEach(function() { + proxy = new grpc.Server(); + proxy_impl = { + unary: function(call) {}, + clientStream: function(stream) {}, + serverStream: function(stream) {}, + bidiStream: function(stream) {} + }; + }); + afterEach(function() { + proxy.forceShutdown(); + }); + describe('Cancellation', function() { + it('With a unary call', function(done) { + done = multiDone(done, 2); + proxy_impl.unary = function(parent, callback) { + client.unary(parent.request, function(err, value) { + try { + assert(err); + assert.strictEqual(err.code, grpc.status.CANCELLED); + } finally { + callback(err, value); + done(); + } + }, null, {parent: parent}); + call.cancel(); + }; + proxy.addProtoService(test_service, proxy_impl); + var proxy_port = proxy.bind('localhost:0', server_insecure_creds); + proxy.start(); + var proxy_client = new Client('localhost:' + proxy_port, + grpc.Credentials.createInsecure()); + var call = proxy_client.unary({}, function(err, value) { + done(); }); - it('With a bidi stream call', function(done) { - done = multiDone(done, 2); - proxy_impl.bidiStream = function(parent) { - var child = client.bidiStream(null, {parent: parent}); - child.on('error', function(err) { + }); + it('With a client stream call', function(done) { + done = multiDone(done, 2); + proxy_impl.clientStream = function(parent, callback) { + client.clientStream(function(err, value) { + try { assert(err); assert.strictEqual(err.code, grpc.status.CANCELLED); + } finally { + callback(err, value); done(); - }); - call.cancel(); - }; - proxy.addProtoService(test_service, proxy_impl); - var proxy_port = proxy.bind('localhost:0', server_insecure_creds); - proxy.start(); - var proxy_client = new Client('localhost:' + proxy_port, - grpc.Credentials.createInsecure()); - var call = proxy_client.bidiStream(); - call.on('error', function(err) { + } + }, null, {parent: parent}); + call.cancel(); + }; + proxy.addProtoService(test_service, proxy_impl); + var proxy_port = proxy.bind('localhost:0', server_insecure_creds); + proxy.start(); + var proxy_client = new Client('localhost:' + proxy_port, + grpc.Credentials.createInsecure()); + var call = proxy_client.clientStream(function(err, value) { + done(); + }); + }); + it('With a server stream call', function(done) { + done = multiDone(done, 2); + proxy_impl.serverStream = function(parent) { + var child = client.serverStream(parent.request, null, + {parent: parent}); + child.on('error', function(err) { + assert(err); + assert.strictEqual(err.code, grpc.status.CANCELLED); done(); }); + call.cancel(); + }; + proxy.addProtoService(test_service, proxy_impl); + var proxy_port = proxy.bind('localhost:0', server_insecure_creds); + proxy.start(); + var proxy_client = new Client('localhost:' + proxy_port, + grpc.Credentials.createInsecure()); + var call = proxy_client.serverStream({}); + call.on('error', function(err) { + done(); }); }); - describe('Deadline', function() { - /* jshint bitwise:false */ - var deadline_flags = (grpc.propagate.DEFAULTS & - ~grpc.propagate.CANCELLATION); - it('With a client stream call', function(done) { - done = multiDone(done, 2); - proxy_impl.clientStream = function(parent, callback) { - client.clientStream(function(err, value) { - try { - assert(err); - assert(err.code === grpc.status.DEADLINE_EXCEEDED || - err.code === grpc.status.INTERNAL); - } finally { - callback(err, value); - done(); - } - }, null, {parent: parent, propagate_flags: deadline_flags}); - }; - proxy.addProtoService(test_service, proxy_impl); - var proxy_port = proxy.bind('localhost:0', server_insecure_creds); - proxy.start(); - var proxy_client = new Client('localhost:' + proxy_port, - grpc.Credentials.createInsecure()); - var deadline = new Date(); - deadline.setSeconds(deadline.getSeconds() + 1); - proxy_client.clientStream(function(err, value) { + it('With a bidi stream call', function(done) { + done = multiDone(done, 2); + proxy_impl.bidiStream = function(parent) { + var child = client.bidiStream(null, {parent: parent}); + child.on('error', function(err) { + assert(err); + assert.strictEqual(err.code, grpc.status.CANCELLED); done(); - }, null, {deadline: deadline}); - }); - it('With a bidi stream call', function(done) { - done = multiDone(done, 2); - proxy_impl.bidiStream = function(parent) { - var child = client.bidiStream( - null, {parent: parent, propagate_flags: deadline_flags}); - child.on('error', function(err) { + }); + call.cancel(); + }; + proxy.addProtoService(test_service, proxy_impl); + var proxy_port = proxy.bind('localhost:0', server_insecure_creds); + proxy.start(); + var proxy_client = new Client('localhost:' + proxy_port, + grpc.Credentials.createInsecure()); + var call = proxy_client.bidiStream(); + call.on('error', function(err) { + done(); + }); + }); + }); + describe('Deadline', function() { + /* jshint bitwise:false */ + var deadline_flags = (grpc.propagate.DEFAULTS & + ~grpc.propagate.CANCELLATION); + it('With a client stream call', function(done) { + done = multiDone(done, 2); + proxy_impl.clientStream = function(parent, callback) { + client.clientStream(function(err, value) { + try { assert(err); assert(err.code === grpc.status.DEADLINE_EXCEEDED || err.code === grpc.status.INTERNAL); + } finally { + callback(err, value); done(); - }); - }; - proxy.addProtoService(test_service, proxy_impl); - var proxy_port = proxy.bind('localhost:0', server_insecure_creds); - proxy.start(); - var proxy_client = new Client('localhost:' + proxy_port, - grpc.Credentials.createInsecure()); - var deadline = new Date(); - deadline.setSeconds(deadline.getSeconds() + 1); - var call = proxy_client.bidiStream(null, {deadline: deadline}); - call.on('error', function(err) { + } + }, null, {parent: parent, propagate_flags: deadline_flags}); + }; + proxy.addProtoService(test_service, proxy_impl); + var proxy_port = proxy.bind('localhost:0', server_insecure_creds); + proxy.start(); + var proxy_client = new Client('localhost:' + proxy_port, + grpc.Credentials.createInsecure()); + var deadline = new Date(); + deadline.setSeconds(deadline.getSeconds() + 1); + proxy_client.clientStream(function(err, value) { + done(); + }, null, {deadline: deadline}); + }); + it('With a bidi stream call', function(done) { + done = multiDone(done, 2); + proxy_impl.bidiStream = function(parent) { + var child = client.bidiStream( + null, {parent: parent, propagate_flags: deadline_flags}); + child.on('error', function(err) { + assert(err); + assert(err.code === grpc.status.DEADLINE_EXCEEDED || + err.code === grpc.status.INTERNAL); done(); }); + }; + proxy.addProtoService(test_service, proxy_impl); + var proxy_port = proxy.bind('localhost:0', server_insecure_creds); + proxy.start(); + var proxy_client = new Client('localhost:' + proxy_port, + grpc.Credentials.createInsecure()); + var deadline = new Date(); + deadline.setSeconds(deadline.getSeconds() + 1); + var call = proxy_client.bidiStream(null, {deadline: deadline}); + call.on('error', function(err) { + done(); }); }); });