Commit Graph

3689 Commits

Author SHA1 Message Date
Lidi Zheng 231f9c0c94 Improve readability 2020-03-09 15:20:06 -07:00
Lidi Zheng ce68d53dd1 Make pytype happy 2020-03-09 15:20:06 -07:00
Lidi Zheng 57fa6ce33c Make pylint happy 2020-03-09 15:20:06 -07:00
Lidi Zheng 7b7c0ba5fc Fix the SEGFAULT caused by initialization ordering 2020-03-09 15:20:06 -07:00
Lidi Zheng 0ee33a4762 Confusing 2020-03-09 15:20:06 -07:00
Lidi Zheng 1d13ec88de Segfault while shutting down 2020-03-09 15:20:06 -07:00
Lidi Zheng 221a50bf87 Allow multiple asyncio engine 2020-03-09 15:20:06 -07:00
Lidi Zheng efd483311c Remove loggings 2020-03-09 15:20:06 -07:00
Lidi Zheng b2839c2bae Add assertion in grpc_call_soon_threadsafe 2020-03-09 15:20:06 -07:00
Lidi Zheng 464d41f4b8 Great. Everything seems working. 2020-03-09 15:20:06 -07:00
Lidi Zheng e00f8b3492 Use a poller thread to replace custom IO manager 2020-03-09 15:20:06 -07:00
Lidi Zheng d9c55675c4
Merge pull request #22234 from lidizheng/aio-iomgr-op
[Aio] Optimize some details of AsyncIO IO manager
2020-03-09 14:15:19 -07:00
Richard Belleville c0b9694e4f Fix windows 2020-03-06 16:22:51 -08:00
Lidi Zheng a05abc0939 Mark it correctly with a TODO 2020-03-06 14:12:47 -08:00
Lidi Zheng 08b028ab82 Update the comment about the expect life span of the hack 2020-03-06 13:53:12 -08:00
Lidi Zheng 0d785bf22a Resolve AttributeError from bpo-39764 2020-03-06 13:47:35 -08:00
Lidi Zheng b00fc59d29 Link the TODO issue & revert to call_later 2020-03-05 16:26:41 -08:00
Lidi Zheng 33a406e6a8 Restore 3.6 compatibility 2020-03-05 12:11:22 -08:00
Lidi Zheng f87149c967 Destroy server without gil 2020-03-05 12:11:22 -08:00
Lidi Zheng 43fe171683 Optimize some implementation of IO manager 2020-03-05 12:11:22 -08:00
Lidi Zheng 87d01bf9e5
Merge pull request #22032 from ZHmao/implement-server-interceptor-for-unary-unary-call
[Aio] Implement server interceptor for unary unary call
2020-03-05 10:26:56 -08:00
yang-g 976fff1797 Create a macro to allow custom dualstack socket 2020-03-04 16:07:35 -08:00
Zhanghui Mao 09168c534f fix type annotation 2020-03-04 23:50:08 +08:00
Richard Belleville db27226b3f Don't run under gevent 2020-03-03 16:23:25 -08:00
Richard Belleville c9d90e5c1b Use wait_for_ready in tests 2020-03-03 15:18:04 -08:00
Richard Belleville 6b42bcc03d Sanity tests make me lose my sanity 2020-03-03 14:30:28 -08:00
Richard Belleville f921f01262 Format 2020-03-03 13:50:13 -08:00
Richard Belleville b5d69d2cd1 Clean up test 2020-03-03 12:24:13 -08:00
Richard Belleville 0fe463b2d3 Don't run on Python 2 2020-03-03 11:51:29 -08:00
Richard Belleville 0fd0948bfa Generate simple stubs 2020-03-02 22:11:24 -08:00
Zhanghui Mao 701ec0be20 add type annotation 2020-02-29 19:22:49 +08:00
Mark D. Roth 19e28b1353 Refactor code for gracefully switching child LB policies. 2020-02-28 08:17:54 -08:00
Zhanghui Mao 26985fd722 fix sanity checks 2020-02-28 22:06:31 +08:00
Mark D. Roth 144adbc194
Merge pull request #22147 from markdroth/xds_overprovisioning_capability
xds: send no-overprovisioning client capability and populate user_agent fields
2020-02-27 15:02:53 -08:00
Lidi Zheng 05fa7c9255 Remove logging from qps_worker.py 2020-02-27 13:39:34 -08:00
Lidi Zheng 18a5fbeb93 Make Buildifier happy 2020-02-27 13:38:31 -08:00
Mark D. Roth 28b950e407 Merge remote-tracking branch 'upstream/master' into xds_overprovisioning_capability 2020-02-27 12:09:16 -08:00
Moiz Haidry 88096215a3 Merge with HEAD 2020-02-26 19:59:06 -08:00
Lidi Zheng d657d73565 Integrate existing gRPC Python stack benchmarks with Bazel 2020-02-26 16:56:12 -08:00
Richard Belleville 5ef379870d Regenerate projects 2020-02-26 10:39:34 -08:00
Mark D. Roth b68f813e54 xds: send envoy.lb.does_not_support_overprovisioning client capability 2020-02-26 08:23:27 -08:00
Moiz Haidry 67565b767d CallCredentials debug string API 2020-02-25 16:09:03 -08:00
Zhanghui Mao 99e26eb647 Merge branch 'implement-server-interceptor-for-unary-unary-call' of github.com:ZHmao/grpc into implement-server-interceptor-for-unary-unary-call 2020-02-22 22:38:05 +08:00
Zhanghui Mao 128d030cdc upate test 2020-02-22 22:37:31 +08:00
Richard Belleville 7adf2f5c65 Implement first pass at Python XDS interop client.
I discovered a couple of existing shortcomings while implementing this
client that mean this is *not yet ready for inclusion in CI*. I
nonetheless want to get an early review and integrate this to the master
branch, in the interest of small easily reviewable code changes.

The first problem was that the bazel build has apparently never pulled
roots.pem in as a data dependency. This appears not to have been a
problem until XDS enters into the mix. This has been added into the
Bazel build with a small change to the pyx_library rule.

The larger problem is that there is currently no public Python API to
get a peer's identity from the client side. This is crucial to
determining the correctness of an interaction of a client-server pair
under XDS. I intend to add such an method to the RpcContext interface in
an upcoming PR and use it in the interop client. For the moment, I
simply fake the peer details.

Finally, I add a knob to run_xds_tests.py allowing multiple instances of
this test to exist at once. Multiple instances forwarding to the same
port cannot exist on GCE, so this enables multiple people to run tests
at the same time.
2020-02-21 23:28:19 +00:00
apolcyn 17036c1452
Merge pull request #21698 from apolcyn/bump_g_stands_for
Bump g stands for
2020-02-21 10:53:47 -08:00
Zhanghui Mao 958fb08d0d
Merge branch 'master' into implement-server-interceptor-for-unary-unary-call 2020-02-21 22:43:51 +08:00
Esun Kim 5f41758a76 Replaced gpr_asprintf with absl::StrFormat 2020-02-20 13:44:35 -08:00
Lidi Zheng 2eeb22de65
Merge pull request #21904 from lidizheng/aio-benchmark-client
[Aio] Benchmark automation
2020-02-20 10:15:01 -08:00
Lidi Zheng bbcaca2d83 Add uvloop argument 2020-02-19 13:09:46 -08:00
Lidi Zheng 8aff9ec592
Merge pull request #21987 from lidizheng/aio-doc
[Aio] Generate gRPC AsyncIO API Reference
2020-02-19 10:52:38 -08:00
Lidi Zheng c0e1dbc445 Update method naming & use os.path.join 2020-02-18 18:04:17 -08:00
Richard Belleville 3ed237d4bb
Merge pull request #21954 from gnossen/simple_stubs
Experimental: Implement Top-Level Invocation Functions Not Requiring an Explicit Channel
2020-02-18 16:32:01 -08:00
Lidi Zheng dbdb2cc5c9 Fix the non-protobuf scenario 2020-02-18 16:28:19 -08:00
Lidi Zheng c22b161d4e Improve benchmark automations:
1. Use monotonic time;
2. Improve readabilities;
3. Add two more fields for number of processes.
2020-02-18 16:28:18 -08:00
Lidi Zheng 728f5881a2 Remove unused exception check condition 2020-02-18 16:28:18 -08:00
Lidi Zheng 37552d3e62 Restrucutre exception catches 2020-02-18 16:28:18 -08:00
Lidi Zheng 5a7093639f Suppress server stop log spamming 2020-02-18 16:27:55 -08:00
Lidi Zheng f89448a9d5 Adding more comments 2020-02-18 16:27:29 -08:00
Lidi Zheng 72514e9bf4 Adding more comments & fix the outstanding channel count 2020-02-18 16:27:29 -08:00
Lidi Zheng 4819d8ba6e Improve scenario configs & plumb through channel arguments 2020-02-18 16:27:29 -08:00
Lidi Zheng 68be8a7742 Improve log readability & polish scenario parameters 2020-02-18 16:27:29 -08:00
Lidi Zheng 03e1bf1071 Fix already cancelled RPC 2020-02-18 16:27:29 -08:00
Lidi Zheng efe29d6945 Use the correct asyncio API 2020-02-18 16:27:29 -08:00
Lidi Zheng f97ad240da Remove pdb trace point 2020-02-18 16:27:29 -08:00
Lidi Zheng 50840080fb Make YAPF happy 2020-02-18 16:27:29 -08:00
Lidi Zheng a345803331 Fix the channel_ready usage 2020-02-18 16:27:29 -08:00
Lidi Zheng 7cb055b035 Make server parallel-able 2020-02-18 16:27:29 -08:00
Lidi Zheng 94525e5831 Parallelize sub worker creation 2020-02-18 16:27:29 -08:00
Lidi Zheng 8a70e757fa Re-enable all scenarios 2020-02-18 16:27:29 -08:00
Lidi Zheng ef853425cc Use picked port instead of assigned port 2020-02-18 16:27:29 -08:00
Lidi Zheng 5e2114d92f Fix the sub worker 2020-02-18 16:27:29 -08:00
Lidi Zheng 2d81bd203f Introduce sub workers 2020-02-18 16:27:28 -08:00
Lidi Zheng 7cdef95c4f Make buildifier happy 2020-02-18 16:26:41 -08:00
Lidi Zheng 6f343fc758 Make sanity tests happy 2020-02-18 16:26:41 -08:00
Lidi Zheng 49980a6db1 Make benchmark worker work 2020-02-18 16:26:41 -08:00
Lidi Zheng 2916c351d5 Use bytes instead of str 2020-02-18 16:26:41 -08:00
Lidi Zheng c2a9f15079 One more fix for the benchmark_client.py 2020-02-18 16:26:41 -08:00
Lidi Zheng ae44213482 Fix typos in worker_servicer.py 2020-02-18 16:26:41 -08:00
Lidi Zheng afb080787e Clean up self references 2020-02-18 16:26:41 -08:00
Lidi Zheng 1ee45615e2 Add benchmark client, server, and worker 2020-02-18 16:26:41 -08:00
Lidi Zheng c65bad469b
Merge pull request #22026 from lidizheng/defects-test
Improve invocation_defects_tests with assertions and comments
2020-02-18 16:25:33 -08:00
Lidi Zheng 4c14e507cb
Merge pull request #22028 from lidizheng/aio-health-checking-2
[Aio] Implement health checking servicer in AsyncIO
2020-02-18 16:18:58 -08:00
Lidi Zheng 2294b847a2 Add OVERALL_HEALTH 2020-02-18 14:30:10 -08:00
Lidi Zheng b62eca8558 Update the wording in comments 2020-02-18 13:58:29 -08:00
Lidi Zheng 4c602d4ad6 Add type annotations 2020-02-18 12:45:00 -08:00
Lidi Zheng 7917bd3074 Fix a typo 2020-02-18 12:26:39 -08:00
Lidi Zheng 750b602118 Filter out duplicated status 2020-02-18 12:25:11 -08:00
Lidi Zheng a729bd1828 Revert "Report every health state change"
This reverts commit b2d8509f78.
2020-02-18 11:42:59 -08:00
Lidi Zheng b2d8509f78 Report every health state change 2020-02-18 11:23:23 -08:00
Lidi Zheng fe4eba490c Further simplify the loop 2020-02-18 10:39:06 -08:00
Lidi Zheng 545f312050 Simplify the logic and improve readability 2020-02-18 10:36:56 -08:00
Zhanghui Mao 6fef56573e Implement server interceptor for unary unary call 2020-02-15 23:39:34 +08:00
Mehrdad Afshari 9a929c1546 Do not validate details when status code is OK 2020-02-14 21:25:47 -08:00
Lidi Zheng 5622e9e78c Make sanity tests happy 2020-02-14 12:56:14 -08:00
Lidi Zheng 37055f923f Make pylint happy 2020-02-14 12:44:19 -08:00
Lidi Zheng 908a8489f0 Make the version check more strict 2020-02-14 12:30:24 -08:00
Lidi Zheng 43788ac44e Update the copyright 2020-02-14 12:29:26 -08:00
Lidi Zheng 7b4d0b28c6 Implement health checking servicer in AsyncIO 2020-02-14 12:27:42 -08:00
Lidi Zheng e6278b5333 Make the test intent more obvious 2020-02-14 12:08:53 -08:00
Lidi Zheng 909ce6fee2 Point out it is testing client-side behavior 2020-02-14 11:19:35 -08:00
Lidi Zheng 12b0ddbc2b Improve the documentation based on suggestions 2020-02-14 11:03:27 -08:00
Lidi Zheng 479651e4cf Remove NoReturn to support <3.6.2 2020-02-14 11:03:27 -08:00
Lidi Zheng 0c7bf6c434 Make sanity tests happy 2020-02-14 11:03:27 -08:00
Lidi Zheng 1945c1108f Move the docstring from Cython to rst 2020-02-14 11:03:10 -08:00
Lidi Zheng d743e4390a Fill-in missing interfaces & improve rst template 2020-02-14 11:03:10 -08:00
Lidi Zheng f17ec928df Fix lack of empty line in the docstring 2020-02-14 11:01:48 -08:00
Lidi Zheng 4c59615f46 Format __init__.py 2020-02-14 11:01:48 -08:00
Lidi Zheng 3cdd83bdac Improve invocation_defects_tests with assertions and comments 2020-02-14 10:56:40 -08:00
Lidi Zheng 11953d1315
Merge pull request #21988 from lidizheng/aio-fast-close-2
[Aio] Make client-side graceful shutdown faster
2020-02-14 10:36:49 -08:00
Richard Belleville c01b39e55b Pull Python 3 only tests out to a separate repo 2020-02-13 16:06:32 -08:00
Lidi Zheng 7a50172cc8 Handle the intercepted call case 2020-02-13 16:00:54 -08:00
Lidi Zheng e0f8fe3254 Ensure channel isolation is maintained while graceful close 2020-02-13 15:05:50 -08:00
Jan Tattermusch a28d67f0bf
Merge pull request #21891 from jtattermusch/remove_useless_release_links
get rid of the https://grpc.io/release plague
2020-02-13 17:43:41 +01:00
Lidi Zheng 5a29f33a25 Optimize the logic & add comments 2020-02-12 14:32:17 -08:00
Richard Belleville a859b9a98a Whoops 2020-02-12 10:46:59 -08:00
Lidi Zheng 2789f83f85 Make pytype happy 2020-02-12 10:46:56 -08:00
Lidi Zheng d2832e4bc6 Update tests.json 2020-02-12 10:44:15 -08:00
Richard Belleville e99cdfa754 Copybara makes me wish I were dead 2020-02-11 18:13:13 -08:00
Richard Belleville d46cd97bc6 Merge remote-tracking branch 'origin/master' into simple_stubs 2020-02-11 17:53:56 -08:00
Richard Belleville 6eddf397e9 Reviewer advice 2020-02-11 17:44:56 -08:00
Richard Belleville 485e87cadf Move tests into single directory because Blaze is the worst 2020-02-11 17:41:09 -08:00
Lidi Zheng 3061ee37c0 Remove unused import 2020-02-11 16:46:48 -08:00
Lidi Zheng fbd213d04b Make client-side graceful shutdown faster 2020-02-11 16:46:23 -08:00
Esun Kim 0b26a2ff56 Added abseil-based sync 2020-02-11 14:44:25 -08:00
Richard Belleville df247fb33a Experimental API decorator 2020-02-10 16:47:43 -08:00
Richard Belleville 7c581ab099 Revert "Stop emitting experimental warnings"
This reverts commit 3daa32de4e.
2020-02-10 14:57:30 -08:00
Richard Belleville ff3088979a Why you incomplete, Python 3.6? 2020-02-10 14:53:33 -08:00
Richard Belleville 67a492c946 Yapf 2020-02-10 13:47:25 -08:00
Richard Belleville 753ab16ebb Remove unused return value 2020-02-10 13:43:22 -08:00
Richard Belleville 5474a76044 Pull out constant 2020-02-10 13:41:22 -08:00
Richard Belleville 0668c73cd2 Add copyright header 2020-02-10 13:40:21 -08:00
Richard Belleville 3daa32de4e Stop emitting experimental warnings 2020-02-10 13:39:43 -08:00
Richard Belleville e7e41e7610 Change up ordering 2020-02-10 13:37:43 -08:00
Richard Belleville 6e7f9f2ebe Add typing 2020-02-10 13:34:10 -08:00
Richard Belleville 70d3765712 Use debug level logging 2020-02-10 13:19:08 -08:00
Richard Belleville 09774aebfb Put libraries in order of reference 2020-02-10 13:18:18 -08:00
Richard Belleville 70837b3351 Don't attempt to run under setuptools 2020-02-10 12:44:08 -08:00
Richard Belleville 270880f440 Yapf 2020-02-10 11:56:38 -08:00
Lidi Zheng dc0509186c
Merge pull request #21921 from lidizheng/aio-fix-close-2
[Aio] Another fix for close mechanism on Windows
2020-02-10 11:46:59 -08:00
Richard Belleville 94efe57fb0 Buildifier 2020-02-10 11:37:55 -08:00
Richard Belleville 78c9ce56e5 Remove unguarded import of simple_stubs 2020-02-10 11:36:33 -08:00
Mark D. Roth bc9cc67fa6
Merge pull request #21857 from markdroth/json_old_api_remove
Remove old JSON API
2020-02-10 07:30:52 -08:00
Richard Belleville 36aa768290 Correct tests.json 2020-02-07 18:03:26 -08:00
Richard Belleville e5b287ead8 Yapf. Pylint 2020-02-07 16:51:25 -08:00
Richard Belleville ac864c7502 Make APIs experimental 2020-02-07 16:42:38 -08:00
Richard Belleville 84c8dc739e Add insecure_channel_credentials function 2020-02-07 15:59:24 -08:00
Richard Belleville a2e4a23fc0
Merge pull request #20783 from Yannic/proto_incompat
[bazel] Add fixes for --incompatible_load_proto_rules_from_bzl
2020-02-07 15:46:38 -08:00
Lidi Zheng 8701b18efb Use str instead of Text 2020-02-07 10:40:26 -08:00
Richard Belleville aadcded305 Add docstrings 2020-02-06 16:56:01 -08:00
Richard Belleville 1abe2f0ac2 Add stream_stream 2020-02-06 16:37:39 -08:00
Richard Belleville 38bef98463 Add stream-unary 2020-02-06 16:27:21 -08:00
Richard Belleville b5f06c216e Implement unary_stream 2020-02-06 16:10:25 -08:00
Richard Belleville 4ac50ceed6 Add maximum-based channel eviction 2020-02-06 15:59:01 -08:00
Lidi Zheng 5cf41f3424 Revert the changes in _channel.py 2020-02-06 15:31:30 -08:00
Lidi Zheng 33014035eb Skip the test_invalid_metadata on Windows for now 2020-02-06 15:26:52 -08:00
Lidi Zheng c7095d6854 Make a proper shallow copy of onging calls set 2020-02-06 14:40:32 -08:00
Lidi Zheng 15ff162fe3 Improve the documentation about newly added exception classes 2020-02-06 14:21:43 -08:00
Lidi Zheng 22cd31b0ec Remove TODO 2020-02-06 14:21:42 -08:00
Lidi Zheng ecf44b094b Prohibit mixing two styles of API on client side 2020-02-06 14:21:42 -08:00
Richard Belleville 20f85c1d60 Don't run test under Python 2 2020-02-06 14:12:38 -08:00
Lidi Zheng 072c150e77
Merge pull request #21885 from lidizheng/aio-channel-ready
[Aio] Add channel_ready helper function
2020-02-06 12:35:37 -08:00
Lidi Zheng 231d4b22a1
Merge pull request #21919 from Skyscanner/set-error-description
[Aio] Set debug_error_string to AioRpcError
2020-02-06 12:01:01 -08:00
Lidi Zheng be85024b34
Merge pull request #21809 from lidizheng/aio-compression
[Aio] Support compression for both client and server
2020-02-06 10:04:42 -08:00
Mariano Anaya 1df63bf35b Get the debug_error_string in a simpler fashion
* Use the public method in ``AioRpcStatus``
* Keep everything encapsulated inside the function that creates the
error.
2020-02-06 09:19:16 +01:00
Lidi Zheng 473a75b47e Reduce side effect of a "create" method 2020-02-05 15:02:21 -08:00
Yannic Bonenberger 06ecc87290 [bazel] Add fixes for --incompatible_load_proto_rules_from_bzl 2020-02-05 19:58:30 +01:00
Mariano Anaya 583712704a [Aio] Set debug_error_string to AioRpcError
When handling errors in aio, also set the ``debug_error_string``, to get
more information (when available), about the exception, and help debug.
2020-02-05 16:49:08 +01:00
Richard Belleville 741b407ac4 Add simple eviction mechanism 2020-02-04 18:34:55 -08:00
Mark D. Roth 01e87e2d93 Remove old JSON API 2020-02-04 15:21:27 -08:00
Lidi Zheng c564d28f9a
Merge pull request #21903 from lidizheng/aio-fix-close
[Aio] Attempt to fix recent AsyncIO windows flake
2020-02-04 14:57:47 -08:00
Yash Tibrewal c3bcb6c7ce
Merge pull request #21846 from yashykt/workserializer
Replace LogicalThread with WorkSerializer
2020-02-04 14:23:28 -08:00
Richard Belleville 5a8a6e3ad3 Add thread-safe channel cache. Test that it actually caches 2020-02-04 12:34:34 -08:00
Lidi Zheng b378b66f8c [Aio] Attempt to fix recent AsyncIO windows flake 2020-02-04 11:03:03 -08:00
Lidi Zheng daeaf8eff4 Promote the channel_ready & simplify test logic 2020-02-04 10:26:57 -08:00
Lidi Zheng 0919f939b4 Improve compression docstring & simplify metadata default value 2020-02-04 10:10:46 -08:00
Jan Tattermusch 21512217f2 get rid of the https://grpc.io/release plague 2020-02-04 15:01:03 +01:00
Richard Belleville 0c4af58acc Add test and fake LRU cache interface 2020-02-03 18:30:00 -08:00
Lidi Zheng a5503cc64a Add unit test for channel ready 2020-02-03 16:46:48 -08:00
Lidi Zheng 6a330edf74 Add channel_ready helper function 2020-02-03 16:44:19 -08:00
Lidi Zheng d190a0e08c Make YAPF happy 2020-02-03 15:59:51 -08:00
Lidi Zheng eb1f21f651 Improve readability of unit tests & add one more test case 2020-02-03 15:57:22 -08:00
Lidi Zheng cd76b79e7f Support compression for both client and server 2020-02-03 15:57:22 -08:00
Lidi Zheng ffb41a2368
Merge pull request #21819 from Skyscanner/close_ongoing_calls
[Aio] Close ongoing calls when the channel is closed
2020-02-03 14:55:16 -08:00
Lidi Zheng f20bf08d17
Merge pull request #21855 from lidizheng/aio-auto-creds
[Aio] Fix the server credentials & improve socket implementation
2020-02-03 13:51:21 -08:00
Pau Freixes 5cd4e133bf Increase timeout in some tests 2020-02-03 21:52:02 +01:00
Pau Freixes 84d2a70741 Merge branch 'master' into close_ongoing_calls 2020-02-03 17:13:01 +01:00
Pau Freixes 2d89ef0acd Fix pylint issue 2020-02-03 17:07:20 +01:00
Pau Freixes 3a8be1784c make YAPF happy 2020-02-03 17:06:05 +01:00
Pau Freixes c94364f311 Use a weakset for storing ongoing calls 2020-02-03 17:04:54 +01:00
Pau Freixes 2cef2fce39 Use set as data structure for trace ongoing calls 2020-02-03 15:52:26 +01:00
Pau Freixes d0b218ae18 Once cancelled just destroy the channel 2020-02-03 15:29:41 +01:00
Mehrdad Afshari faf406d65b
Merge pull request #21865 from mehrdada/genericize-rpc_test
Check .code() before .cancelled() in Python RPC tests
2020-01-31 18:57:56 -08:00
Lidi Zheng 69c63cb33a
Merge pull request #21770 from lidizheng/aio-timeout
[Aio] Add tests for timeout mechanism on the client-side
2020-01-31 15:21:58 -08:00
Mehrdad Afshari 9bdd529077 Check .code() before .cancelled() in Python RPC tests
Call object's `.cancelled()` is not guaranteed to immediately return
True per spec even if `cancel()` is called. `.code()` ensures that
the RPC is terminated before we check for `.cancelled()` to ensure
our test is not stricter than necessary (a conforming implementation
should be allowed to return `False` on `cancelled()` for a bit due
to a race or something.  This change makes the test more generically
applicable to other implementations.
2020-01-31 15:20:54 -08:00
Lidi Zheng 892fdf85d6 Add SecureLocalInteropTest to tests.json 2020-01-31 15:17:52 -08:00
Lidi Zheng 47246c86bb Fix the server credentials & improve socket implementation 2020-01-31 15:17:52 -08:00
Lidi Zheng 343e77ab9e
Merge pull request #21714 from lidizheng/aio-auto
[Aio] Introduce gRPC Async into our interop combo
2020-01-31 15:15:51 -08:00
Lidi Zheng fb849fbda7
Merge pull request #21863 from lidizheng/flake-channel-argument
[Aio] Deflake the channel_argument_test & improve socket error handling
2020-01-31 14:16:04 -08:00
Lidi Zheng 788d14cb1f Enable more local interop test cases and other fixes:
* Support echo status and metadata for interop test server
* Add set_code and set_details for ServicerContext
* Add an is_ok() method on cygrpc._AioCall object
* Sanitize user supplied status code
* Prettify server-side unexpected exception log
* Reduce log spams from unary calls
2020-01-31 13:19:09 -08:00
Lidi Zheng 9b26b410fb Support echo status for interop test server 2020-01-31 13:19:09 -08:00
Lidi Zheng 4842e23e9c Make YAPF happy 2020-01-31 13:19:09 -08:00
Lidi Zheng 3e2d5da7a2 Use as much template as possible & fix some wording 2020-01-31 13:19:09 -08:00
Lidi Zheng acbc36b281 Remove the unused constant 2020-01-31 13:19:09 -08:00
Lidi Zheng 20a6edfe6e Restrict visibility & improve readability 2020-01-31 13:19:09 -08:00
Lidi Zheng dc202bdf1f Adding gRPC Python AsyncIO interop client and server 2020-01-31 13:19:09 -08:00
Lidi Zheng b62bc90cec Update tests.json 2020-01-31 13:16:10 -08:00
Lidi Zheng f3acd16a49 The initialization of connection might take longer than expected 2020-01-31 13:16:10 -08:00
Lidi Zheng f713be4f96 Fix the json 2020-01-31 13:16:10 -08:00
Lidi Zheng ece8422dd0 Simplify the generic handler 2020-01-31 13:16:10 -08:00
Lidi Zheng c3caab3b3e Make Python sanity test happy 2020-01-31 13:16:10 -08:00
Lidi Zheng fd8cf4ec07 Use f-string 2020-01-31 13:16:10 -08:00
Lidi Zheng 2750fa31bb Remove the evil debug line 2020-01-31 13:16:10 -08:00
Lidi Zheng 48a8072bc9 Add timeout tests 2020-01-31 13:16:10 -08:00
Lidi Zheng 41bc9b9910
Merge pull request #21803 from lidizheng/aio-wait
[Aio] Support wait-for-ready mechanism
2020-01-31 13:15:10 -08:00
Lidi Zheng 387c2c7d61 Further reduce the server number to 5 2020-01-31 13:09:26 -08:00
Lidi Zheng c926941447 Deflake the channel_argument_test & improve socket error handling 2020-01-31 12:54:14 -08:00
Lidi Zheng 27a7ec6b0d Make YAPF happy 2020-01-31 11:25:51 -08:00
Lidi Zheng 0de9a7b231 Fix typo 2020-01-31 10:42:51 -08:00
Jan Tattermusch b8aa71ded7
Merge pull request #21833 from jtattermusch/reintroduce_again_21527
Reintroduce #21527 (boringssl submodule unification - take two)
2020-01-31 16:57:22 +01:00
Yash Tibrewal 74309886bb Replace LogicalThread with WorkSerializer 2020-01-30 13:20:57 -08:00
Lidi Zheng a63f51b1ad Remove assertions & add a comment 2020-01-29 15:50:21 -08:00
Lidi Zheng 1b92dc0a7e Fix the windows failure 2020-01-29 15:41:59 -08:00
Lidi Zheng 4e4f1f40f1 Correct the tests.json 2020-01-29 15:41:59 -08:00
Lidi Zheng 82b185b268 Make sanity tests happy 2020-01-29 15:41:59 -08:00
Lidi Zheng 72d6642226 Support wait-for-ready mechanism
* Fixing a segfault & a deadlock along the way
* Patching another loophole in the error path
2020-01-29 15:41:59 -08:00
Pau Freixes 46804d8125 Add test for stream unary close channel, remove irrelevant code 2020-01-30 00:00:18 +01:00
Pau Freixes 2f81f3df82 Fix typo 2020-01-29 23:53:14 +01:00
Mark D. Roth 380eb750ec New JSON API 2020-01-29 14:52:19 -08:00
Pau Freixes a1eb58c6ff Fix pytype issue 2020-01-29 23:52:01 +01:00
Pau Freixes cc8bd8cfda Use Event for knowing if a callback was called or not 2020-01-29 23:23:51 +01:00
Pau Freixes 61177a2cd8 Make none graceful test explicit 2020-01-29 23:15:51 +01:00
Pau Freixes 5959b685e8 Remove unused imports, add pylint exceptions 2020-01-29 23:13:06 +01:00
Pau Freixes 90331211a6 Add graceful period for closing the channel
Separated the tests for testing how a channel is closed into another
test file.

Fixed a bug introduced into the interceptors code in the previous
commit.
2020-01-29 23:07:26 +01:00
Lidi Zheng deb472fa99
Merge pull request #21820 from lidizheng/fix-windows-compile
Fix the windows build failure
2020-01-29 09:54:15 -08:00
Jan Tattermusch f098606c4a Revert "Revert "Reintroduce #21527 (boringssl submodule unification)""
This reverts commit cca892022b.
2020-01-29 09:18:51 -05:00
Lidi Zheng e5ff58ed85 Make YAPF happy 2020-01-28 15:43:13 -08:00
Lidi Zheng 50ed111cde Pack the platform check into the compiler check function 2020-01-28 15:41:29 -08:00
Pau Freixes c2b3e00068 [Aio] Close ongoing calls when the channel is closed
When the channel is closed, either by calling explicitly the `close()`
method or by leaving an asyncrhonous channel context all ongoing RPCs will be
cancelled.
2020-01-28 23:16:58 +01:00
Lidi Zheng 09d121f65e Fix the windows build failure 2020-01-28 13:32:59 -08:00
hcaseyal cca892022b
Revert "Reintroduce #21527 (boringssl submodule unification)" 2020-01-27 13:46:10 -08:00
Richard Belleville cb125e969a
Merge pull request #21799 from benjaminp/credentials-daemon
Make credentials callback threads daemonic.
2020-01-27 12:57:46 -08:00
Lidi Zheng 2dcd83d68b
Merge pull request #21772 from lidizheng/aio-call-mixins-new
Adding mixin classes to make client-side implementation cleaner V2
2020-01-27 12:20:58 -08:00
Benjamin Peterson fb8b7fbcac Make credentials callback threads daemonic.
Similarly to #21786, we want to avoid holding up interpreter shutdown with internal threads.
2020-01-27 11:06:55 -08:00
Richard Belleville 8af2097a45
Merge pull request #21786 from benjaminp/deliver-daemon
Mark the delivery thread daemonic.
2020-01-27 10:54:40 -08:00
Lidi Zheng f8ec53ea42 Removing unused variables & rename variables 2020-01-27 10:04:08 -08:00
Jan Tattermusch e7e5d0198f Revert "Revert "Unify boringssl submodules and use non-developer boringssl cmake build""
This reverts commit fe2242e603.
2020-01-27 05:04:05 -05:00
Mark D. Roth ac7c1d20ed Add LDS/RDS into XdsClient 2020-01-24 08:05:02 -08:00
Benjamin Peterson 4ab5aaf142 Mark the delivery thread daemonic. 2020-01-23 16:33:47 -08:00
Lidi Zheng 0c142306be De-duplication for the call objects 2020-01-23 10:12:20 -08:00
Lidi Zheng 5109e05d06
Merge pull request #21708 from lidizheng/aio-fix
[Aio] Fixing a segfault in the shutdown path
2020-01-21 15:27:46 -08:00
Lidi Zheng c4c318dc54
Merge pull request #21696 from Skyscanner/move_status_initial_metadata_cython
Move status and initial metadata handling to Cython
2020-01-21 13:48:40 -08:00
Lidi Zheng 2ea49dbf9a Adding a space line 2020-01-21 11:37:41 -08:00
Lidi Zheng 29d42a4731
Merge pull request #21672 from lidizheng/one-logger
Clean-up loggers and imports in Cython
2020-01-21 11:29:40 -08:00
Lidi Zheng d803bc8e4e
Merge pull request #21712 from lidizheng/fix-import
[Aio] Fix a segfault in check connectivity state
2020-01-21 11:09:26 -08:00
Jan Tattermusch e886a9d0fd
Merge pull request #21723 from grpc/revert-21527-unify_boringssl_deps2
Revert "Unify boringssl submodules and use non-developer boringssl cmake build"
2020-01-21 19:23:18 +01:00
Pau Freixes 2dde566d39 Fix pylint issue 2020-01-21 15:19:33 +01:00
Pau Freixes 071da37fb9 Remove unused call attributes 2020-01-20 23:44:43 +01:00
Pau Freixes 90b04f2a45 Make YAPF happy 2020-01-20 23:37:29 +01:00
Pau Freixes 53c41de3e0 Refactorize Cython and Python call communications
Now the status and the initial metadata, as awaitable methods, are
provided by the Cython layer. Any time the Python layer, like the Call
object, needs to know the status of the initial metadata uses the new
methods published by the AioCall
2020-01-20 23:09:46 +01:00
Jan Tattermusch fe2242e603
Revert "Unify boringssl submodules and use non-developer boringssl cmake build" 2020-01-20 14:27:31 +01:00
Jan Tattermusch 3f3cf8b62a
Revert "grpclb stabilization" 2020-01-20 14:11:16 +01:00
Jan Tattermusch eba60d8dbe
Merge pull request #21527 from jtattermusch/unify_boringssl_deps2
Unify boringssl submodules and use non-developer boringssl cmake build
2020-01-20 07:52:42 +01:00
Lidi Zheng 225d37e84c Fix a segfault in check connectivity state 2020-01-17 17:14:30 -08:00
Lidi Zheng 80d7acff7c Fixing a segfault in the server shutdown path 2020-01-17 16:09:39 -08:00
Alexander Polcyn 1197454f5a Regenerate projects 2020-01-17 15:36:25 -08:00
Lidi Zheng b9083a9edb
Merge pull request #21681 from lidizheng/aio-callbacks
[Aio] Implement add_done_callback and time_remaining
2020-01-17 10:41:26 -08:00
apolcyn 232fa12972
Merge pull request #21590 from jtattermusch/protobuf_3_11_2
Update third_party/protobuf to v3.11.2
2020-01-16 14:15:12 -08:00
Lidi Zheng c1eab2e95f Remove the suppression 2020-01-16 12:15:12 -08:00
Lidi Zheng 0fc1d212aa Make sanity tests happy 2020-01-16 12:13:36 -08:00
Lidi Zheng 780bff32eb Fix the test case 2020-01-16 12:06:08 -08:00
Lidi Zheng 21670ed1a8 Add time remaining test case 2020-01-16 11:59:36 -08:00
Jan Tattermusch 325da0066d regenerate projects 2020-01-16 03:55:18 -05:00
Lidi Zheng 1c78ccd44e Implement add_done_callbacks and time_remaining 2020-01-15 18:07:45 -08:00
Lidi Zheng adab340647 Simplify call_test using mixin class 2020-01-15 18:07:27 -08:00
Lidi Zheng 6f6b0d09bd
Merge pull request #21643 from lidizheng/aio-reuseport
[Aio] Support SO_REUSEPORT channel option
2020-01-15 16:28:31 -08:00
Lidi Zheng af67aaf031
Merge pull request #21647 from lidizheng/aio-metadata
[Aio] Support metadata for unary calls
2020-01-15 16:27:00 -08:00
Esun Kim d4f191b647
Merge pull request #21677 from veblush/absl-update
Update absl to the lastest
2020-01-15 15:23:54 -08:00
Lidi Zheng 613f64f12e Support metadata for streaming RPCs 2020-01-15 14:18:09 -08:00
Esun Kim 9e15f78cf8 Update absl to the lastest 2020-01-15 13:39:51 -08:00
Lidi Zheng f912ddf7d4 Split the seen_metadata function & assign tuple() as default value 2020-01-15 12:11:54 -08:00
Lidi Zheng 181437bbd8 Add prepend_send_initial_metadata_op function 2020-01-15 11:50:51 -08:00
Lidi Zheng c6a97f125a Fix the breakage due to conflict 2020-01-15 11:30:58 -08:00
Lidi Zheng 435cf89108 Fix a bug that prevents metadata modification in interceptors 2020-01-15 11:28:27 -08:00
Lidi Zheng a3e950adbb Make tests.json happy 2020-01-15 11:28:27 -08:00
Lidi Zheng fb2b4ec82b Add two more invalid metadata test cases 2020-01-15 11:28:27 -08:00
Lidi Zheng ec2f394803 Resolve the conflict between PRs 2020-01-15 11:28:27 -08:00
Lidi Zheng a140a362ba Make sanity tests happy 2020-01-15 11:27:18 -08:00
Lidi Zheng bcf3a1f9e7 Add metadata test 2020-01-15 11:26:44 -08:00
Lidi Zheng f9397de161 Make test pass after the merge 2020-01-15 11:26:44 -08:00
Zhanghui Mao 6d556914d0 fix metadata 2020-01-15 11:26:19 -08:00
Zhanghui Mao 0b802e0404 implement metadata for aio unary call 2020-01-15 11:24:44 -08:00
Lidi Zheng 5a4a5a0088
Merge pull request #21517 from lidizheng/aio-streaming
[Aio] Client Streaming and Bi-di Streaming
2020-01-15 11:20:41 -08:00
Lidi Zheng cdade7c450 Clean-up loggers and imports in Cython 2020-01-15 11:04:58 -08:00
Jan Tattermusch 27cdec0041 buildifier format 2020-01-15 04:43:59 -05:00
Richard Belleville 69f990673f Conform to protobuf's usage of six 2020-01-15 04:43:59 -05:00
Lidi Zheng 4ec94d2d67 Implement stream-unary and stream-stream RPC
* Includes both client-side and server-side
* Adding many tests in multiple files
* Introduces EOF as stream terminator
* Fixing crashes from Core in many ways
2020-01-14 17:31:13 -08:00
Lidi Zheng 9c66db3d26 Disable the flaky _exit_test for Bazel 2020-01-14 16:47:55 -08:00
Lidi Zheng 385cd4b443
Merge pull request #21582 from lidizheng/aio-abort
[Aio] Abort mechanism for server side
2020-01-14 13:48:23 -08:00
Lidi Zheng 259be9e6b7 Compress the catch clauses 2020-01-14 12:12:07 -08:00
Lidi Zheng 1dc2679d6d Explicitly pointout KeyboardInterrupt and SystemExit can pass freely 2020-01-14 12:12:07 -08:00
Lidi Zheng 65ba1c9aab Remove unused function 2020-01-14 12:12:07 -08:00
Lidi Zheng 9bba7b7af5 Improve readability 2020-01-14 12:12:07 -08:00
Lidi Zheng 26367cecc2 Expose the AbortError to enable users to identify the exception 2020-01-14 12:12:07 -08:00
Lidi Zheng b721c6c096 Add abort test to tests.json 2020-01-14 12:04:17 -08:00
Lidi Zheng 8429fec1b5 Make pytype happy 2020-01-14 12:04:17 -08:00
Lidi Zheng cddd0a0419 Implement abort mechanism for server side 2020-01-14 12:04:17 -08:00
Lidi Zheng 2306e26130 Adding comments about socket options portability 2020-01-14 11:52:53 -08:00
Lidi Zheng 85c8ce2f2f Fix a bug in conflict resolution 2020-01-14 11:50:52 -08:00
Lidi Zheng 4a86bb16f5 Adding documentation to the new ref-count mechanism 2020-01-14 10:55:53 -08:00
Lidi Zheng 7520925814 Further simplify the ref-count management for CallbackWrapper 2020-01-14 10:55:53 -08:00
Lidi Zheng 3099856a6a Adopt reviews' suggestions:
* Created a separate file for test constants
* Guarded current behavior of watch_connectivity_state
* Applied the same SEGV protection to callback_common
2020-01-14 10:55:53 -08:00
Lidi Zheng 050b3989f0 Make pytype happy 2020-01-14 10:55:52 -08:00
Lidi Zheng 0afc05cef5 Fixing the docstring wording 2020-01-14 10:55:52 -08:00
Lidi Zheng f75ce34da7 Removing an empty line 2020-01-14 10:55:52 -08:00
Lidi Zheng 650ba93a61 Improve the surface API & rewrite the test 2020-01-14 10:55:52 -08:00
Lidi Zheng fa62339430 Make Sanity test happy 2020-01-14 10:55:26 -08:00
Lidi Zheng 5f0a70973e Implement connectivity state related APIs 2020-01-14 10:55:26 -08:00
Pau Freixes 8f51eb62d5 Make YAPF happy 2020-01-14 16:46:01 +01:00
Pau Freixes 299a9b38ae Skip time out test for windows environments 2020-01-14 16:21:33 +01:00
Mariano Anaya 35b7da75f1 Accept credentials in async unary_unary call
Create the asynchronous version of a secure channel, that accepts the
credentials.

    from grpc.experimental.aio import secure_channel
    channel = secure_channel(...)

Co-authored-by: Pau Freixes <pau.freixes@skyscanner.net>
2020-01-14 15:12:10 +01:00
Lidi Zheng bcd57dfb7d Support Windows 2020-01-13 13:41:53 -08:00
Lidi Zheng 6a70555290 Plumb through socket options from application to iomgr 2020-01-13 13:29:02 -08:00
Lidi Zheng b74476417d Make the socket creation function 2/3 agnostic 2020-01-13 11:47:59 -08:00
Lidi Zheng e479a78b7c Apply REUSEADDR and REUSEPORT at the same time 2020-01-13 11:38:30 -08:00
Lidi Zheng db5bd23e36 Remove the errno.ENOSR form unrecoverable error list 2020-01-13 11:38:30 -08:00
Lidi Zheng 055b3a7e6f Simply the check 2020-01-13 11:38:30 -08:00
Lidi Zheng ebd2c841e1 Check the errno instead of the message 2020-01-13 11:38:30 -08:00
Lidi Zheng 305defc7cb Reuse 'bound_socket' to improve the test case 2020-01-13 11:38:30 -08:00
Lidi Zheng d7698e7e1d Make the test v4/v6 agnostic & fix some typo 2020-01-13 11:38:30 -08:00
Lidi Zheng d1cf71ade5 Fix the format in Cython 2020-01-13 11:38:30 -08:00
Lidi Zheng cc19670bb9 Cosmetic changes 2020-01-13 11:38:30 -08:00
Lidi Zheng 3a6eaf7de7 Remove the hack 2020-01-13 11:38:30 -08:00
Lidi Zheng 8d81314fc8 Make YAPF happy 2020-01-13 11:38:30 -08:00
Lidi Zheng 387c9c0be3 Improve the credibility of the test 2020-01-13 11:38:30 -08:00
Lidi Zheng 96321ed57f Make sanity tests happy 2020-01-13 11:38:30 -08:00
Lidi Zheng 91df9493eb Support channel argument for both client-side and server-side 2020-01-13 11:37:42 -08:00
Lidi Zheng da6a29dd6d
Merge pull request #21455 from Skyscanner/client_unaryunary_interceptors_3
[Aio] Client Side Interceptor For Unary Calls
2020-01-13 11:11:04 -08:00
Pau Freixes 17928a43c0 Apply review feedback, increase timeout threshold 2020-01-11 15:31:05 +01:00
Mark D. Roth 7388c47c91
Merge pull request #20803 from markdroth/grpclb_stabilization
grpclb stabilization
2020-01-10 10:47:46 -08:00
Mark D. Roth 5b18402914 grpclb stabilization 2020-01-10 09:13:10 -08:00
Pau Freixes bb2c94f0e2 Fix random segfaults when gRPC call resources are released
Due to the GC work for breaking reference cycles the internal
attributes of the _AioCall object were cleared and initialized
with None in aims of releasing refcounts for breaking direct or
indirect references.

Once the clear was done, the deallocation of the _AioCall would
fail since the pointer to gRPC call was cast to an invalid object,
no longer was a GrcpWrapper object but a None object, returning a
NULL as a value for the attribute call.
2020-01-10 15:33:16 +01:00
Esun Kim 26adb49f5d
Merge pull request #21598 from longkb/remove_duplicated_words
Remove duplicated words
2020-01-09 16:20:31 -08:00
Pau Freixes aa473fa68a Make YAPF happy 2020-01-09 00:08:01 +01:00
Pau Freixes 69884f7d84 Remove unused loop parameter 2020-01-09 00:07:15 +01:00
Pau Freixes db54580f20 Make YAPF happy 2020-01-09 00:04:44 +01:00
Pau Freixes 2a342b22a7 Fixes bug with deadline 2020-01-09 00:03:42 +01:00
Pau Freixes 75c858bcef Change test name 2020-01-08 15:31:52 +01:00
Pau Freixes 5d664a5f5e Make YAPF happy 2020-01-07 23:38:26 +01:00
Pau Freixes 33765f5ee5 Not mask AioRpcError and CancelledError at interceptor level 2020-01-07 23:31:50 +01:00
Yihua Zhang 62005e4290 Merge remote-tracking branch 'upstream/master' into grpc_security_level_negotiation 2020-01-07 13:10:08 -08:00
Kim Bao Long 953f7c4429 Remove duplicated words
Although it is spelling mistakes, it might make an affects while reading.

Signed-off-by: Kim Bao Long <longkb@vn.fujitsu.com>
2020-01-07 09:35:09 +07:00
Pau Freixes a2667b80c3 make YAPF happy 2020-01-07 01:32:47 +01:00
Pau Freixes 833df2b6c8 Apply feedback 2020-01-07 00:55:59 +01:00
Pau Freixes 77df7f5f17 Client unary unary interceptor
Implements the unary unary interceptor for the client-side. Interceptors
can be now installed by passing them as a new parameter of the `Channel`
constructor or by giving them as part of the `insecure_channel`
function.

Interceptors are executed within an Asyncio task for making some work before
the RPC invocation, and after for accessing to the intercepted call that has
been invoked.
2020-01-07 00:39:54 +01:00
Richard Belleville a29b3b7304
Merge pull request #21593 from gnossen/correct_set_trailing_metadata_docs
Clarify the set_trailing_metadata docstring
2020-01-06 13:58:59 -08:00
Lidi Zheng f9aed63225
Merge pull request #21506 from lidizheng/aio-cancel
[Aio] Improve cancellation mechanism on client side
2020-01-06 13:55:55 -08:00
Richard Belleville ad83e0b77a Clarify the set_trailing_metadata docstring 2020-01-06 12:50:24 -08:00
Yihua Zhang f3d3466a40 fix python santiy check error 2020-01-06 11:58:25 -08:00
Lidi Zheng 5c4e285830 Use "raise_for_status" 2020-01-06 11:54:57 -08:00
Yihua Zhang e10d90ba27 add security level negotiation between call creds and channel. 2020-01-06 11:40:27 -08:00
Esun Kim 5207eba9ff Add abseil 2020-01-03 19:29:55 -08:00
Lidi Zheng 9a3ddd8d76 Correct comment wording 2020-01-03 10:29:11 -08:00
Lidi Zheng 4e3d980f70 Convert local cancellation exception into CancelledError 2020-01-03 10:29:11 -08:00
Lidi Zheng a3d7733dd0 Passing cancel signal to Core for Unary Call as well 2020-01-03 10:29:11 -08:00
Lidi Zheng 6f0ffef2e9 Resolve a TODO and handle one more cancellation corner case 2020-01-03 10:29:11 -08:00
Lidi Zheng 413d29218e Make YAPF happy 2020-01-03 10:29:11 -08:00
Lidi Zheng d49b0849f0 Adding more catch clauses for CancelledError 2020-01-03 10:29:11 -08:00
Lidi Zheng e8283e4818 Reword the comment 2020-01-03 10:29:11 -08:00
Lidi Zheng 65e4f17a2c Remove unused code 2020-01-03 10:29:11 -08:00
Lidi Zheng f1b29deea6 Improve cancellation mechanism:
* Remove the weird cancellation_future;
* Convert all CancelledError into RpcError with CANCELLED;
* Move part of call logic from Cython to Python layer;
* Make unary-stream call based on reader API instead of async generator.
2020-01-03 10:29:11 -08:00
Esun Kim 7be821ac47 Yapf all target python sources 2020-01-03 09:25:10 -08:00
Pau Freixes a85d001225
Merge pull request #21543 from Skyscanner/allow_calling_none_existing_servers
[Aio] Call correctly the connect CB error when an error happens
2019-12-24 08:25:30 +01:00
Pau Freixes d3bba44e9e [Aio] Call correctly the connect CB error when an error happens
Fixes a bug with the Aio socket that did not call correctly the
connect CB function when there was an issue connecting to a host
2019-12-23 23:21:08 +01:00
Lidi Zheng bf1bfff280 Improve readability & reduce logging severity 2019-12-17 11:14:09 -08:00
Lidi Zheng 8ad6152f00 Remove the explicit coroutine tracking 2019-12-16 18:21:34 -08:00
Lidi Zheng a205eaab56 Fix the mismatch type of benchmark server 2019-12-10 17:48:35 -08:00
Lidi Zheng 4955cda816
Merge pull request #21232 from lidizheng/aio-streaming
[Aio] Streaming API - Server side streaming
2019-12-10 17:45:51 -08:00
Richard Belleville a0485f78aa Drop Python 2 support 2019-12-10 17:31:10 -08:00
Guantao Liu b9c06e043f
Merge pull request #21216 from guantaol/libuv_em_basic
Bare bones of the libuv EventManager.
2019-12-10 17:07:57 -08:00
Richard Belleville 7eb3dc2ccc Run grpc_tools tests under Bazel 2019-12-10 16:55:08 -08:00
Richard Belleville 5c76f50e2f Format Python code 2019-12-10 11:41:59 -08:00
Lidi Zheng 160900c897 Renamed the callback_start_batch to execute_batch 2019-12-09 16:59:14 -08:00
Lidi Zheng eff9f936b9 Simplify the creation and destruction of grpc_call 2019-12-09 16:57:05 -08:00
Lidi Zheng 6f9b77103a Adopt advices from gnossen@:
* Fixes typos in comments
* Replaces terms in comments
* Adjusts logging level
* Adds more assertions
2019-12-09 16:29:00 -08:00
Lidi Zheng 25f6723a7e Remove unused import 2019-12-09 11:12:55 -08:00
Lidi Zheng 467bd83845 Correct the return types 2019-12-07 11:06:26 -08:00
Lidi Zheng e9e77e5123 Suppress the pylint "abstract-method" warning 2019-12-06 15:17:23 -08:00
Lidi Zheng d411891bf6 Fix a tiny typing mismatch 2019-12-06 12:55:24 -08:00
Lidi Zheng 1e31e610e7 Remove a useless line 2019-12-05 19:45:56 -08:00
Lidi Zheng 36e6ee9ac3 Adopt reviewer's advices:
* Fix several typos
* Fix a un-revealed segfault
* Fix some documentation
* Polish test assertions
2019-12-05 19:43:38 -08:00
Lidi Zheng fa4eb94ea2 Remove the add_callback method & fix segfault 2019-12-05 18:34:42 -08:00
Lidi Zheng 46e963f8bc Let streaming RPC start immediately 2019-12-05 17:11:16 -08:00
Yihua Zhang a6dbc7adb5 rename spiffe to tls 2019-12-05 16:03:37 -08:00
Lidi Zheng bc99ddedf0 Adopt reviewer's advices 2019-12-04 18:26:11 -08:00
Guantao Liu ee4b311605 Merge remote-tracking branch 'upstream/master' into libuv_em_basic 2019-12-04 17:41:35 -08:00
Lidi Zheng bebd20b126
Merge pull request #21377 from lidizheng/ship-with-proto
Ship grpcio-status with the actual proto file
2019-12-04 15:56:05 -08:00
Lidi Zheng 1a3916bc45 Use False instead 0 for bint 2019-12-04 14:47:07 -08:00
Lidi Zheng d4b8527fb6 Adopt reviewer's advices 2019-12-04 14:28:10 -08:00
Guantao Liu 6b4b891eb2 Merge remote-tracking branch 'upstream/master' into libuv_em_basic 2019-12-04 14:01:14 -08:00
Mark D. Roth 68df397aa2 Remove vtables from JSON library 2019-12-04 13:03:55 -08:00
Lidi Zheng 45e23ef3ad Ship grpcio-status with the actual proto file 2019-12-04 12:15:03 -08:00
Richard Belleville 467bc90a6f Simplify naming 2019-12-03 16:29:27 -08:00
Richard Belleville b9b126a237 Add new functions to grpc api surface 2019-12-03 16:14:40 -08:00
Lidi Zheng c5d194062c Attempt to fix all CI failures:
* Fixes the Windows Cython obsolate issue
* Fixes the post fork threading issue
2019-12-03 15:57:42 -08:00
Lidi Zheng 32d05488f6 Hitting the technical debt the hard way 2019-12-03 15:57:39 -08:00
Lidi Zheng dc2ee66432 Make Sanity test happy 2019-12-03 15:57:08 -08:00
Richard Belleville 6feae07504 Regenerate projects 2019-12-03 15:08:50 -08:00
Lidi Zheng 5e5781c961 First step of adding streaming API:
* Refactors how Task wrapper work on the client-side
* Refactors final status propagation and unify similar classes
* Adds unary-stream API for both-sides
* Refactors each abstraction layer multicallable / call / channel
* Revisits the design of cancellation on client-side
* Makes server methods interuptable
* Fixes a zombie coroutine issue in shutdown path
2019-12-03 12:53:47 -08:00
Guantao Liu d969d8c706 Fix build rules. 2019-12-02 16:59:37 -08:00
Guantao Liu 19d1776c0d Rebase the workspace to fix the submodule discrepancy. 2019-12-02 16:57:17 -08:00
Yash Tibrewal 5817f6287d
Merge pull request #21275 from yashykt/logicalthread
LogicalThread
2019-12-02 14:44:20 -08:00
Mark D. Roth 631fe79f84
Merge pull request #21207 from markdroth/c++_proxy_mapper
Convert grpc_proxy_mapper to C++.
2019-12-02 13:45:11 -08:00
Lidi Zheng 31ffd16764
Merge pull request #21285 from lidizheng/add-ignores
Add side-products of Python compilation to gitignore
2019-11-27 14:48:11 -08:00
Lidi Zheng bb38187221 Add a TODO to remove a.out 2019-11-26 11:18:00 -08:00
Richard Belleville aa156984b1 Support mutating a value used for a response in grpcio_testing 2019-11-25 17:41:16 -08:00
Mark D. Roth 4e393dc035 Convert grpc_proxy_mapper to C++. 2019-11-22 12:32:47 -08:00
Mark D. Roth b073f5416d
Merge pull request #20902 from markdroth/c++_connector
Convert grpc_connector to C++.
2019-11-22 11:47:20 -08:00
Yash Tibrewal 3b1d176e9d LogicalThread 2019-11-22 10:38:35 -08:00
Lidi Zheng 0db9a7a4a9
Merge pull request #21248 from lidizheng/fix-runner
Use dedicated threads for synchronous runners
2019-11-20 10:57:37 -08:00
Lidi Zheng 87e1189083 Use dedicated threads for synchronous runners 2019-11-19 13:56:47 -08:00
Mark D. Roth 0e487a7405 Convert grpc_connector to C++. 2019-11-14 09:45:17 -08:00
Jan Tattermusch 986070d280 use test size instead of timeout 2019-11-14 11:17:31 -05:00
Esun Kim 8cad3b37dc Updates build files to use a sorted list of sources 2019-11-09 15:30:15 -08:00
Lidi Zheng 8347f47535
Merge pull request #20951 from lidizheng/aio-callback-utils
[Aio] Unify the logic around Core Callback API for both sides
2019-11-08 11:38:04 -08:00
Lidi Zheng cb6726d0ea Make the exception detail more helpful 2019-11-07 10:50:48 -08:00
Richard Belleville d0937d101e
Merge pull request #20314 from robertwb/scope-fixes
Fix issue with exception being out of scope in Python 3.
2019-11-07 09:19:43 -08:00
Richard Belleville f5e386730e
Merge pull request #20938 from gnossen/unary_stream_single_threaded_test
Add additional test runner for single-threaded unary-stream code path
2019-11-06 15:32:30 -08:00
Richard Belleville 40510efdc1 Yapf 2019-11-06 13:02:55 -08:00
Richard Belleville 5175dd4643
Merge pull request #20838 from gnossen/dedupe_dual_stack_tests
Dedupe dual stack tests
2019-11-06 13:01:42 -08:00
Richard Belleville 10e7befbf4 Appease pylint 2019-11-06 11:51:17 -08:00
Richard Belleville 3f1b5fe2aa Whoops 2019-11-06 11:19:12 -08:00
Richard Belleville 7bf58e82fd (hopefully) fix Windows 2019-11-06 11:16:50 -08:00
Lidi Zheng 918492d3ca Make buildifier happy 2019-11-06 11:10:17 -08:00
Richard Belleville df8bd10b96 Skip test not applicable to unary-stream case 2019-11-06 10:21:01 -08:00
Lidi Zheng 80f66ab248 Eliminate an evil space line 2019-11-05 17:17:23 -08:00
Lidi Zheng 08f145da99 Unify the logic around Core Callback API for both sides 2019-11-05 17:05:12 -08:00
Lidi Zheng 15c67e255b
Merge pull request #20885 from lidizheng/buildifier-step-2
Format all Bazel files using buildifier
2019-11-05 16:59:32 -08:00
Esun Kim aa93600a4d
Merge pull request #20907 from veblush/upb-lib
Change upb from filegroup to library
2019-11-05 16:55:46 -08:00
Richard Belleville a08da012d2 Switch to config-driven style 2019-11-05 15:17:06 -08:00
Esun Kim aaf48c66fc Change upb from filegroup to library 2019-11-05 14:20:56 -08:00
Lidi Zheng c34bef4ca4 Format all Bazel files with buildifier 2019-11-05 14:03:52 -08:00
Lidi Zheng 4373d88caf Fix the tests after merging with Unified Stub Call 2019-11-05 14:03:29 -08:00
Lidi Zheng ae59fc3b7a Adopt reviewers' advice
* Add cancellation handler
* Use loop=
2019-11-05 14:03:29 -08:00
Lidi Zheng 9aeefc3691 Fix missing shielding 2019-11-05 14:03:29 -08:00
Lidi Zheng 9289d34df0 Propagate unexpected error to application 2019-11-05 14:03:29 -08:00
Lidi Zheng f8dc1d9a8e Make PyLint happy 2019-11-05 14:03:29 -08:00
Lidi Zheng 8af510e1df Adopt reviewer's advice:
1. Refactor (simplify) the failure handler;
2. Fix a memory leak for badly written application code.
2019-11-05 14:03:29 -08:00
Lidi Zheng 8168b9e1c9 Adopt reviewer's advice
* Make graceful shutdown support calls from multi-coroutine
* Added comments
* Make graceful shutdown success test case more strict
* Add 2 more concurrent graceful shutdown tests
2019-11-05 14:03:29 -08:00
Lidi Zheng 983e36d5a3 Make YAPF and PyLint happy 2019-11-05 14:03:29 -08:00
Lidi Zheng 0a423d05ca Add 4 server tests and 1 channel tests
* Improve the shutdown process
* Refactor the AioRpcError
2019-11-05 14:03:29 -08:00
Lidi Zheng cfea8c7d25 Add 3 more shutdown test cases 2019-11-05 14:03:29 -08:00
Lidi Zheng a978449c3f Correctly propagate and catch request_call failure 2019-11-05 14:03:29 -08:00
Lidi Zheng 980bcaf076 Add failure handling mechanism to CallbackWrapper 2019-11-05 14:03:29 -08:00
Lidi Zheng 3c43e6330f Add shutdown process for completion queue 2019-11-05 14:03:29 -08:00
Lidi Zheng 9f5dbf70dc Add shutdown test 2019-11-05 14:03:29 -08:00
Richard Belleville 86cb2f9efc Add additional test runner for single-threaded unary-stream code path 2019-11-05 11:47:16 -08:00
Richard Belleville 057a493848
Merge pull request #20905 from gnossen/interceptor_test
Fix Regression in Client-side Interceptors
2019-11-05 10:34:31 -08:00
Richard Belleville 8c7b77489b Rename to InactiveRpcError 2019-11-04 16:09:46 -08:00
Pau Freixes 403db61a58 AIO Unified call interface
Call interface, implemented by the new `grpc.experimental.aio.Call`
object is the unique entry point for handling RPC calls and is the
one returned by, for now, the `unary_unary` method. It supports all
in one the three interfaces `with_call`, `__call__` and `future` implemented
by the synchronous API.
2019-11-04 23:04:56 +01:00
Lidi Zheng 13bc82ce9c
Merge pull request #20891 from lidizheng/fix-3-i20299
Make sure Core aware of gevent Cython objects
2019-11-04 13:45:06 -08:00
Richard Belleville f7249fcd3a Adopt reviewer's advice 2019-11-04 13:44:39 -08:00
Lidi Zheng 814fd36459
Merge pull request #20870 from lidizheng/win-3.6
Make Windows test gRPC with Python 3.6
2019-11-04 13:41:19 -08:00
yihuaz 5570dec9a5
Merge pull request #20916 from yihuazhang/python
Add more documentation on local credentials
2019-11-04 13:03:24 -08:00
Lidi Zheng 1f3675005d Disable StrictRealTimeTest for gevent 2019-11-04 10:47:35 -08:00
Lidi Zheng cf02badf87 Make PyLint happy 2019-11-04 10:41:11 -08:00
Yihua Zhang 294aecfed6 add more documentation on local credentials 2019-11-03 09:33:06 -08:00
Richard Belleville e4d58fba6d Sanity 2019-11-01 16:34:41 -07:00
Richard Belleville 6f0b772afa Add tests for other arities 2019-11-01 15:39:49 -07:00
Richard Belleville acc6053716 Fix interceptors for unary-unary case 2019-11-01 15:28:48 -07:00
Lidi Zheng d10eabf18b Add a test case to catch the failure 2019-11-01 14:20:56 -07:00
Lidi Zheng 2817afd4e9 Make sure Core aware of gevent Cython objects 2019-10-31 16:41:14 -07:00
Lidi Zheng 61d463672d Windows' gevent is always special! 2019-10-31 13:39:43 -07:00
Lidi Zheng 3cd792ad70 Make YAPF happy 2019-10-30 18:21:41 -07:00
Lidi Zheng e2ee7bb679 Disable unit._channel_close_test.ChannelCloseTest 2019-10-30 17:00:16 -07:00
Mark D. Roth fa6920f601
Merge pull request #20544 from markdroth/xds_cds_policy
CDS LB policy
2019-10-29 14:31:55 -07:00
Mark D. Roth 7ccdc85fa0 CDS LB policy 2019-10-29 12:00:12 -07:00
Richard Belleville 57e463db82
Merge pull request #20837 from gnossen/pylint_considered_annoying
Make pylint less annoying
2019-10-28 17:39:32 -07:00
Richard Belleville 9b058aa157 心よ。心よ。ここは、悪い所よ。 2019-10-28 15:50:39 -07:00
Richard Belleville 026d0e6af6 Incorporate review comments 2019-10-28 15:25:12 -07:00
Richard Belleville be214c9c50 Yapf 2019-10-28 14:41:52 -07:00
Richard Belleville abdd2ac2dd
Merge pull request #20812 from gnossen/unary_stream_initial_metadata
Enable Retrieval of Initial Metadata from Single Threaded Unary-Stream RPC at Any Point
2019-10-28 13:39:26 -07:00
Richard Belleville 90ee052cb8 Attempt to work on kokoro 2019-10-28 12:45:03 -07:00
Richard Belleville d78563eb43 Merge remote-tracking branch 'origin/master' into dedupe_dual_stack_tests 2019-10-28 12:24:54 -07:00
Richard Belleville 2838ff184d Make pylint less annoying 2019-10-28 12:20:41 -07:00
Richard Belleville 89fba97892 Yapf. Pylint 2019-10-28 12:17:16 -07:00
Richard Belleville a577c75cb1 Update docstrings 2019-10-28 11:48:57 -07:00
Richard Belleville 349d79cae9 Integrate with asyncio tests 2019-10-28 11:46:40 -07:00
Richard Belleville bf7accb2db Remove unused code 2019-10-28 11:18:48 -07:00
Richard Belleville 09ac5fe573 Fix up reconnect test 2019-10-28 11:18:03 -07:00
Richard Belleville 800e0bb17a Migrate compression test 2019-10-28 11:00:56 -07:00
Richard Belleville 5e3717953c Get metadata flags test working 2019-10-28 10:55:40 -07:00
Richard Belleville 3b652bc3ef WIP. Start writing signatures 2019-10-25 17:00:34 -07:00
Richard Belleville 49dafa527f Rename exception and method 2019-10-25 16:04:11 -07:00
Richard Belleville d07a59efc5 Introduce new error 2019-10-25 16:01:35 -07:00
Richard Belleville f6dcec556e Clean up operations sequence 2019-10-25 15:37:00 -07:00
Richard Belleville 844acda19b Tidy up inheritance hierarchy 2019-10-25 15:27:35 -07:00
Lidi Zheng c8c41e4f6a
Merge pull request #20771 from lidizheng/aio-tests
[AIO] AsyncIO Tests Kokoro Integration
2019-10-25 15:22:10 -07:00
Richard Belleville 6ece2af4f1 Refix test 2019-10-25 14:36:45 -07:00
Richard Belleville 72a736fe07 Re-add test 2019-10-25 14:34:55 -07:00
Richard Belleville bd0c995f8e Merge remote-tracking branch 'origin/master' into unary_stream_initial_metadata 2019-10-25 14:26:12 -07:00
Richard Belleville 2be43cfdc8 TODONE 2019-10-25 14:20:05 -07:00
Richard Belleville b6a41e2e21 Yapf. Lint 2019-10-25 14:16:21 -07:00
Richard Belleville 897c798311 Reset default unary-stream implementation 2019-10-25 14:13:46 -07:00
Richard Belleville 4b5397dae8 Let errors bubble up to the user 2019-10-25 14:12:10 -07:00
Richard Belleville 82bb86540d Formatting 2019-10-25 14:05:04 -07:00
Richard Belleville 2ce31086aa Dedupe 2019-10-25 14:02:27 -07:00
Richard Belleville 3196b8a8e0 Pull out an uncomplicated error PODS 2019-10-25 13:55:43 -07:00
Richard Belleville 420590f163 Pull out a base Rendezvous class 2019-10-25 13:17:10 -07:00
Lidi Zheng fb74da8620 Adopt reviewer's advice 2019-10-25 10:58:10 -07:00
Richard Belleville 752e9be052 Fix initial metadata problem. Very messy. Needs additional tests 2019-10-25 10:41:23 -07:00
Juanli Shen 0a736c0d37 Update envoy API to HEAD 2019-10-24 17:21:26 -07:00
Lidi Zheng 2fbd97217b Turn the single threaded runner on by default. 2019-10-24 15:10:28 -07:00
Richard Belleville 0ac082e1e7 Support both v4 and v6 in test 2019-10-24 13:26:23 -07:00
Yash Tibrewal 07ef24344c Regenerate projects 2019-10-24 11:54:20 -07:00
Lidi Zheng c66bdcdbe0 Unblock the compilation speed up 2019-10-23 19:09:41 -07:00
Lidi Zheng b3b2168b60 Make YAPF happy 2019-10-23 19:09:11 -07:00
Lidi Zheng 1ebaace7f1 Bring back the file that I accidentally rm -f 2019-10-23 19:02:26 -07:00
Lidi Zheng 70821ebe4a Supply the event loop to aio iomgr in test case level 2019-10-23 18:49:58 -07:00
Lidi Zheng dcf609966e Add comments about why runner failed 2019-10-23 18:28:46 -07:00
Lidi Zheng 0765cf940b Refactor the way AsyncIO is tested under run_tests.py 2019-10-23 15:44:54 -07:00
Lidi Zheng e2dcb2883d Make runner support single threaded mode 2019-10-23 15:24:30 -07:00
Richard Belleville 018580fb89
Merge pull request #20753 from gnossen/unary_stream
Add experimental option to run unary-stream RPCs on a single Python thread.
2019-10-23 15:19:53 -07:00
Lidi Zheng 58cdbe7a83 Add the server_test to tests.json 2019-10-23 15:15:41 -07:00
Lidi Zheng 98f33e8e17 Enable all AsyncIO tests for Bazel 2019-10-23 15:05:03 -07:00
Richard Belleville 0c6f8dbed3 Remove ChannelOptions from __init__.py 2019-10-23 14:07:47 -07:00
Richard Belleville 469637efdd Yapf 2019-10-23 13:08:44 -07:00
Richard Belleville d5d9bc0a0d Whitespace-sensitive languages are the worst 2019-10-23 12:45:13 -07:00
Richard Belleville da9f5f78fe Add ChannelOptions to experimental module 2019-10-23 12:42:34 -07:00
Richard Belleville 0bb38a88b0 Copyright 2019-10-23 12:14:19 -07:00
Richard Belleville 0dd70ff758 Add TODOs 2019-10-23 12:11:45 -07:00
Richard Belleville 3411202598 Yapf 2019-10-23 11:56:39 -07:00
Richard Belleville 36e8f9ff62 Don't load manual benchmark as test 2019-10-23 11:49:00 -07:00
Richard Belleville e8d8883485 Add copyright comments 2019-10-23 11:17:02 -07:00
Richard Belleville e557dd8bb7 Kokoro is v4-only 2019-10-23 10:54:23 -07:00
Richard Belleville 4ad50b8d2b Don't run benchmark in test runner 2019-10-23 10:34:59 -07:00
Richard Belleville f09f59f1fd Pylint 2019-10-22 23:10:51 -07:00
Richard Belleville 9ff053f140 Yapf 2019-10-22 22:59:34 -07:00
Richard Belleville 420c9bceff Clean up SingleThreadedUnaryStreamMultiCallable 2019-10-22 22:55:28 -07:00
Richard Belleville 12b7a8422a Remove wait on segregated_call_states. We are passing asan and msan without it 2019-10-22 22:48:27 -07:00
Richard Belleville 5b11fe8caa Add porcelain for backwards compatbility 2019-10-22 22:44:49 -07:00
Richard Belleville d9d3e387d0 Add docstrings 2019-10-22 22:19:30 -07:00
Richard Belleville 5782733da0 Dedupe between the two rendezvous 2019-10-22 22:07:01 -07:00
Richard Belleville d51fa803b9 Protect critical sections 2019-10-22 21:52:41 -07:00
Richard Belleville 4217a79f62 Add and fix _metadata_flags test 2019-10-22 21:30:07 -07:00
Richard Belleville dd7b04c088 Fix metadata tests 2019-10-22 18:24:22 -07:00
Richard Belleville 5f5e9e2695 Pass RPC test 2019-10-22 17:09:50 -07:00
Lidi Zheng 84fd0a1ad0
Merge branch 'master' into revert-20610-revert-20277-grpc-19871/unary_unary_client_aio-implement-timeout 2019-10-22 11:09:56 -07:00
Lidi Zheng 3c62c8a35e
Merge pull request #20598 from lidizheng/aio-server
[AIO] Minimal AsyncIO Server
2019-10-22 11:09:22 -07:00
Lidi Zheng a588b5ffb9 Remove the usage of f-string 2019-10-21 17:07:11 -07:00