Merge pull request #9406 from yang-g/no_method_service

Stop generating method name array when there is no method.
diff --git a/include/grpc++/impl/codegen/config.h b/include/grpc++/impl/codegen/config.h
index af3ee5a..a43bf65 100644
--- a/include/grpc++/impl/codegen/config.h
+++ b/include/grpc++/impl/codegen/config.h
@@ -39,6 +39,12 @@
 #define GRPC_CUSTOM_STRING std::string
 #endif
 
+// The following macros are deprecated and appear only for users
+// with PB files generated using gRPC 1.0.x plugins. They should
+// not be used in new code
+#define GRPC_OVERRIDE override  // deprecated
+#define GRPC_FINAL final        // deprecated
+
 namespace grpc {
 
 typedef GRPC_CUSTOM_STRING string;
diff --git a/include/grpc++/support/channel_arguments.h b/include/grpc++/support/channel_arguments.h
index d43f7c6..efdf777 100644
--- a/include/grpc++/support/channel_arguments.h
+++ b/include/grpc++/support/channel_arguments.h
@@ -88,6 +88,10 @@
   /// The given buffer pool will be attached to the constructed channel
   void SetResourceQuota(const ResourceQuota& resource_quota);
 
+  /// Sets the max receive and send message sizes.
+  void SetMaxReceiveMessageSize(int size);
+  void SetMaxSendMessageSize(int size);
+
   /// Set LB policy name.
   /// Note that if the name resolver returns only balancer addresses, the
   /// grpclb LB policy will be used, regardless of what is specified here.
diff --git a/src/cpp/common/channel_arguments.cc b/src/cpp/common/channel_arguments.cc
index 1fdd106..65f3277 100644
--- a/src/cpp/common/channel_arguments.cc
+++ b/src/cpp/common/channel_arguments.cc
@@ -143,6 +143,14 @@
                        grpc_resource_quota_arg_vtable());
 }
 
+void ChannelArguments::SetMaxReceiveMessageSize(int size) {
+  SetInt(GRPC_ARG_MAX_RECEIVE_MESSAGE_LENGTH, size);
+}
+
+void ChannelArguments::SetMaxSendMessageSize(int size) {
+  SetInt(GRPC_ARG_MAX_SEND_MESSAGE_LENGTH, size);
+}
+
 void ChannelArguments::SetLoadBalancingPolicyName(
     const grpc::string& lb_policy_name) {
   SetString(GRPC_ARG_LB_POLICY_NAME, lb_policy_name);
diff --git a/src/python/grpcio/grpc/__init__.py b/src/python/grpcio/grpc/__init__.py
index abe14e7..fe29971 100644
--- a/src/python/grpcio/grpc/__init__.py
+++ b/src/python/grpcio/grpc/__init__.py
@@ -487,9 +487,9 @@
 
     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 @@
 
     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 @@
       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 @@
 
     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 @@
 
     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
similarity index 94%
rename from src/python/grpcio_tests/tests/http2/_negative_http2_client.py
rename to src/python/grpcio_tests/tests/http2/negative_http2_client.py
index c192d82..b8adf09 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 _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 _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)
 
 
diff --git a/tools/distrib/pyformat_code.sh b/tools/distrib/yapf_code.sh
similarity index 100%
rename from tools/distrib/pyformat_code.sh
rename to tools/distrib/yapf_code.sh
diff --git a/tools/run_tests/sanity/sanity_tests.yaml b/tools/run_tests/sanity/sanity_tests.yaml
index f29b700..ce41da8 100644
--- a/tools/run_tests/sanity/sanity_tests.yaml
+++ b/tools/run_tests/sanity/sanity_tests.yaml
@@ -12,6 +12,6 @@
 - script: tools/distrib/check_trailing_newlines.sh
 - script: tools/distrib/check_nanopb_output.sh
 - script: tools/distrib/check_include_guards.py
-- script: tools/distrib/pyformat_code.sh
+- script: tools/distrib/yapf_code.sh
 - script: tools/distrib/python/check_grpcio_tools.py