aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--doc/environment_variables.md4
-rw-r--r--src/compiler/cpp_generator.cc15
-rw-r--r--src/python/grpcio/grpc/__init__.py23
-rw-r--r--src/python/grpcio_tests/tests/http2/negative_http2_client.py (renamed from src/python/grpcio_tests/tests/http2/_negative_http2_client.py)11
4 files changed, 29 insertions, 24 deletions
diff --git a/doc/environment_variables.md b/doc/environment_variables.md
index d02801bc9b..832762a5f5 100644
--- a/doc/environment_variables.md
+++ b/doc/environment_variables.md
@@ -55,10 +55,12 @@ some configuration as environment variables that can be set.
- secure_endpoint - traces bytes flowing through encrypted channels
- transport_security - traces metadata about secure channel establishment
- tcp - traces bytes in and out of a channel
+
'all' can additionally be used to turn all traces on.
Individual traces can be disabled by prefixing them with '-'.
+
Example:
- export GRPC_TRACE=all,-pending_tags
+ export GRPC_TRACE=all,-pending_tags
* GRPC_VERBOSITY
Default gRPC logging verbosity - one of:
diff --git a/src/compiler/cpp_generator.cc b/src/compiler/cpp_generator.cc
index a26eeb46b9..e481aaf811 100644
--- a/src/compiler/cpp_generator.cc
+++ b/src/compiler/cpp_generator.cc
@@ -1218,13 +1218,15 @@ void PrintSourceService(Printer *printer, const Service *service,
std::map<grpc::string, grpc::string> *vars) {
(*vars)["Service"] = service->name();
- printer->Print(*vars,
- "static const char* $prefix$$Service$_method_names[] = {\n");
- for (int i = 0; i < service->method_count(); ++i) {
- (*vars)["Method"] = service->method(i).get()->name();
- printer->Print(*vars, " \"/$Package$$Service$/$Method$\",\n");
+ if (service->method_count() > 0) {
+ printer->Print(*vars,
+ "static const char* $prefix$$Service$_method_names[] = {\n");
+ for (int i = 0; i < service->method_count(); ++i) {
+ (*vars)["Method"] = service->method(i).get()->name();
+ printer->Print(*vars, " \"/$Package$$Service$/$Method$\",\n");
+ }
+ printer->Print(*vars, "};\n\n");
}
- printer->Print(*vars, "};\n\n");
printer->Print(*vars,
"std::unique_ptr< $ns$$Service$::Stub> $ns$$Service$::NewStub("
@@ -1272,7 +1274,6 @@ void PrintSourceService(Printer *printer, const Service *service,
printer->Print(*vars, "$ns$$Service$::Service::Service() {\n");
printer->Indent();
- printer->Print(*vars, "(void)$prefix$$Service$_method_names;\n");
for (int i = 0; i < service->method_count(); ++i) {
auto method = service->method(i);
(*vars)["Idx"] = as_string(i);
diff --git a/src/python/grpcio/grpc/__init__.py b/src/python/grpcio/grpc/__init__.py
index abe14e7049..fe29971799 100644
--- a/src/python/grpcio/grpc/__init__.py
+++ b/src/python/grpcio/grpc/__init__.py
@@ -487,9 +487,9 @@ class UnaryUnaryMultiCallable(six.with_metaclass(abc.ABCMeta)):
Returns:
An object that is both a Call for the RPC and a Future. In the event of
- RPC completion, the return Future's result value will be the response
- message of the RPC. Should the event terminate with non-OK status, the
- returned Future's exception value will be an RpcError.
+ RPC completion, the return Call-Future's result value will be the
+ response message of the RPC. Should the event terminate with non-OK
+ status, the returned Call-Future's exception value will be an RpcError.
"""
raise NotImplementedError()
@@ -510,8 +510,8 @@ class UnaryStreamMultiCallable(six.with_metaclass(abc.ABCMeta)):
Returns:
An object that is both a Call for the RPC and an iterator of response
- values. Drawing response values from the returned iterator may raise
- RpcError indicating termination of the RPC with non-OK status.
+ values. Drawing response values from the returned Call-iterator may
+ raise RpcError indicating termination of the RPC with non-OK status.
"""
raise NotImplementedError()
@@ -535,8 +535,7 @@ class StreamUnaryMultiCallable(six.with_metaclass(abc.ABCMeta)):
credentials: An optional CallCredentials for the RPC.
Returns:
- The response value for the RPC, and a Call for the RPC if with_call was
- set to True at invocation.
+ The response value for the RPC.
Raises:
RpcError: Indicating that the RPC terminated with non-OK status. The
@@ -587,9 +586,9 @@ class StreamUnaryMultiCallable(six.with_metaclass(abc.ABCMeta)):
Returns:
An object that is both a Call for the RPC and a Future. In the event of
- RPC completion, the return Future's result value will be the response
- message of the RPC. Should the event terminate with non-OK status, the
- returned Future's exception value will be an RpcError.
+ RPC completion, the return Call-Future's result value will be the
+ response message of the RPC. Should the event terminate with non-OK
+ status, the returned Call-Future's exception value will be an RpcError.
"""
raise NotImplementedError()
@@ -614,8 +613,8 @@ class StreamStreamMultiCallable(six.with_metaclass(abc.ABCMeta)):
Returns:
An object that is both a Call for the RPC and an iterator of response
- values. Drawing response values from the returned iterator may raise
- RpcError indicating termination of the RPC with non-OK status.
+ values. Drawing response values from the returned Call-iterator may
+ raise RpcError indicating termination of the RPC with non-OK status.
"""
raise NotImplementedError()
diff --git a/src/python/grpcio_tests/tests/http2/_negative_http2_client.py b/src/python/grpcio_tests/tests/http2/negative_http2_client.py
index c192d827c4..b8adf093a5 100644
--- a/src/python/grpcio_tests/tests/http2/_negative_http2_client.py
+++ b/src/python/grpcio_tests/tests/http2/negative_http2_client.py
@@ -82,20 +82,22 @@ def _goaway(stub):
def _rst_after_header(stub):
resp_future = stub.UnaryCall.future(_SIMPLE_REQUEST)
- _validate_status_code_and_details(resp_future, grpc.StatusCode.UNAVAILABLE,
- "")
+ _validate_status_code_and_details(resp_future, grpc.StatusCode.INTERNAL,
+ "Received RST_STREAM with error code 0")
def _rst_during_data(stub):
resp_future = stub.UnaryCall.future(_SIMPLE_REQUEST)
- _validate_status_code_and_details(resp_future, grpc.StatusCode.UNKNOWN, "")
+ _validate_status_code_and_details(resp_future, grpc.StatusCode.INTERNAL,
+ "Received RST_STREAM with error code 0")
def _rst_after_data(stub):
resp_future = stub.UnaryCall.future(_SIMPLE_REQUEST)
_validate_payload_type_and_length(
next(resp_future), messages_pb2.COMPRESSABLE, _RESPONSE_SIZE)
- _validate_status_code_and_details(resp_future, grpc.StatusCode.UNKNOWN, "")
+ _validate_status_code_and_details(resp_future, grpc.StatusCode.INTERNAL,
+ "Received RST_STREAM with error code 0")
def _ping(stub):
@@ -159,6 +161,7 @@ def _args():
def _stub(server_host, server_port):
target = '{}:{}'.format(server_host, server_port)
channel = grpc.insecure_channel(target)
+ grpc.channel_ready_future(channel).result()
return test_pb2.TestServiceStub(channel)