Skip to content

Commit

Permalink
Merge branch 'master' of github.com:grpc/grpc into codegen_remove_proto
Browse files Browse the repository at this point in the history
  • Loading branch information
dgquintas committed May 2, 2016
2 parents 1b2db63 + 1dd74dd commit 80721b2
Show file tree
Hide file tree
Showing 259 changed files with 5,530 additions and 11,995 deletions.
4 changes: 4 additions & 0 deletions BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ cc_library(
"src/core/lib/support/stack_lockfree.c",
"src/core/lib/support/string.c",
"src/core/lib/support/string_posix.c",
"src/core/lib/support/string_util_win32.c",
"src/core/lib/support/string_win32.c",
"src/core/lib/support/subprocess_posix.c",
"src/core/lib/support/subprocess_windows.c",
Expand All @@ -98,6 +99,7 @@ cc_library(
"src/core/lib/support/time_precise.c",
"src/core/lib/support/time_win32.c",
"src/core/lib/support/tls_pthread.c",
"src/core/lib/support/tmpfile_msys.c",
"src/core/lib/support/tmpfile_posix.c",
"src/core/lib/support/tmpfile_win32.c",
"src/core/lib/support/wrap_memcpy.c",
Expand Down Expand Up @@ -1223,6 +1225,7 @@ objc_library(
"src/core/lib/support/stack_lockfree.c",
"src/core/lib/support/string.c",
"src/core/lib/support/string_posix.c",
"src/core/lib/support/string_util_win32.c",
"src/core/lib/support/string_win32.c",
"src/core/lib/support/subprocess_posix.c",
"src/core/lib/support/subprocess_windows.c",
Expand All @@ -1237,6 +1240,7 @@ objc_library(
"src/core/lib/support/time_precise.c",
"src/core/lib/support/time_win32.c",
"src/core/lib/support/tls_pthread.c",
"src/core/lib/support/tmpfile_msys.c",
"src/core/lib/support/tmpfile_posix.c",
"src/core/lib/support/tmpfile_win32.c",
"src/core/lib/support/wrap_memcpy.c",
Expand Down
68 changes: 68 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -1010,6 +1010,7 @@ cxx_time_test: $(BINDIR)/$(CONFIG)/cxx_time_test
end2end_test: $(BINDIR)/$(CONFIG)/end2end_test
generic_async_streaming_ping_pong_test: $(BINDIR)/$(CONFIG)/generic_async_streaming_ping_pong_test
generic_end2end_test: $(BINDIR)/$(CONFIG)/generic_end2end_test
golden_file_test: $(BINDIR)/$(CONFIG)/golden_file_test
grpc_cli: $(BINDIR)/$(CONFIG)/grpc_cli
grpc_cpp_plugin: $(BINDIR)/$(CONFIG)/grpc_cpp_plugin
grpc_csharp_plugin: $(BINDIR)/$(CONFIG)/grpc_csharp_plugin
Expand Down Expand Up @@ -1381,6 +1382,7 @@ buildtests_cxx: buildtests_zookeeper privatelibs_cxx \
$(BINDIR)/$(CONFIG)/end2end_test \
$(BINDIR)/$(CONFIG)/generic_async_streaming_ping_pong_test \
$(BINDIR)/$(CONFIG)/generic_end2end_test \
$(BINDIR)/$(CONFIG)/golden_file_test \
$(BINDIR)/$(CONFIG)/grpc_cli \
$(BINDIR)/$(CONFIG)/grpclb_api_test \
$(BINDIR)/$(CONFIG)/hybrid_end2end_test \
Expand Down Expand Up @@ -1712,6 +1714,8 @@ test_cxx: test_zookeeper buildtests_cxx
$(Q) $(BINDIR)/$(CONFIG)/generic_async_streaming_ping_pong_test || ( echo test generic_async_streaming_ping_pong_test failed ; exit 1 )
$(E) "[RUN] Testing generic_end2end_test"
$(Q) $(BINDIR)/$(CONFIG)/generic_end2end_test || ( echo test generic_end2end_test failed ; exit 1 )
$(E) "[RUN] Testing golden_file_test"
$(Q) $(BINDIR)/$(CONFIG)/golden_file_test || ( echo test golden_file_test failed ; exit 1 )
$(E) "[RUN] Testing grpclb_api_test"
$(Q) $(BINDIR)/$(CONFIG)/grpclb_api_test || ( echo test grpclb_api_test failed ; exit 1 )
$(E) "[RUN] Testing hybrid_end2end_test"
Expand Down Expand Up @@ -1880,6 +1884,21 @@ $(GENDIR)/src/proto/grpc/lb/v0/load_balancer.grpc.pb.cc: src/proto/grpc/lb/v0/lo
$(Q) $(PROTOC) --grpc_out=$(GENDIR) --plugin=protoc-gen-grpc=$(BINDIR)/$(CONFIG)/grpc_cpp_plugin $<
endif

ifeq ($(NO_PROTOC),true)
$(GENDIR)/src/proto/grpc/testing/compiler_test.pb.cc: protoc_dep_error
$(GENDIR)/src/proto/grpc/testing/compiler_test.grpc.pb.cc: protoc_dep_error
else
$(GENDIR)/src/proto/grpc/testing/compiler_test.pb.cc: src/proto/grpc/testing/compiler_test.proto $(PROTOBUF_DEP) $(PROTOC_PLUGINS)
$(E) "[PROTOC] Generating protobuf CC file from $<"
$(Q) mkdir -p `dirname $@`
$(Q) $(PROTOC) --cpp_out=$(GENDIR) $<

$(GENDIR)/src/proto/grpc/testing/compiler_test.grpc.pb.cc: src/proto/grpc/testing/compiler_test.proto $(PROTOBUF_DEP) $(PROTOC_PLUGINS)
$(E) "[GRPC] Generating gRPC's protobuf service CC file from $<"
$(Q) mkdir -p `dirname $@`
$(Q) $(PROTOC) --grpc_out=$(GENDIR) --plugin=protoc-gen-grpc=$(BINDIR)/$(CONFIG)/grpc_cpp_plugin $<
endif

ifeq ($(NO_PROTOC),true)
$(GENDIR)/src/proto/grpc/testing/control.pb.cc: protoc_dep_error
$(GENDIR)/src/proto/grpc/testing/control.grpc.pb.cc: protoc_dep_error
Expand Down Expand Up @@ -2331,6 +2350,7 @@ LIBGPR_SRC = \
src/core/lib/support/stack_lockfree.c \
src/core/lib/support/string.c \
src/core/lib/support/string_posix.c \
src/core/lib/support/string_util_win32.c \
src/core/lib/support/string_win32.c \
src/core/lib/support/subprocess_posix.c \
src/core/lib/support/subprocess_windows.c \
Expand All @@ -2345,6 +2365,7 @@ LIBGPR_SRC = \
src/core/lib/support/time_precise.c \
src/core/lib/support/time_win32.c \
src/core/lib/support/tls_pthread.c \
src/core/lib/support/tmpfile_msys.c \
src/core/lib/support/tmpfile_posix.c \
src/core/lib/support/tmpfile_win32.c \
src/core/lib/support/wrap_memcpy.c \
Expand Down Expand Up @@ -10448,6 +10469,53 @@ endif
endif


GOLDEN_FILE_TEST_SRC = \
$(GENDIR)/src/proto/grpc/testing/compiler_test.pb.cc $(GENDIR)/src/proto/grpc/testing/compiler_test.grpc.pb.cc \
test/cpp/codegen/golden_file_test.cc \

GOLDEN_FILE_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(GOLDEN_FILE_TEST_SRC))))
ifeq ($(NO_SECURE),true)

# You can't build secure targets if you don't have OpenSSL.

$(BINDIR)/$(CONFIG)/golden_file_test: openssl_dep_error

else




ifeq ($(NO_PROTOBUF),true)

# You can't build the protoc plugins or protobuf-enabled targets if you don't have protobuf 3.0.0+.

$(BINDIR)/$(CONFIG)/golden_file_test: protobuf_dep_error

else

$(BINDIR)/$(CONFIG)/golden_file_test: $(PROTOBUF_DEP) $(GOLDEN_FILE_TEST_OBJS) $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr.a
$(E) "[LD] Linking $@"
$(Q) mkdir -p `dirname $@`
$(Q) $(LDXX) $(LDFLAGS) $(GOLDEN_FILE_TEST_OBJS) $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr.a $(LDLIBSXX) $(LDLIBS_PROTOBUF) $(LDLIBS) $(LDLIBS_SECURE) $(GTEST_LIB) -o $(BINDIR)/$(CONFIG)/golden_file_test

endif

endif

$(OBJDIR)/$(CONFIG)/src/proto/grpc/testing/compiler_test.o: $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr.a

$(OBJDIR)/$(CONFIG)/test/cpp/codegen/golden_file_test.o: $(LIBDIR)/$(CONFIG)/libgrpc++.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr.a

deps_golden_file_test: $(GOLDEN_FILE_TEST_OBJS:.o=.dep)

ifneq ($(NO_SECURE),true)
ifneq ($(NO_DEPS),true)
-include $(GOLDEN_FILE_TEST_OBJS:.o=.dep)
endif
endif
$(OBJDIR)/$(CONFIG)/test/cpp/codegen/golden_file_test.o: $(GENDIR)/src/proto/grpc/testing/compiler_test.pb.cc $(GENDIR)/src/proto/grpc/testing/compiler_test.grpc.pb.cc


GRPC_CLI_SRC = \
test/cpp/util/grpc_cli.cc \

Expand Down
2 changes: 2 additions & 0 deletions binding.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -522,6 +522,7 @@
'src/core/lib/support/stack_lockfree.c',
'src/core/lib/support/string.c',
'src/core/lib/support/string_posix.c',
'src/core/lib/support/string_util_win32.c',
'src/core/lib/support/string_win32.c',
'src/core/lib/support/subprocess_posix.c',
'src/core/lib/support/subprocess_windows.c',
Expand All @@ -536,6 +537,7 @@
'src/core/lib/support/time_precise.c',
'src/core/lib/support/time_win32.c',
'src/core/lib/support/tls_pthread.c',
'src/core/lib/support/tmpfile_msys.c',
'src/core/lib/support/tmpfile_posix.c',
'src/core/lib/support/tmpfile_win32.c',
'src/core/lib/support/wrap_memcpy.c',
Expand Down
13 changes: 13 additions & 0 deletions build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ filegroups:
- src/core/lib/support/stack_lockfree.c
- src/core/lib/support/string.c
- src/core/lib/support/string_posix.c
- src/core/lib/support/string_util_win32.c
- src/core/lib/support/string_win32.c
- src/core/lib/support/subprocess_posix.c
- src/core/lib/support/subprocess_windows.c
Expand All @@ -117,6 +118,7 @@ filegroups:
- src/core/lib/support/time_precise.c
- src/core/lib/support/time_win32.c
- src/core/lib/support/tls_pthread.c
- src/core/lib/support/tmpfile_msys.c
- src/core/lib/support/tmpfile_posix.c
- src/core/lib/support/tmpfile_win32.c
- src/core/lib/support/wrap_memcpy.c
Expand Down Expand Up @@ -2552,6 +2554,17 @@ targets:
- grpc
- gpr_test_util
- gpr
- name: golden_file_test
gtest: true
build: test
language: c++
src:
- src/proto/grpc/testing/compiler_test.proto
- test/cpp/codegen/golden_file_test.cc
deps:
- grpc++
- grpc
- gpr
- name: grpc_cli
build: test
run: false
Expand Down
2 changes: 2 additions & 0 deletions config.m4
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ if test "$PHP_GRPC" != "no"; then
src/core/lib/support/stack_lockfree.c \
src/core/lib/support/string.c \
src/core/lib/support/string_posix.c \
src/core/lib/support/string_util_win32.c \
src/core/lib/support/string_win32.c \
src/core/lib/support/subprocess_posix.c \
src/core/lib/support/subprocess_windows.c \
Expand All @@ -77,6 +78,7 @@ if test "$PHP_GRPC" != "no"; then
src/core/lib/support/time_precise.c \
src/core/lib/support/time_win32.c \
src/core/lib/support/tls_pthread.c \
src/core/lib/support/tmpfile_msys.c \
src/core/lib/support/tmpfile_posix.c \
src/core/lib/support/tmpfile_win32.c \
src/core/lib/support/wrap_memcpy.c \
Expand Down
15 changes: 15 additions & 0 deletions doc/fail_fast.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
gRPC Fail Fast Semantics
========================

Fail fast requests allow terminating requests (with status UNAVAILABLE) prior
to the deadline of the request being met.

gRPC implementations of fail fast can terminate requests whenever a channel is
in the TRANSIENT_FAILURE or SHUTDOWN states. If the channel is in any other
state (CONNECTING, READY, or IDLE) the request should not be terminated.

Fail fast SHOULD be the default for gRPC implementations, with an option to
switch to non fail fast.

The opposite of fail fast is 'ignore connectivity'.

2 changes: 1 addition & 1 deletion examples/cpp/helloworld/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
CXX = g++
CPPFLAGS += -I/usr/local/include -pthread
CXXFLAGS += -std=c++11
LDFLAGS += -L/usr/local/lib -lgrpc++_unsecure -lgrpc -lprotobuf -lpthread -ldl
LDFLAGS += -L/usr/local/lib `pkg-config --libs grpc++` -lprotobuf -lpthread -ldl
PROTOC = protoc
GRPC_CPP_PLUGIN = grpc_cpp_plugin
GRPC_CPP_PLUGIN_PATH ?= `which $(GRPC_CPP_PLUGIN)`
Expand Down
2 changes: 1 addition & 1 deletion examples/cpp/route_guide/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
CXX = g++
CPPFLAGS += -I/usr/local/include -pthread
CXXFLAGS += -std=c++11
LDFLAGS += -L/usr/local/lib -lgrpc++_unsecure -lgrpc -lprotobuf -lpthread -ldl
LDFLAGS += -L/usr/local/lib `pkg-config --libs grpc++` -lprotobuf -lpthread -ldl
PROTOC = protoc
GRPC_CPP_PLUGIN = grpc_cpp_plugin
GRPC_CPP_PLUGIN_PATH ?= `which $(GRPC_CPP_PLUGIN)`
Expand Down
22 changes: 7 additions & 15 deletions examples/node/greeter_client.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,30 +31,22 @@
*
*/

var grpc = require('grpc');
var PROTO_PATH = __dirname + '/../protos/helloworld.proto';

var hello_messages = require('./helloworld_pb');
var hello_service = require('./helloworld_grpc_pb');
var grpc = require('grpc');
var hello_proto = grpc.load(PROTO_PATH).helloworld;

function main() {
var client = new hello_service.GreeterClient('localhost:50051',
grpc.credentials.createInsecure());
var client = new hello_proto.Greeter('localhost:50051',
grpc.credentials.createInsecure());
var user;
if (process.argv.length >= 3) {
user = process.argv[2];
} else {
user = 'world';
}

var request = new hello_messages.HelloRequest();
request.setName(user);

client.sayHello(request, function(err, response) {
if (err) {
debugger;
throw err;
}
console.log('Greeting:', response.getMessage());
client.sayHello({name: user}, function(err, response) {
console.log('Greeting:', response.message);
});
}

Expand Down
12 changes: 5 additions & 7 deletions examples/node/greeter_server.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,18 +31,16 @@
*
*/

var grpc = require('grpc');
var PROTO_PATH = __dirname + '/../protos/helloworld.proto';

var hello_messages = require('./helloworld_pb');
var hello_service = require('./helloworld_grpc_pb');
var grpc = require('grpc');
var hello_proto = grpc.load(PROTO_PATH).helloworld;

/**
* Implements the SayHello RPC method.
*/
function sayHello(call, callback) {
var reply = new hello_messages.HelloReply();
reply.setMessage("Hello " + call.request.getName());
callback(null, reply);
callback(null, {message: 'Hello ' + call.request.name});
}

/**
Expand All @@ -51,7 +49,7 @@ function sayHello(call, callback) {
*/
function main() {
var server = new grpc.Server();
server.addService(hello_service.GreeterService, {sayHello: sayHello});
server.addProtoService(hello_proto.Greeter.service, {sayHello: sayHello});
server.bind('0.0.0.0:50051', grpc.ServerCredentials.createInsecure());
server.start();
}
Expand Down
39 changes: 0 additions & 39 deletions examples/node/helloworld_grpc_pb.js

This file was deleted.

Loading

0 comments on commit 80721b2

Please sign in to comment.