Commit Graph

1863 Commits

Author SHA1 Message Date
Mehrdad Afshari 90dbd2b670 Alter health/reflection packages' build criterion
Using the presence of the `*_pb2_grpc` module, as opposed to the absence
of the build script (`*_commands` module) is a problematic choice,
because even if a generated file is present, the test infrastructure may
want to regenerate it under a different environment (e.g. different
Python/proto package version).  This will ensure the protos always get
recompiled if we have a `*_commands` module present, signaling we are in
a build environment, thereby making the process hermetic.
2017-11-20 18:37:34 -08:00
Nathaniel Manista 018153cd1a
Merge pull request #13406 from nathanielmanistaatgoogle/interop_required_args
Require port and server_port interop flags.
2017-11-20 17:35:46 -08:00
Nathaniel Manista ec4791254e
Merge pull request #13188 from cauthu/python-server-cert-reload
Add Python support for server SSL certificate reloading.
2017-11-20 16:26:44 -08:00
Nicolas "Pixel" Noble 18a6837bb0 Merge branch 'v1.7.x' of https://github.com/grpc/grpc 2017-11-21 00:36:21 +01:00
Giang Nguyen bcf083fa90 Add Python support for server SSL cert reloading
Previously, a secure server is configured with SSL credentials during
initialization, and those credentials will be used for the lifetime of
the server. If the user wants the server to use new credentials, the
user has to restart the server, resulting in server downtime. This
change enables the user to optionally configure the server with a
"certificiate config fetcher," such that on every new client
connection, the server will call the config fetcher before performing
the handshake, allowing the user application to optionally specify new
certificate configuration for the server to use (the fetcher can
return a "no change" and the server continues to use its current
certificate configuration).
2017-11-20 23:09:56 +00:00
Noah Eisen ad3bdbeb4a
Merge pull request #13335 from ncteisen/inline-closure
Inline Closure
2017-11-16 14:43:06 -08:00
Mehrdad Afshari 9d1ba2efd9 Fix grpcio_{health_checking,reflection} packaging
The previous packaging structure exhibited strange behavior of
slowness when trying to use pip to install grpcio-reflection
or grpcio-health-checking in a single line with grpcio-tools.

The root cause seems to be the complicated interaction between
pip and setuptools and the fact that we ship a single .tar.gz
"source" archive for `grpcio_reflection` and
`grpcio_health_checking` packages.  `pip` tries to build this
"source" package, and our build process wants to generate
code for the `.proto` files in the package.  However, we have
already processed the `.proto` files into `_pb2.py` files in
our artifact build process, and installing `grpcio_tools`
to get `grpcio_{reflection,health_checking}` seems excessive.
The behavior gets worse since `setuptools`, while building
the package from source, tries to fetch `grpcio_tools` from
source and build that too.  This takes a while, since it
involves compiling a bunch of native code from `protobuf` and
`grpc` and requires a C compiler to boot.

This commit modifies the Python artifact for the two packages
so that they will not include the raw `.proto` files in the
distribution uploaded to PyPI, nor would they contain the
Python module that does the preprocessing code generation
from the respective .proto files.  Instead, a specific code
path is taken when the generated `_pb2_grpc` Python module is
not present in the package to provide such functionality
when built from the gRPC git repository (and hence when built
from our CI infrastructure.)
2017-11-15 16:36:25 -08:00
Nathaniel Manista 254cb369a6 Require port and server_port interop flags
Also sort arguments to ArgumentParser.add_argument in idiomatic order.
2017-11-15 20:32:00 +00:00
Noah Eisen 9268703dc9 Merge branch 'master' of https://github.com/grpc/grpc into inline-closure 2017-11-13 17:16:56 -08:00
Mehrdad Afshari d7a03c8197 Correct HEALTH_PROTO to REFLECTION_PROTO 2017-11-13 13:55:49 -08:00
ncteisen dd34f3caf6 Inline closure 2017-11-12 20:18:24 -08:00
Alexander Polcyn 9f5163eb85 Bump v1.7.x branch to 1.7.2 2017-11-01 11:07:28 -07:00
Jim King 3e0769957e
Merge pull request #13106 from Vizerai/census_update
Cleaning up census code.
2017-10-31 11:10:00 -07:00
Yuchen Zeng 9e6837d397
Merge pull request #12732 from y-zeng/connectivity_watcher
Client channel backup poller
2017-10-30 14:47:24 -07:00
Yuchen Zeng 0bad30a244 Use backup pollser instead of connectivity watcher 2017-10-30 12:06:52 -07:00
Yuchen Zeng f8ed4fa7f4 convert connectivity_watcher to cpp file 2017-10-30 12:06:52 -07:00
Yuchen Zeng 7269667f9e Add client channel connectivity watcher 2017-10-30 12:04:53 -07:00
Alexander Polcyn 40ba62f2a2 Bump v1.7.x branch to 1.7.1 2017-10-26 20:17:26 -07:00
Vizerai bb7d088ed2 Cleaning up census code. 2017-10-23 12:06:29 -07:00
Nicolas "Pixel" Noble 863a0500df Flagging 1.7.0 2017-10-21 01:48:27 +02:00
Ken Payson 9714e0376a Add thread pool reset on fork with FORKING_SUPPORT_ENABLED 2017-10-12 10:22:48 -07:00
Mark D. Roth 0e8cad5bba Merge remote-tracking branch 'upstream/master' into pick_first_subchannel_list 2017-10-12 09:13:15 -07:00
Mark D. Roth 5e9848e7b0 Refactor subchannel_list code out of RR and use it in PF. 2017-10-06 13:59:32 -07:00
Craig Tiller d48bd078d7 Fixes 2017-10-06 11:25:14 -07:00
Craig Tiller 5291023730 Merge github.com:grpc/grpc into flowctl+millis 2017-10-05 10:28:15 -07:00
Craig Tiller 76eab735f4 Merge github.com:grpc/grpc into flowctl+millis 2017-10-05 08:36:34 -07:00
murgatroid99 90e9140211 1.7.x is now 1.7.0-pre1 2017-10-04 14:02:22 -07:00
Yash Tibrewal ec3c138a83 Merge branch 'master' into externC 2017-10-03 16:23:42 -07:00
Yash Tibrewal bc460fa3c4 Rebasing on master for easier merging and testing 2017-10-02 19:01:25 -07:00
murgatroid99 9887379158 Update version to 1.8.0-dev, update g word to 'generous' 2017-10-02 17:31:33 -07:00
Yash Tibrewal 26c78038a5 Trying ken's fix for windows python 2017-10-02 16:34:00 -07:00
Yash Tibrewal a0b96d4f9a Running generate projects 2017-10-02 16:34:00 -07:00
Yash Tibrewal 15ce142d65 Reverting pb.c files for now. Also fixing few more build errors 2017-10-02 16:32:27 -07:00
Yash Tibrewal 83062842c3 Changes for C to C++. Adding extern C to header files for compatibility.
Also converting to .cc
2017-10-02 16:29:41 -07:00
Yash Tibrewal 1c9b584a15 Changes for C to C++. Adding extern C to header files for compatibility. 2017-10-02 16:26:53 -07:00
Craig Tiller 1e868f0f95 Merge github.com:grpc/grpc into flowctl+millis 2017-09-29 11:18:26 -07:00
Nathaniel Manista 87997edd45 Merge pull request #12765 from nathanielmanistaatgoogle/cython
Devolve staticmethod to ordinary function.
2017-09-29 08:45:31 -07:00
Mark D. Roth ede8ed2156 Merge pull request #12374 from markdroth/plugin_credentials_api_fix
Change plugin credentials API to support both sync and async modes
2017-09-29 07:26:50 -07:00
Nathaniel Manista 103991eb73 Devolve staticmethod to ordinary function 2017-09-29 05:04:49 +00:00
Nathaniel Manista 3efe754799 "resopnse" typo correction 2017-09-28 22:38:06 +00:00
Nathaniel Manista 4ceb743c82 Drop unused staticmethods 2017-09-28 22:37:38 +00:00
Nathaniel Manista 3e3bbdff91 Raise exception instances rather than classes 2017-09-28 22:36:31 +00:00
Mark D. Roth 6456e494a8 Merge remote-tracking branch 'upstream/master' into plugin_credentials_api_fix 2017-09-28 15:16:14 -07:00
Mehrdad Afshari e249079cbe Be a tad more specific requesting error reports
This commit is a rebase of an old contribution with minor formatting
edits (cf. https://github.com/grpc/grpc/pull/8663)

[Original Author]
Masood Malekghassemi <atash@google.com>
Date:      Mon Nov 7 14:49:09 2016 -0800
Contributor is a Xoogler and the contribution is owned by Google Inc.
as per the copyright assignment agreement with the original author,
as it was drafted during their employment with Google Inc.
2017-09-26 11:31:00 -07:00
Mark D. Roth b4c01f9e29 Merge remote-tracking branch 'upstream/master' into plugin_credentials_api_fix 2017-09-25 12:36:30 -07:00
Muxi Yan 31c66c576a Merge pull request #12399 from muxi/fix-stream-compression-transport-duplicate
Fix stream compression transport duplicate
2017-09-22 14:41:41 -07:00
Craig Tiller 05d77d8b21 Merge github.com:grpc/grpc into flowctl+millis 2017-09-21 13:39:01 -07:00
Nathaniel Manista 06f5e05466 Merge pull request #12666 from nathanielmanistaatgoogle/grpc_1_0_flag
Clean up even more uses of gRPC in _pb2.py files.
2017-09-21 08:04:18 -07:00
Nathaniel Manista e232f1bd5a Clean up even more uses of gRPC in _pb2.py files 2017-09-21 05:52:25 +00:00
Craig Tiller 0d958d200e Merge github.com:grpc/grpc into grpc_millis 2017-09-20 03:32:44 +00:00
Craig Tiller dd96654721 Merge github.com:grpc/grpc into grpc_millis 2017-09-19 12:31:18 -07:00
Ken Payson 2746bd5998 Fix cython definition to match c definition
This is required to compile with Cython options that
are more strict about const correctness.
2017-09-19 12:24:40 -07:00
Muxi Yan 3f583b7829 Merge remote-tracking branch 'upstream/master' into fix-stream-compression-transport-duplicate 2017-09-19 10:12:25 -07:00
David G. Quintas 35d31c3641 Merge pull request #12622 from dgquintas/1.6.x-master-upmerge
1.6.x master upmerge
2017-09-18 20:10:24 -07:00
Nathaniel Manista 769ec3a8fa Merge pull request #12609 from nathanielmanistaatgoogle/grpc_1_0_flag
Use grpc_1_0 flag in beta_python_plugin_test.
2017-09-18 16:55:34 -07:00
Craig Tiller 50448beab3 Merge github.com:grpc/grpc into grpc_millis 2017-09-18 13:56:51 -07:00
David Garcia Quintas b352be025f Upmerge from v1.6.x branch to master 2017-09-18 11:55:52 -07:00
Nathaniel Manista 086e95ae65 Use grpc_1_0 flag in beta_python_plugin_test
Beta code elements are not generated at all in _pb2_grpc.py files.

This duplicates a lot of the in-test code generation done in
_split_definitions_test. In a future clean-up we may want to
deduplicate the common behavior, put it in a module available to all
other tests, and do all of our testing of generated code with in-test
code generation.
2017-09-18 18:01:21 +00:00
Nathaniel Manista e963820cfd Merge pull request #12615 from nathanielmanistaatgoogle/fix_with_metaclass_usage
Fix a six.with_metaclass usage mistake.
2017-09-18 09:32:28 -07:00
Nathaniel Manista 86eb4ec0ef Fix a six.with_metaclass usage mistake
I made this mistake in 2010985ab2 but
only with yesterday's release of six 1.11.0 has it started failing
("TypeError: metaclass conflict: the metaclassof a derived class must
be a (non-strict) subclass of the metaclasses of all its bases").
2017-09-18 14:22:16 +00:00
Nathaniel Manista c8cbddae0b Merge pull request #12602 from nathanielmanistaatgoogle/grpc_1_0_flag
Overhaul protoc_plugins._split_definitions_test.
2017-09-17 08:40:00 -07:00
Nathaniel Manista 719ade3cdc Overhaul protoc_plugins._split_definitions_test
We were mistaken before when we were testing _pb2.py files being
generated in one directory and _pb2_grpc.py files being generated in
another directory. Sure, that was a thing our code generator could do,
but because of the way paths and packages work in Python it wasn't a
realistic use case for actual users.

This test now tests _pb2.py files and _pb2_grpc.py files being
generated either together or independently of one another, and if
independently, in either order. Looking forward to an eventual
py_grpc_library Bazel rule, that's what actually matters.
2017-09-16 23:42:06 +00:00
Nathaniel Manista c4add66ebd Merge pull request #12603 from nathanielmanistaatgoogle/python_sanity_test
Tweak Python sanity test.
2017-09-16 14:02:28 -07:00
Nathaniel Manista 44038eb9b6 Tweak Python sanity test
- Move it out of the "unit" package, as it's not itself a unit test.

 - Suffix the test class with "Test" as we do with every other subclass
   of unittest.TestCase.

 - Add a larger-than-we'll-need-any-time-soon maxDiff so that failures
   are fully described.

 - Relax the assertion from assertListEqual to assertSequenceEqual
   since we don't actually care whether or not the sequences being
   compared are list instances.

 - Change the order of the assertions arguments to match the
   "<expected>, <actual>" convention used in our assert*Equal calls
   elsewhere throughout the test corpus.

 - Internal implementation simplifications.
2017-09-16 18:55:53 +00:00
Nathaniel Manista 6628282499 Merge pull request #12592 from nathanielmanistaatgoogle/grpc_1_0_flag
Clean up a few more uses of gRPC code elements in _pb2.py files.
2017-09-15 14:18:56 -07:00
Nathaniel Manista 8d3cc5ff0c Clean up a few more uses of gRPC in _pb2.py files
Were this not done these would break when the default behavior of gRPC
Python Protoc Plug-In is changed to be the put-gRPC-code-elements-only-
in-_pb2_grpc.py-files behavior that currently happens only when the
grpc_2_0 flag is passed.
2017-09-15 16:57:29 +00:00
Muxi Yan 3cdc6fb17e Merge remote-tracking branch 'upstream/master' into fix-stream-compression-transport-duplicate 2017-09-14 09:46:45 -07:00
Nathaniel Manista 09a02ec040 Kill (grpcio_tests/)commands.BuildProtoModules
In 1ff429da2a it appears to have been
copied out of src/python/grpcio/commands.py and not used, and it seems
to have remained without use since.
2017-09-13 20:11:30 +00:00
Craig Tiller 50e11005a1 Merge github.com:grpc/grpc into grpc_millis 2017-09-12 15:18:54 -07:00
Jan Tattermusch a5b571e22d Merge pull request #12504 from jtattermusch/bump_1_6_1
Bump version to 1.6.1
2017-09-12 22:30:35 +02:00
Jan Tattermusch ea7807876c regenerate 2017-09-12 16:56:05 +02:00
Jan Tattermusch 4fa3364975 bump version to 1.6.1 2017-09-12 12:56:45 +02:00
Nathaniel Manista c75ae78b08 Add more Cython-layer tests
I wrote these in the course of a bug hunt. I haven't yet caught and
fixed the bug, but that's no reason not to check in perfectly good
tests. :-)
2017-09-11 19:21:34 +00:00
Mark D. Roth 09fe5de45c Merge remote-tracking branch 'upstream/master' into plugin_credentials_api_fix 2017-09-11 11:27:58 -07:00
Muxi Yan adf6c8145e Merge remote-tracking branch 'upstream/master' into fix-stream-compression-transport-duplicate 2017-09-11 10:04:57 -07:00
Nathaniel Manista eda5a4db1e Fix metadata memory leak
The gRPC Core has two styles for passing metadata: as an integer count
along with a grpc_metadata* pointer, which is used for passing metadata
into the core, and as a grpc_metadata_array, which is used for passing
metadata out of the core. The Cython layer of gRPC Python was using a
single data structure wrapping grpc_metadata_array for both purposes,
but this was complex because the core manages the slices contained in
grpc_metadata_array objects (at least those of which it is aware), so
the Cython layer had to keep track of whether or not the core was aware
of the slices it was using (and it was also defective, leaking slices).

This is solved by realigning with the Cython layer’s intended design of
mirroring as closely as possible in Python the gRPC Core API: we use
one structure for passing metadata into the core (what is now called
cygrpc.Metadata) and second, different structure for receiving metadata
out of the core (what was called cygrpc.Metadata but is now
cygrpc.MetadataArray, reflecting that it wraps the core’s
grpc_metadata_array).

All bug fixes should contain added tests preventing regression but this
doesn't because I don't know at this time how to write a does-not-leak
test for Python that fits well into our existing body of tests. Phooey.

Thanks to Dominik Janků (djanku@email.cz) for investigation and an
earlier draft of a solution.
2017-09-09 21:42:38 +00:00
Craig Tiller fabb513fe4 Merge 2017-09-08 11:45:11 -07:00
Mark D. Roth 0aee498525 Merge remote-tracking branch 'upstream/master' into plugin_credentials_api_fix 2017-09-08 08:01:29 -07:00
David Garcia Quintas 1faa48ead3 Merge branch 'master' of github.com:grpc/grpc into rename_lr_to_plugin 2017-09-07 15:29:03 -07:00
Craig Tiller da8a169928 Merge github.com:grpc/grpc into grpc_millis 2017-09-07 14:47:26 -07:00
Mark D. Roth 8941f607d6 Merge pull request #12369 from markdroth/call_combiner
Second attempt at call combiner PR
2017-09-07 14:43:47 -07:00
Ken Payson 4fe48e6579 Build fixes 2017-09-07 12:27:34 -07:00
Craig Tiller 24f30f7ac0 Garbage collect experimental pollers 2017-09-07 10:16:53 -07:00
David Garcia Quintas 0822d331df s/load_reporting/server_load_reporting 2017-09-06 18:18:48 -07:00
Muxi Yan bf5484e785 build_project 2017-09-05 13:46:18 -07:00
Nathaniel Manista 21b71b41b6 Merge pull request #11583 from nathanielmanistaatgoogle/grpc_testing
gRPC Python test infrastructure.
2017-09-05 11:23:38 -07:00
Nathaniel Manista 7c85caeaa8 gRPC Python test infrastructure
(The server-related third part of it.)
2017-09-05 01:01:20 +00:00
Ken Payson d27504f09a Changes 2017-09-01 15:06:30 -07:00
Mark D. Roth 2caf021772 Change plugin credentials API to support both sync and async modes. 2017-09-01 15:04:13 -07:00
Craig Tiller ee090ec975 Merge github.com:grpc/grpc into wc 2017-09-01 10:30:11 -07:00
Mark D. Roth 764cf04a13 Revert "Revert "Implement call combiner""
This reverts commit bf19961d0a.
2017-09-01 09:00:06 -07:00
Craig Tiller ccad38227f Merge github.com:grpc/grpc into stats 2017-08-31 12:23:53 -07:00
Mark D. Roth bf19961d0a Revert "Implement call combiner" 2017-08-29 16:59:07 -07:00
Craig Tiller 03c908fc9e Merge github.com:grpc/grpc into stats 2017-08-29 12:34:10 -07:00
Craig Tiller d9b82bdecb Merge github.com:grpc/grpc into grpc_millis 2017-08-29 12:16:56 -07:00
David Garcia Quintas dfde288148 1.6.0-pre1 -> 1.6.0 2017-08-29 11:31:50 -07:00
Mark D. Roth 76e264b8df Implement call combiner. 2017-08-25 09:03:33 -07:00
David Garcia Quintas 3499960070 Renamed load_reporting.{c,h} to load_reporting_plugin.{c,h} 2017-08-24 14:09:47 -07:00
Ken Payson f5f5ed0305 Fix syntax error on classifiers 2017-08-24 11:46:03 -07:00
Mehrdad Afshari 58c61b5520 Unskip reflection unit test since proto is fixed 2017-08-22 00:58:07 +00:00