Commit Graph

3247 Commits

Author SHA1 Message Date
Pau Freixes b4afe041f1 Fixed weird annotation issues with pytype 2020-06-01 23:19:30 +02:00
Pau Freixes c8b7f22474 Apply feedback review 2020-06-01 21:53:14 +02:00
Richard Belleville 3ade93b447 Add TODOs 2020-06-01 12:19:06 -07:00
Richard Belleville 8487ce7faf Propagate on posix 2020-06-01 12:05:15 -07:00
Pau Freixes f9d9793c96 Apply review feedback 2020-05-30 22:34:45 +02:00
Pau Freixes b3425f6dbf Add stream stream client interceptor support
This was the last missing arity which did not have support yet for
the interceptors in the client side for the Aio package. This commit
adds specific support for this interceptro which allows the deveveloper
to intercept the request iterator and the response iterator.
2020-05-29 21:32:24 +02:00
Mark D. Roth 3bb427195e Revert "Merge pull request #23053 from grpc/revert-22772-gpr_strvec"
This reverts commit 4b7452bcdb, reversing
changes made to 133d0076b4.
2020-05-28 11:13:12 -07:00
Mark D. Roth afe7c74d6d
Merge pull request #23013 from markdroth/xds_config_selector
Refactor ServiceConfig code to pave the way for adding a ConfigSelector API
2020-05-28 09:52:32 -07:00
Mark D. Roth aed6574023 Refactor ServiceConfig code to move parsing to its own API. 2020-05-28 07:15:28 -07:00
Karthik Ravi Shankar f46c07f3f8
Revert "Remove gpr_strvec." 2020-05-26 17:25:45 -07:00
Mark D. Roth 3db250de10
Merge pull request #22772 from markdroth/gpr_strvec
Remove gpr_strvec.
2020-05-21 13:18:40 -07:00
Mark D. Roth c2ef110303 Replace gpr_strvec with absl::StrJoin(). 2020-05-21 08:47:41 -07:00
Srini Polavarapu ce52c1dd71 update boringssl 2020-05-20 14:57:25 -07:00
Lidi Zheng 60eea82fbf
Merge pull request #22604 from dhalperi/patch-1
gRPC docs: remove mention of Python 2.7
2020-05-15 10:37:43 -07:00
Lidi Zheng 698a5a8869
Merge pull request #22770 from grpc/revert-22759-revert-22688-aio-status
Revert "Revert "[Aio] Add AsyncIO support to grpcio-status""
2020-05-14 14:09:01 -07:00
Lidi Zheng 7eeab2a23c Describe the expectations of input arguments and return values 2020-05-12 12:52:27 -07:00
Lidi Zheng ef6ff6dcfd Make linters happy 2020-05-12 10:43:12 -07:00
Lidi Zheng 028a7c4e79 Add test cases for server interceptors 2020-05-11 13:59:44 -07:00
Lidi Zheng f7591a3426
Merge pull request #22855 from lidizheng/stop-leak
Stop memory leak when Python channel is deallocated without invoking "close"
2020-05-08 16:19:47 -07:00
Lidi Zheng e844f30101 Close Core's channel when there is no reference to the channel 2020-05-08 13:43:10 -07:00
Mark D. Roth c769951764 Remove deprecated variant of JoinHostPort(). 2020-05-08 09:13:26 -07:00
Mark D. Roth 7b3590d543
Merge pull request #22854 from markdroth/xds_lrs_send_all_clusters
xds: Add support for send_all_clusters field in LRS.
2020-05-06 09:33:41 -07:00
yihuaz 4efeb8f1fd
Merge pull request #22638 from tgalkovskyi/master
Expose ALTS client/server credentials in Python API
2020-05-04 12:57:50 -07:00
Pau Freixes b6f4feb64c
Merge pull request #22821 from Skyscanner/stream_unary_client_interceptor
[Aio] Stream Unary client interceptor
2020-05-04 21:15:02 +02:00
Mark D. Roth b95843c1b7 xds: Add support for send_all_clusters field in LRS. 2020-05-04 11:16:52 -07:00
Lidi Zheng f6e6b9f640 Fix the pylint complain 2020-04-30 15:16:32 -07:00
Lidi Zheng ae73ab5190
Merge pull request #22812 from lidizheng/aio-mixed-server
[Aio] Make sync handlers runnable in AsyncIO server
2020-04-30 15:03:30 -07:00
Pau Freixes 39d8fa3f0b Apply feedback review 2020-04-30 22:40:53 +02:00
Taras Galkovskyi f375c0b548 minor stylistic fixes 2020-04-30 18:58:44 +00:00
Nicolas "Pixel" Noble 791729d09f Bumping version. 2020-04-30 08:12:29 +02:00
Lidi Zheng fb60bf235e Synchonize the production and consumption of request messages 2020-04-29 16:11:55 -07:00
Taras Galkovskyi 469631f549 run yapf; delete alts unit tests 2020-04-29 22:50:35 +00:00
Lidi Zheng 8be1251e2c Remove read/write API && simplify the logic of getting the pool 2020-04-29 15:37:15 -07:00
Lidi Zheng d40c1b8408 Fix the error on mac and win && make pytype happy 2020-04-29 15:24:19 -07:00
Lidi Zheng df065d41fa Make sync handlers runnable in AsyncIO server 2020-04-29 15:24:19 -07:00
Pau Freixes 7b869e8442 Use message constant 2020-04-29 23:12:02 +02:00
Pau Freixes b9558026b1 Improve message redability 2020-04-29 23:10:32 +02:00
Pau Freixes 32acd9d5fd [Aio] Stream Unary client interceptor
Add support for Stream Unary client interceptor
2020-04-29 22:55:50 +02:00
Lidi Zheng 025ebf7d07 Revert "Revert "[Aio] Add AsyncIO support to grpcio-status"" 2020-04-29 11:43:03 -07:00
Taras Galkovskyi 2cf920ba0b Merge branch 'master' of git://github.com/grpc/grpc 2020-04-29 14:37:35 +00:00
Mark D. Roth d74548e611 Remove StringViewToCString() and src/core/lib/gprpp/string_view.h 2020-04-27 12:28:28 -07:00
Lidi Zheng da5022de6a
Merge pull request #22745 from lidizheng/doc-channel-args
Explain how to find channel arguments in our doc
2020-04-23 16:18:59 -07:00
Lidi Zheng f8f425bcc9
Merge pull request #22758 from lidizheng/aio-cq-shutdown
[Aio] Make completion queue shutdown stricter
2020-04-23 16:02:27 -07:00
Lidi Zheng 77811ef323 Make completion queue shutdown stricter 2020-04-23 13:51:22 -07:00
Lidi Zheng 82c586bb3c
Revert "[Aio] Add AsyncIO support to grpcio-status" 2020-04-23 13:06:11 -07:00
Lidi Zheng d3805e1b6c Explain how to find channel arguments in our doc 2020-04-22 16:19:42 -07:00
Lidi Zheng 372d990f4a
Merge pull request #22738 from lidizheng/doc-wtr
Document wait_for_ready mechanism in Python's glossary
2020-04-22 16:03:37 -07:00
Lidi Zheng 4e7f3376d8
Merge pull request #22688 from lidizheng/aio-status
[Aio] Add AsyncIO support to grpcio-status
2020-04-22 13:47:45 -07:00
Lidi Zheng c1df38f2b9 Document wait_for_ready mechanism in Python's glossary 2020-04-22 13:38:22 -07:00
Pau Freixes 11e41537a5
Merge pull request #22713 from Skyscanner/client_unary_stream_interceptor
[Aio] Implement the Unary Stream client interceptor
2020-04-21 22:25:22 +02:00
Pau Freixes 20898aa2f2 Fix type issue 2020-04-21 16:45:33 +02:00
Muxi Yan 006c815810
Merge pull request #22687 from grpc/revert-22684-revert-22423-objc-poller
Revert "Revert "Introduce CFRunLoop based iomgr""
2020-04-20 15:58:26 -07:00
Pau Freixes f07e0da6dd Make YAPF happy 2020-04-20 23:25:59 +02:00
Pau Freixes dae80a4977 Apply feedback 2020-04-20 23:24:54 +02:00
Pau Freixes 2aea5c002b [Aio] Implement the Unary Stream client interceptor
Add support for adding intercetpors for the Unary Stream arity at
client level.
2020-04-20 15:38:40 +02:00
Lidi Zheng 916f6db913
Merge branch 'master' into aio-status 2020-04-17 13:13:12 -07:00
donnadionne baa442e6e4
Merge pull request #22280 from donnadionne/route_response
Xds Routing LB Policy
2020-04-17 12:45:39 -07:00
Yash Tibrewal b7941bedf3
Merge pull request #22575 from yashykt/newfilter
Move decompression into gRPC Core
2020-04-16 15:21:01 -07:00
Lidi Zheng 95b4f22475 Add AsyncIO support to grpcio-status 2020-04-16 13:37:33 -07:00
Donna Dionne 584b35055e Merge remote-tracking branch 'upstream/master' into route_response 2020-04-16 13:10:15 -07:00
Muxi Yan eb7779c20c
Revert "Revert "Introduce CFRunLoop based iomgr"" 2020-04-16 13:07:55 -07:00
Muxi Yan 881439476c
Merge pull request #22684 from grpc/revert-22423-objc-poller
Revert "Introduce CFRunLoop based iomgr"
2020-04-16 13:07:48 -07:00
Yash Tibrewal e24bb3a6ef Regenerate projects 2020-04-16 11:46:29 -07:00
Lidi Zheng ebfa9e7e51
Merge pull request #22665 from lidizheng/aio-unary-none
[Aio] Handle the empty response with error code from server handler
2020-04-16 10:20:38 -07:00
Muxi Yan 0e0db09613
Revert "Introduce CFRunLoop based iomgr" 2020-04-16 08:54:07 -07:00
Lidi Zheng 9503b68a8b Discards response message with non-OK status 2020-04-15 16:13:12 -07:00
Lidi Zheng 51e38fa508 Allow "None" as response message with none-OK status 2020-04-15 15:26:07 -07:00
Lidi Zheng cc04b8aaf0
Merge pull request #22677 from lidizheng/aio-codec-doc
Improve the documentation for serializer and deserializer
2020-04-15 15:22:10 -07:00
Taras Galkovskyi 42bd106898 updating comments to make clear that ALTS is only supported on GCP 2020-04-15 22:14:08 +00:00
Muxi Yan 7f36ff039f
Merge pull request #22423 from muxi/objc-poller
Introduce CFRunLoop based iomgr
2020-04-15 14:30:43 -07:00
Lidi Zheng 6e0ac50b09 Improve the documentation for serializer and deserializer 2020-04-15 14:04:52 -07:00
Lidi Zheng 17d75dde69 Simplify logic around send message operation 2020-04-15 12:45:29 -07:00
Taras Galkovskyi 3ff24dd63a Merge branch 'master' of git://github.com/grpc/grpc 2020-04-15 18:18:51 +00:00
Taras Galkovskyi 02da3330c2 address review comments 2020-04-15 18:13:04 +00:00
Muxi Yan b96895bf9d Add apple_ev iomgr 2020-04-15 11:06:53 -07:00
Lidi Zheng 3e187feca0 Fix the inaccurate cancel injection 2020-04-14 16:42:35 -07:00
Lidi Zheng 9b4070a380 Fix the None return case 2020-04-14 15:42:52 -07:00
Yash Tibrewal 3c34eae97e Move decompression into gRPC Core 2020-04-10 16:43:29 -07:00
Taras Galkovskyi 83ada3b598 adjusting formatting & tests 2020-04-10 14:20:27 +00:00
Taras Galkovskyi 2b3eca0858 adding api to configure target service accounts for client ALTS 2020-04-10 14:09:17 +00:00
Donna Dionne f5fd631a9c Merge remote-tracking branch 'upstream/master' into route_response 2020-04-09 11:10:28 -07:00
Mark D. Roth 80b74811d4
Merge pull request #22117 from markdroth/xdslb_refactor
Refactor xds LB policy
2020-04-08 07:28:49 -07:00
Mark D. Roth f8f6034d1a Refactor xds LB policy 2020-04-07 14:03:01 -07:00
Lidi Zheng e50c9a8e2e Fix typo in the comment 2020-04-07 13:54:21 -07:00
Dan Halperin cdc1c1afaf
gRPC docs: remove mention of Python 2.7
It's April now, docs looking forward to January seem outdated.
2020-04-07 08:23:33 -07:00
Taras Galkovskyi d84d53f901 fix comment 2020-04-07 00:26:23 +00:00
Taras Galkovskyi 828ee320a4 Expose ALTS client/server credentials on Python layer 2020-04-07 00:14:41 +00:00
Lidi Zheng 4eb596446d Resolve conflict with master 2020-04-06 16:11:13 -07:00
Lidi Zheng 2b6037f113 Rename to wait_for_conneciton && Add to unary-unary RPC 2020-04-06 16:10:07 -07:00
Lidi Zheng 58beda2f73 Add try_connect API to StreamUnaryCall 2020-04-06 16:09:07 -07:00
Lidi Zheng c07520a350 Mark it as experimental 2020-04-06 16:09:07 -07:00
Lidi Zheng 41866c1250 Add try_connect API for UnaryStreamCall and StreamStreamCall 2020-04-06 16:09:07 -07:00
Donna Dionne c0c7f1dae3 Fix build and test failures
Including the following
All all needed BUILD changes to include new xdsRouting
Fixed TSAN errors
AllServerUnavailableFailFast may return UNKNOWN as oppose UNAVAILABLE
ChooseLastRoute modified into 2 tests
2020-04-06 16:05:04 -07:00
Lidi Zheng 6f00de087f Aggregate common statement in both branches 2020-04-03 15:13:26 -07:00
Lidi Zheng e00eb2fec2 Make pylint happy 2020-04-03 11:37:56 -07:00
Lidi Zheng 8b1a6c8f45 Accepts normal iterable of request messages 2020-04-03 11:37:56 -07:00
Richard Belleville 0ec32634fb
Merge pull request #22549 from gnossen/simple_stubs_3_6_and_up
Add version check for Python 3.6 to simple stubs
2020-04-02 14:08:36 -07:00
Lidi Zheng 006aafea85
Merge pull request #22541 from lidizheng/aio-poller-shutdown-error
[Aio] Fix AttributeError during deallocation of the completion queue
2020-04-02 13:09:23 -07:00
Richard Belleville f15a6bf6e4 Add version check for Python 3.6 to simple stubs 2020-04-01 23:34:14 -07:00
Lidi Zheng 386977ff41 Annotate metadata variable as Tuple instead of Sequence 2020-04-01 15:16:55 -07:00
Lidi Zheng 5cab833808 Make sanity tests happy 2020-04-01 15:11:26 -07:00
Lidi Zheng 2c24272bbd Cast the complete queue to sub class to avoid AttributeError 2020-04-01 14:30:15 -07:00
Lidi Zheng ee31a696ab Cast metadata to tuple 2020-04-01 13:25:33 -07:00
Mark D. Roth 03411d7be7 Second attempt: grpclb stabilization 2020-03-31 07:52:44 -07:00
Lidi Zheng cb5fdce2bf Improve readability and fix wording 2020-03-26 10:35:32 -07:00
Lidi Zheng 5182e9f07f Eliminates suspicious exceptions in test logs 2020-03-25 17:45:45 -07:00
Lidi Zheng 1e6c9b4c6d
Merge pull request #22482 from lidizheng/aio-no-info
[Aio] Eliminate info level logs
2020-03-25 17:16:36 -07:00
Lidi Zheng b5b47ce7c7 Upgrade the server stop log to warning 2020-03-25 16:00:50 -07:00
Lidi Zheng 0961c5de0b
Merge pull request #22306 from Skyscanner/issue-21953_type-of-metadata
[Aio] Initial modelling of the metadata abstraction
2020-03-25 15:10:51 -07:00
Lidi Zheng 79497f8059 Downgrade info logs to debug 2020-03-25 15:09:21 -07:00
Mariano Anaya 2be1ec9c6e [issue21953] Move tests to the aio part
* Export the new metadata type through the ``__init__.py``
* Move the tests from the old location to the new one for the
asynchronous stack.
2020-03-25 10:03:14 +01:00
Mariano Anaya 3bf67c4253 [issue21953] Fix typing in Metadata class definitions 2020-03-25 10:03:14 +01:00
Mariano Anaya 6891169b58 Apply PR feedback
* Fix the length of the object to account for all the keys it holds
(consider it's a multi-mapping)
* Add support for deleting items
* Make test stricter
2020-03-25 10:03:14 +01:00
Mariano Anaya 1f2d916386 [aio] Metadata type: Fix tests & __repr__ 2020-03-25 10:03:14 +01:00
Mariano Anaya 0be36ed606 Add mutability to the MetadataType 2020-03-25 10:03:14 +01:00
Mariano Anaya 7d88c61f57 Initial modelling of the metadata abstraction
Create the initial version for the abstraction for the Metadata based on
the discussion at https://github.com/grpc/grpc/issues/21953
2020-03-25 10:03:14 +01:00
Lidi Zheng 52634fb7be Correct the docstring and implementation of AuthMetadataPlugin 2020-03-24 15:59:10 -07:00
Lidi Zheng b73b389dd1 Change the default IO engine to poller 2020-03-23 10:21:33 -07:00
Lidi Zheng 39c4fd7972
Merge pull request #22343 from lidizheng/async-unary-unary-credentials-tests
[Aio] Extend unit tests for async credentials calls
2020-03-19 14:53:21 -07:00
Lidi Zheng ae0dc69cb1 Fix the typo; I got the wrong branch and waited two hours 2020-03-19 13:19:41 -07:00
Lidi Zheng 69fa971183
Merge pull request #22405 from lidizheng/annotate-context-manager
Annotate channel context manager methods to make pytype happy
2020-03-18 13:30:21 -07:00
Richard Belleville 85d25bd990
Merge pull request #22104 from gnossen/xds-python-client
Implement Python xDS interop client.
2020-03-18 13:07:50 -07:00
Lidi Zheng 158a68f4f0 Annotate channel context manager methods to make pytype happy 2020-03-18 11:49:26 -07:00
Lidi Zheng 46bb3769a9 Override the auth plugin behavior 2020-03-18 10:13:05 -07:00
Lidi Zheng d6bd3c37b2 Use mutex to protect queue operations 2020-03-17 15:32:38 -07:00
Lidi Zheng 030b1b6a84 Update the pxd as well 2020-03-17 13:28:24 -07:00
Lidi Zheng 82050ae192 Initialize credentials after IO engine set 2020-03-17 13:23:11 -07:00
Lidi Zheng 1a0655d75c Add comment about why we can't use cimport 2020-03-17 10:55:52 -07:00
Lidi Zheng 65930d4be9 Remove the socket reader in shutdown 2020-03-17 10:40:05 -07:00
Mariano Anaya dff4a30b6c Fix build & address review comments
Fixes https://github.com/grpc/grpc/issues/20532
2020-03-16 16:09:36 -07:00
Mariano Anaya 33e15156bb [WIP] Feedback on the PR 2020-03-16 16:09:36 -07:00
Mariano Anaya f2aad7e54c Extend tests for secure channels & credentials 2020-03-16 16:09:36 -07:00
Mariano Anaya a1bb0bc6f8 Set error description 2020-03-16 16:09:36 -07:00
Mariano Anaya 764be7ed92 Improve error message by including the error code 2020-03-16 16:09:36 -07:00
Mariano Anaya 88e922c03f Make the server test use SSL credentials 2020-03-16 16:09:36 -07:00
Mariano Anaya f44e4e2138 Renames according to PR comments 2020-03-16 16:09:36 -07:00
Lidi Zheng c82f28d428 Use socket to synchronize cq and asyncio 2020-03-16 15:42:31 -07:00
Lidi Zheng 5d1651ff65 Don't graceful shutdown cq to avoid the deadlock 2020-03-16 11:10:07 -07:00
Lidi Zheng 7622a2de38 Improve readability & fix a deadlock issue in _test_base 2020-03-13 15:56:25 -07:00
Richard Belleville 651f850076 Merge remote-tracking branch 'origin/master' into peers_method 2020-03-13 20:31:27 +00:00
Lidi Zheng 7a51ca3330 Plumb through loop object & pass daemon=Ture in constructor 2020-03-13 11:59:35 -07:00
Lidi Zheng 8fc872ed2e Enforce one cq and support many-thread many-loop env
- Label channel_argument_test as flaky

- Add compatibility test

- Add many-loop test case
2020-03-13 11:47:30 -07:00
Lidi Zheng fda2111af7
Merge pull request #22258 from lidizheng/aio-cq
[Aio] Add an alternative mode for the AsyncIO Stack
2020-03-13 11:40:20 -07:00
Richard Belleville 9ef83ee539 Merge remote-tracking branch 'origin/master' into peers_method 2020-03-12 20:30:08 +00:00
Lidi Zheng 4741da3a11 Remove unused variable 2020-03-10 10:26:46 -07:00
Richard Belleville df1761ce50
Merge pull request #22218 from gnossen/simple_stubs_codegen
Generate simple stubs code
2020-03-09 19:04:13 -07:00
Richard Belleville f27b7fea21 Format 2020-03-09 17:25:00 -07:00
Richard Belleville 4e2ad2444d Remove the default value for simple stubs 2020-03-09 17:03:55 -07:00
Lidi Zheng 5b1ecef47f Simplify the Cython code 2020-03-09 15:38:34 -07:00
Lidi Zheng 5246a7c8ff Link to a TODO issue 2020-03-09 15:20:06 -07:00
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 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
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
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
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
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 8aff9ec592
Merge pull request #21987 from lidizheng/aio-doc
[Aio] Generate gRPC AsyncIO API Reference
2020-02-19 10:52:38 -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 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 03e1bf1071 Fix already cancelled RPC 2020-02-18 16:27:29 -08:00
Zhanghui Mao 6fef56573e Implement server interceptor for unary unary call 2020-02-15 23:39:34 +08:00
Lidi Zheng 7b4d0b28c6 Implement health checking servicer in AsyncIO 2020-02-14 12:27:42 -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 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
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
Lidi Zheng 2789f83f85 Make pytype happy 2020-02-12 10:46:56 -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
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 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 270880f440 Yapf 2020-02-10 11:56:38 -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 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
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 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
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
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 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 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
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
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 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 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 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
Mark D. Roth 380eb750ec New JSON API 2020-01-29 14:52:19 -08: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 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
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 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 435cf89108 Fix a bug that prevents metadata modification in interceptors 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 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 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 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 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 5f0a70973e Implement connectivity state related APIs 2020-01-14 10:55:26 -08: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 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 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
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 2a342b22a7 Fixes bug with deadline 2020-01-09 00:03:42 +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
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 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 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 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 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
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 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 bb38187221 Add a TODO to remove a.out 2019-11-26 11:18:00 -08:00
Mark D. Roth 4e393dc035 Convert grpc_proxy_mapper to C++. 2019-11-22 12:32:47 -08:00
Yash Tibrewal 3b1d176e9d LogicalThread 2019-11-22 10:38:35 -08:00
Mark D. Roth 0e487a7405 Convert grpc_connector to C++. 2019-11-14 09:45:17 -08: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
Lidi Zheng 918492d3ca Make buildifier happy 2019-11-06 11:10:17 -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
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 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
yihuaz 5570dec9a5
Merge pull request #20916 from yihuazhang/python
Add more documentation on local credentials
2019-11-04 13:03:24 -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 acc6053716 Fix interceptors for unary-unary case 2019-11-01 15:28:48 -07:00
Lidi Zheng 2817afd4e9 Make sure Core aware of gevent Cython objects 2019-10-31 16:41:14 -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 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
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
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
Yash Tibrewal 07ef24344c Regenerate projects 2019-10-24 11:54:20 -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
Richard Belleville 0c6f8dbed3 Remove ChannelOptions from __init__.py 2019-10-23 14:07:47 -07:00
Richard Belleville da9f5f78fe Add ChannelOptions to experimental module 2019-10-23 12:42:34 -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 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 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 f73c8d14e2 Make yapf happy 2019-10-21 16:56:29 -07:00
Lidi Zheng fbe1bc9e8f Suppress the ImportError of ipaddress for Python 2 2019-10-21 16:00:57 -07:00
Lidi Zheng 9c8657d6c0 Merge branch 'master' into revert-20610-revert-20277-grpc-19871/unary_unary_client_aio-implement-timeout 2019-10-21 15:40:46 -07:00
Lidi Zheng ea2e8bce0a Fix the typo 2019-10-21 14:57:22 -07:00
Lidi Zheng 088f033fb2
Merge pull request #20326 from Skyscanner/grpc-19975-switch-to-concrete-classes
Switch to concrete classes in experimental asyncio
2019-10-21 10:30:18 -07:00
Lidi Zheng 08bbbcd751 Remove `asyncio.sleep(0)` 2019-10-21 10:24:31 -07:00
Jan Tattermusch aba7f7bd2b
Merge pull request #20100 from jtattermusch/update_boringssl
Update boringssl and boringssl-with-bazel to latest master
2019-10-21 16:25:28 +02:00
Lidi Zheng 2ced359d78 Adopt reviewer's suggestions 2019-10-18 18:03:36 -07:00
Muxi Yan 64b7febefa Fix ObjC sike issue and update BoringSSL to master 2019-10-18 15:54:37 -07:00
Lidi Zheng a535a6d69f Revert "Revert "Grpc 19871/unary unary client aio implement timeout"" 2019-10-17 16:57:57 -07:00
Lidi Zheng 49c7f1ddf6 Adopt reviewer's advices 2019-10-17 15:17:48 -07:00
Richard Belleville 90cded9c44 WIP. MVP for single-threaded 2019-10-16 22:35:37 -07:00
Richard Belleville 2b4de59b32 Add benchmark 2019-10-16 16:20:49 -07:00
Mark D. Roth dd89123f0d
Merge pull request #20606 from markdroth/xds_client_bootstrap
Second attempt: xds client bootstrap file
2019-10-16 13:28:08 -07:00
Lidi Zheng 3c7cd1543d Make YAPF happy 2019-10-15 18:09:31 -07:00
Lidi Zheng 25be7c93d0 Merge branch 'master' into aio-server 2019-10-15 17:43:51 -07:00
Lidi Zheng 175c8e44b9 Cosmetic changes to increase readability 2019-10-15 17:22:56 -07:00
Nicolas Noble d988d928e4
Revert "Grpc 19871/unary unary client aio implement timeout" 2019-10-15 14:15:20 -07:00
Mark D. Roth 9a276c07fa Revert "Merge pull request #20593 from grpc/revert-20380-xds_client_bootstrap"
This reverts commit 0bd5efa55f, reversing
changes made to f92c283a5d.
2019-10-15 07:33:53 -07:00
Lidi Zheng c6ae98d49a Minimal AsyncIO Server for gRPC
* Extends AsyncIO IO manager to support server-side operations;
* Adds more logic to AsyncSocket class;
* Implements an AsyncIO server that can serve unary-unary handlers;
* Adds a server test with grpc.aio.Channel;
* Support both Bazel / setup.py build.
2019-10-14 15:32:19 -07:00
Jan Tattermusch 13abbd9a75
Revert "xds client bootstrap file" 2019-10-14 16:51:32 +02:00
Mark D. Roth 36319502be
Merge pull request #20380 from markdroth/xds_client_bootstrap
xds client bootstrap file
2019-10-11 09:03:18 -07:00
Mariano Anaya fb3911f243 Implement timeout for the async unary_unary call
Allow passing the ``timeout`` parameter to the asynchronous version of
the ``unary_unary`` call, and use it accordingly.

Maintains the same interface as the synchronous version.

Other changes:

    * Remove default parameters from the internal API methods
    * Make keyword-only arguments in the external-facing public API

Create new exception: ``AioRpcError``.

Define the exception in Cython, exposing a similar interface that the
one returned by the synchronous API (``grpc.RpcError``).

Then mix the class with the ``grpc.RpcError``, dynamically: this can
only be done at run-time because it's not possible to use the Cython
class until all Cython code has been compiled, which happens after the
``grpc`` module has been loaded.

The new ``AioRpcError`` exception lives inside the ``experimental``
module.

Fixes https://github.com/grpc/grpc/issues/19871
2019-10-10 19:54:12 +02:00
Mark D. Roth 2afaec231d xds client bootstrap file 2019-10-09 14:06:48 -07:00
Zhanghui Mao b5cab86b57 fix syntax of language 2019-10-05 12:19:20 +08:00
Mark D. Roth 85a500c13a
Merge pull request #20368 from markdroth/xds_client
Refactor EDS and LRS code from xds LB policy into new XdsClient API.
2019-10-04 14:16:25 -07:00
Mark D. Roth b01072586d Refactor EDS and LRS code from xds LB policy into new XdsClient API. 2019-10-04 11:41:13 -07:00
tanjunchen 64cdea5a07 fix some spelling mistakes in document 2019-10-04 09:07:35 +08:00
Jan Tattermusch 6c763452ab regenerate projects 2019-10-01 02:39:33 -04:00
Pau Freixes e2464b8eba Rename gevent_util file
Since functions implemented by `gevent_util.h` are used also by the
new experimental `Aio` module, the file holding these functions needs
to be renamed to something more meaningful.
2019-09-25 23:17:42 +02:00
Zhanghui Mao ebed4a6b9a fix language grammar errors 2019-09-24 19:15:30 +08:00
Zhanghui Mao 3b6a5a6a01 switch to concrete classes 2019-09-21 17:17:12 +08:00
Jan Tattermusch 4a539ffb7c regenerate 2019-09-20 08:59:00 +02:00
Robert Bradshaw 147d7c1ec5 Fix issue with exception being out of scope in Python 3. 2019-09-19 13:58:32 -07:00
Mark D. Roth d1bca6ff92
Merge pull request #20119 from markdroth/c++_mpscq
Convert mpscq API from C to C++.
2019-09-17 15:24:13 -07:00
Pau Freixes a44e6d76b7 [Aio] Unary unary client call barebones implementation
Implement the minimal stuff for making a unary call with the new
experimental gRPC Python implementation for Asyncio, called Aio.

What has been added:

- Minimal iomgr code for performing the required network and timer
calls.
- Minimal Cython code implementing the channel, call and the callback
context.
- Minimal Python code that mimics the synchronous implementation but
designed to be asynchronous.

Testing considerations:

Tests have to be executed using the `GRPC_ENABLE_FORK_SUPPORT=0`
environment variable for skipping the fork handles installed by
the core library. This is due to the usage of a syncrhonous server
used as a fixture executed in another process.

Co-authored-by: Manuel Miranda <manuel.miranda@skyscanner.net>
Co-authored-by: Mariano Anaya <mariano.anaya@skyscanner.net>
Co-authored-by: Zhanghui Mao <zhanghui.mao@skyscanner.net>
Co-authored-by: Lidi Zheng <lidiz@google.com>
2019-09-11 20:37:45 +02:00
Esun Kim cf444b9cab Regenerate projects 2019-09-10 14:08:50 -07:00
Esun Kim c965ca1494 Pull out configuration from ssl_utils 2019-09-09 11:18:17 -07:00
Mark D. Roth 51d18ecc63 Convert mpscq API from C to C++. 2019-09-05 10:32:36 -07:00
Mark D. Roth 21c5424477 Add API for accessing per-call backend metric data in LB policies. 2019-08-28 12:48:06 -07:00
Lidi Zheng e25e7c921d
Merge pull request #19971 from lidizheng/local
Expose local credentials on Python layer
2019-08-23 10:05:42 -07:00
Lidi Zheng f8624d356f
Merge pull request #20013 from lidizheng/vtable-heap
Make default vtable for pointer argumnet a constant
2019-08-20 16:28:01 -07:00
Lidi Zheng 25f21d4824 Make default vtable for pointer argumnet a constant 2019-08-20 15:42:27 -07:00
Richard Belleville ee99f9aa4c Remove TODO 2019-08-20 14:25:14 -07:00
Richard Belleville 09a270d6ad Gracefully handle errors from callbacks.
In https://github.com/grpc/grpc/issues/19910, it was pointed out that
raising an exception from a Future callback would cause the channel spin
thread to terminate. If there are outstanding events on the channel,
this will cause calls to Channel.close() to block indefinitely.

This commit ensures that the channel spin thread does not die. Instead,
exceptions will be logged at ERROR level.
2019-08-20 14:17:38 -07:00
Richard Belleville 967f55efd6 Add explanatory comment. 2019-08-19 14:20:01 -07:00
Richard Belleville ca2fcd647a Add docstring 2019-08-19 13:36:53 -07:00
Richard Belleville 4f04a80a69 Add note about something seemingly suspect. 2019-08-19 13:27:56 -07:00
Richard Belleville 2a9998bc13 Properly handle exceptions in signal handlers for in-flight outgoing RPCs 2019-08-19 13:19:04 -07:00
Lidi Zheng c45fb12ffb Add experimental API note. 2019-08-16 17:33:19 -07:00
Lidi Zheng 227a7cb47b Adopt reviewer's suggestion 2019-08-16 15:43:06 -07:00
Juanli Shen a802b14be6 Add xds resolver 2019-08-16 15:09:32 -07:00
Lidi Zheng 40fe76ad30 Fix import 2019-08-16 14:17:05 -07:00
Lidi Zheng 0d203d39b8 Adopt reviewers' advice 2019-08-16 11:17:35 -07:00
Lidi Zheng f681fe89af Make yapf happy 2019-08-15 20:16:01 -07:00
Lidi Zheng 5db1ae34b4 Expose local credentials on Python layer 2019-08-15 20:13:39 -07:00
Esun Kim be4e684a82 Migrated tsi/alts from nanopb to upb 2019-08-08 16:39:05 -07:00
Juanli Shen 79f191114e Use EDS in xds LB policy 2019-08-07 22:43:45 -07:00
Richard Belleville 835786a476
Merge pull request #19822 from gnossen/py_proto_library
Separate py_grpc_library and py_proto_library.
2019-08-07 16:33:31 -07:00
Esun Kim c6b0bd08c7 Updated grpclb to use upb 2019-08-07 13:25:49 -07:00
Esun Kim 6ddfb384c1 Added google/protobuf/descriptor.upb.* to google_api_upb 2019-08-07 12:08:06 -07:00
Esun Kim f7454a9876 Modified health_check to use upb proto instead of nanopb 2019-08-07 09:16:08 -07:00
Esun Kim 8dfa3c2255 Remove upb targets from BUILD 2019-08-06 17:40:02 -07:00
Esun Kim f88bd06ee5 Go UPB! 2019-08-06 15:27:14 -07:00
Lidi Zheng 3e84f47d3f Apply the spin wait mechansim 2019-08-02 15:38:29 -07:00
Richard Belleville e1980a7a5a Merge remote-tracking branch 'origin/master' into py_proto_library 2019-08-02 15:02:31 -07:00
Lidi Zheng 42e8bd21b4 Add a workaround for CPython issue 35935 2019-08-02 14:56:58 -07:00
Lidi Zheng 518b55a433 Simplify implementation 2019-08-02 14:56:58 -07:00
Lidi Zheng 59555d5b0c Add timeout argument to wait_for_termination 2019-08-02 14:56:58 -07:00
Lidi Zheng 8f6ee97345 "EXPERIMENTAL API" added in docstring 2019-08-02 14:56:58 -07:00
Lidi Zheng 7257508294 Add a unit test for wait_for_termination 2019-08-02 14:56:57 -07:00
Lidi Zheng 9f6243e824 Add wait_for_termination method to grpc.Server 2019-08-02 14:56:57 -07:00
Karthik Ravi Shankar fcb43f9dee Regenerate projects 2019-08-01 17:34:02 -07:00
Lidi Zheng 7631e410cf
Merge pull request #19586 from gnossen/revert_revert_signal_handling
Revert "Merge pull request #19583 from gnossen/revert_signal_handling"
2019-08-01 17:08:31 -07:00
Richard Belleville 9ac75a6d16 Merge remote-tracking branch 'origin/master' into py_proto_library 2019-08-01 15:25:16 -07:00
Richard Belleville 7b2c8c27b0 Separate py_grpc_library and py_proto_library.
By popular demand, we'll now be offering separate py_grpc_library and
py_proto_library targets sharing the same interface as within google3.
This change necessitated some modifications to how we pull in our own
Python-level dependencies and how we make those available to those
pulling in our project via Bazel.

There is now a grpc_python_deps() Bazel workspace rule that pulls in the
appropriate dependencies, which should be called from the client
project's WORKSPACE file. A test has been added to the bazel/test/
directory to verify that this behavior works as intended.

It's worth noting that the protobuf repository's usage of Starlark
bind() caused a great deal of trouble in ensuring that we could also
pull in six.

This change also required a change in the way generated proto code is
imported in the channelz and health-check modules, as well as in their
associated tests. We were importing them two different ways, each
relative. This resulted in two different module objects being imported
into the process, which were incompatible. I am not sure exactly what
caused this behavior to begin, as this should have been possible before
this PR. As a workaround, I am simply trying two different absolute
imports and using the one that works. This should function both inside
and outside of Bazel environments.
2019-08-01 15:16:22 -07:00
Qiancheng Zhao 29480c4f6b add client idle filter 2019-07-24 10:04:41 -07:00
yunjiaw26 1e607d3dc0
Merge pull request #19544 from yunjiaw26/thread_pool
Threadpool
2019-07-18 15:02:59 -07:00
Lidi Zheng c8a277add4 Several documentation fixes 2019-07-15 16:54:56 -07:00
Lidi Zheng 11e60b8f30 Add documentation for compression enums 2019-07-09 16:50:53 -07:00
Richard Belleville e30dcefeab Revert "Merge pull request #19583 from gnossen/revert_signal_handling"
This reverts commit 1e7ec75eff, reversing
changes made to 6d62eb1b70.
2019-07-08 14:50:49 -07:00
Richard Belleville 2014a519fc Revert "Merge pull request #19481 from gnossen/main_thread_starvation"
This reverts commit 8f044f741f, reversing
changes made to 5ae9afdc55.
2019-07-08 12:50:13 -07:00
Richard Belleville 8f044f741f
Merge pull request #19481 from gnossen/main_thread_starvation
Enforce a finite bound on the time gap between signal receipt and signal handler execution.
2019-07-03 16:21:02 -07:00
Richard Belleville af1b09f7e7 Enforce a Finite Time Gap Bound between Signal Receipt and Signal Handler Execution
Previously, signal handlers were only given a chance to run upon receipt of an
entry in the RPC stream. Since there is no time bound on how long that might
take, there can be an arbitrarily long time gap between receipt of the signal
and the execution of the application's signal handlers.

Signal handlers are only run on the main thread. The cpython implementation
takes great care to ensure that the main thread does not block for an
arbitrarily long period between signal checks.

Our indefinite blocking was due to wait() invocations on condition variables
without a timeout.

This changes all usages of wait() in the the channel implementation to use a
wrapper that is responsive to signals even while waiting on an RPC.

A test has been added to verify this.

Tests are currently disabled under gevent due to
https://github.com/grpc/grpc/issues/18980, but a fix for that has been
found and should be merged shortly.
2019-07-03 13:35:33 -07:00
Yunjia Wang 410451c126 Add threadpool implementation 2019-07-01 14:02:58 -07:00
Yunjia Wang 5b6c9473cd Merge remote-tracking branch 'upstream/master' into mpmcqueue 2019-06-26 13:59:28 -07:00
Soheil Hassas Yeganeh f9516b04d5
Merge pull request #19218 from soheilhy/string-view
Introduce string_view and use it for gpr_split_host_port.
2019-06-26 13:15:52 -04:00
Yunjia Wang 343541c13c Merge remote-tracking branch 'upstream/master' into mpmcqueue 2019-06-25 19:45:18 -07:00
Lidi Zheng 9427d1c9ce
Revert "Surface exceptions in gevent IO manager" 2019-06-21 17:24:05 -07:00
Soheil Hassas Yeganeh ef0f9bf7ec Introduce string_view and use it for gpr_split_host_port. 2019-06-20 23:19:34 -04:00
Yunjia Wang fb05f0bf9c Merge remote-tracking branch 'upstream/master' into mpmcqueue 2019-06-19 16:25:16 -07:00
Yunjia Wang ad22f9d7bf Add delete operator overload 2019-06-19 16:24:59 -07:00
Esun Kim cd27a36924 Regenerate projects 2019-06-18 15:40:50 -07:00
Yunjia Wang 8ebd58b3ba Merge remote-tracking branch 'upstream/master' into mpmcqueue 2019-06-17 17:17:02 -07:00
Yunjia Wang 1def76bf1d Add Makefile 2019-06-17 17:16:46 -07:00
Lidi Zheng 3ab7332769
Merge pull request #19356 from lidizheng/i15880
Surface exceptions in gevent IO manager
2019-06-17 16:47:02 -07:00
Lidi Zheng e0a95c3267 Add more missing functions 2019-06-14 16:53:14 -07:00
Lidi Zheng 536765b2f3 Surface exceptions in gevent IO manager 2019-06-14 15:21:07 -07:00
Lidi Zheng a91728737a
Merge pull request #19292 from mehrdada/clean-del
Clean up Python Channel.__del__ logic
2019-06-11 11:16:30 -07:00
Mehrdad Afshari 9847c6364a Silence pylint 2019-06-10 23:31:51 +00:00
Mehrdad Afshari 45a0e5bd4f Clean up Channel.__del__ logic 2019-06-07 15:54:59 -07:00
Lily Li 195aae6cb5 add compatibility check badge to README 2019-06-06 16:34:48 -07:00
Lidi Zheng c0dd83e9a0 Add documentation about CallCredentials restriction 2019-06-04 11:12:23 -07:00
Lidi Zheng f6f7ef60c6
Merge pull request #19174 from lidizheng/expose-exception
Surface exception from metadata credentails plugin methods
2019-05-29 15:39:06 -07:00
Lidi Zheng d835d1bb1f Surface exception from metadata credentails plugin methods 2019-05-29 10:41:38 -07:00
Richard Belleville 0ebeb40718
Merge pull request #19084 from gnossen/python2-deprecation-notice
Add python deprecation notices.
2019-05-28 13:06:52 -07:00
Srini Polavarapu ec640a53c6 Merge pull request #19105 from gnossen/twine_check_artifacts
Produce Python Wheels with a Valid long_description field
2019-05-28 10:11:34 -07:00
Esun Kim 90fbdc92f5 Roll-forward "Config migration"
This reverts commit 236ae12bb1.
2019-05-20 15:47:24 -07:00
Richard Belleville cb9e2188ab Add python deprecation notices. 2019-05-20 13:05:37 -07:00
Lidi Zheng ebfed6ad7b
Merge pull request #19030 from mehrdada/unsubscribe_all
Unsubscribe all connectivity callbacks on Channel.close
2019-05-17 10:04:57 -07:00
murgatroid99 70e850a023 Merge branch 'master' into cares_windows_platform_detection 2019-05-14 17:41:25 -07:00
Mehrdad Afshari c7343ea03d Unsubscribe all connectivity callbacks on Channel.close 2019-05-14 16:30:57 -07:00
murgatroid99 7743130f64 Consolidate conditional localhost resolution into existing file 2019-05-14 15:26:56 -07:00
Alexander Polcyn 236ae12bb1 Revert "Config migration"
This reverts commit 87905ae5ea.
2019-05-14 14:36:33 -07:00
murgatroid99 90e52f00a1 Moved code back into one file with a #ifdef 2019-05-10 14:47:26 -07:00
murgatroid99 4b4006f833 libuv cares: scope manual localhost resolution to only Windows 2019-05-10 11:15:12 -07:00
Srini Polavarapu 6bc2ff1b5f Regenerate projects 2019-05-10 10:38:59 -07:00
Esun Kim 87905ae5ea Config migration 2019-05-09 12:29:38 -07:00
Michael Lumish 95a4a0ef76
Merge pull request #18809 from murgatroid99/cares_libuv
Add cares glue for libuv event loop
2019-05-02 13:43:52 -07:00
Esun Kim 1518ecbd76 Added new configuration system to core/grp.
More generic configuration system is introduced in order to i) unify the
way how modules access the configurations instead of using low-level
get/setenv functions and ii) enable the customization for where configuration
is stored. This could be extended to support flag, file, etc.

Default configuration system uses environment variables as before so
basically this is expected to work just as it did. This behavior can
change by redefining GPR_GLOBAL_CONFIG_DEFINE_*type* macros.

* Migrated configuration

GRPC_CLIENT_CHANNEL_BACKUP_POLL_INTERVAL_MS
GRPC_EXPERIMENTAL_DISABLE_FLOW_CONTROL
GRPC_ABORT_ON_LEAKS
GRPC_NOT_USE_SYSTEM_SSL_ROOTS
2019-04-30 15:49:24 -07:00
Muxi Yan efbeb750ec
Merge pull request #18814 from muxi/fix-cfstream-build-yaml
Build system fix for default CFStream
2019-04-26 08:14:30 -07:00
Arjun Roy 8ce42f67b2 Shrink arena size by 40 bytes and add additional
alignment options (for cache-alignment).

We shrink by:
1) Removing an unnecessary zone pointer.
2) Replacing gpr_mu (40 bytes when using pthread_mutex_t) with
std::atomic_flag.

We also header-inline the fastpath alloc (ie. when not doing a zone
alloc) and move the malloc() for a zone alloc outside of the mutex
critical zone, which allows us to replace the mutex with a spinlock.

We also cache-align created arenas.
2019-04-24 16:39:03 -07:00
murgatroid99 dc1bcf8762 Consolidate helper function from windows and libuv 2019-04-22 17:31:55 -07:00
Muxi Yan 9e593f721f build system fix for default CFStream 2019-04-19 14:14:48 -07:00
murgatroid99 41871bf7de Add cares glue for libuv event loop 2019-04-18 17:08:51 -07:00
Lidi Zheng 09d18aa659 Propagate KeyboardInterrupt above completion queue 2019-04-16 15:30:48 -07:00
Mark D. Roth 62d9be1533
Merge pull request #18631 from markdroth/pare_down_channel_args_api
Move functions for individual args out of channel_args.{h,cc}.
2019-04-16 07:11:33 -07:00
Richard Belleville f900eec41d Revert "Merge pull request #18727 from grpc/revert_compression"
This reverts commit 8054a731d1, reversing
changes made to c3d3cf8053.
2019-04-11 13:04:54 -07:00
Richard Belleville 167540efd4 Revert "Merge pull request #18564 from grpc/compression"
This reverts commit 9dfeb14be0, reversing
changes made to 7009f2df58.
2019-04-11 10:10:29 -07:00
Richard Belleville 5afd77398e Implement compression API within gRPC Python. 2019-04-09 15:14:03 -07:00
Mark D. Roth eccfecd6a6 Move functions for individual args out of channel_args.{h,cc}. 2019-04-03 13:15:40 -07:00
Lidi Zheng 0231bf3b01 Regenerate projects 2019-03-29 16:24:50 -07:00
Mark D. Roth 934e31d7d1
Merge pull request #18357 from markdroth/address_list_not_in_channel_args
Restructure how addresses and service config are passed from resolver to LB policy
2019-03-27 11:40:44 -07:00
Lidi Zheng c9b4d8347b
Merge pull request #18522 from lidizheng/fix-cython-int
Attempt to not depend on stdint.h
2019-03-26 16:24:25 -07:00
Lidi Zheng 04697287b7 Attempt to not depend on stdint.h 2019-03-26 13:48:39 -07:00
Fabian Holler 8c49802f75 add strsplit.c, strsplit.h files to build and test files
The files are new in the updated cares release.
2019-03-26 13:13:49 -07:00
Mark D. Roth 206592ce9c Restructure how addresses and service config are passed from resolver to LB policy. 2019-03-26 11:57:21 -07:00
Jared Hance 3de283c665 Make gil handling in completion queue more robust
It turns out that the code generation for "with gil" is a bit more
complicated than the logic for re-obtaining the gil at the end of
"with nogil." This is because PyGILState_Ensure seems to, during
interpreter finalization, think it needs to call a new thread
(resulting in a call to cpython new_threadstate) which then segfaults.

Because "with nogil" knows that, prior to executing, it already had
the gil, it doesn't need to set up as much state, and thus the segfault
does not occur.

To avoid this, we just only use "with nogil" within the infinite loop,
and then end the "nogil" block before we check signals. This avoids
needing any "with gil" call at all.

I was able to reliably reproduce the segfault within a few minutes
before the patch by running a binary in a loop (with py3) while
maxing out my machines cpu usage. After the patch, I have not
been able to reproduce the segfault after two hours.

Note that this race can only occur when the user does not properly
clean up all their channels, and is relying on garbage collection to
do so (which isn't guaranteed). However, we want to avoid a segfault
on failure to close because this isn't a good user error and makes it
hard to debug.
2019-03-20 12:01:11 -07:00
Lidi Zheng 0c70b0f008
Merge pull request #18414 from evanj/utf8-encodable
python docs: details are UTF-8 encodable, not just ASCII.
2019-03-19 12:59:22 -07:00
Evan Jones 86991f633d python docs: details are UTF-8 encodable, not just ASCII.
Context detail messages are Unicode strings in both the implementation and
specification. Fix the documentation to make this clearer. The
specification for the Status-Message response field says "Status-Message is
[...] a Unicode string [...] encoded as UTF-8" [1]. The implementation
seems to call _common.encode(), so anything that is UTF-8 encodable works.
For example:

    context.set_code(grpc.StatusCode.ABORTED)
    context.set_details('emoji error: \U0001F600')

Correctly returns a smiley face emoji to the client.
2019-03-18 10:59:18 -04:00
Lidi Zheng c3ecc61867 Use C-Core API to perform time conversion 2019-03-15 11:48:10 -07:00
Lidi Zheng 585582c4a7
Merge pull request #18383 from lidizheng/fix-ctypedef
Use correct C integer types in Cython
2019-03-15 11:31:06 -07:00
Lidi Zheng ec78d0f569 Use correct C integer types in Cython 2019-03-14 19:51:41 -07:00
Yihua Zhang b017c801b6 Add SPIFFE security stack to gRPC core 2019-03-14 15:24:48 -07:00
Richard Belleville 749c52de56 Refcount vtables 2019-03-08 15:31:37 -08:00
Yash Tibrewal abcd5861eb Nuking the poll-cv polling engine 2019-03-07 14:49:24 -08:00
Lidi Zheng c73c724778
Merge pull request #18277 from lidizheng/nogil-unref
Remove GIL for grpc_call_unref
2019-03-06 13:32:22 -08:00
Lidi Zheng 8326ac64e4 Remove GIL for grpc_call_unref 2019-03-06 09:57:30 -08:00
Richard Belleville efa1f8b993 Remove debug prints 2019-03-05 16:11:05 -08:00
Richard Belleville 07bfbec8f9 Fix hanging build 2019-03-05 16:09:31 -08:00
Lidi Zheng f28286b526
Merge pull request #18218 from lidizheng/simplify-batch
Simplify batch operations event interpretation
2019-03-04 12:23:08 -08:00
Lidi Zheng ef42aff699 Simplify batch operations event interpretation 2019-03-01 10:00:04 -08:00
Richard Belleville 1112d52f03 Revert "Merge pull request #18206 from grpc/revert-18182-enable-deadline-propagation"
This reverts commit 63ef07ebb5, reversing
changes made to 046e3e4ab5.
2019-02-28 15:50:20 -08:00
Vijay Pai 4f86edeb23
Revert "Enable deadline propagation" 2019-02-28 10:27:07 -08:00
Yang Gao 40241c5236
Merge pull request #18157 from yang-g/rollbackrollback
Roll-forward PR17308
2019-02-27 17:04:19 -08:00
Richard Belleville b558519d99
Merge pull request #18190 from grpc/new-pylint-errors
Fix new pylint errors
2019-02-27 11:35:46 -08:00
Lidi Zheng ee26faee27
Merge pull request #18133 from mehrdada/cleanup-c_creds
Remove unused ChannelCredentials.c_credentials
2019-02-27 10:36:19 -08:00
Richard Belleville 33be6cd732 Switch pattern for marking unused argument 2019-02-27 10:29:53 -08:00
Richard Belleville 1c05218497 Fix new pylint errors. 2019-02-27 09:43:39 -08:00
Richard Belleville 3c3eb36b36 Yapf 2019-02-26 17:00:23 -08:00
Richard Belleville 795efaa108 Appease the pylint gods 2019-02-26 16:35:19 -08:00
Richard Belleville 8665767aa5 Fix bad merge 2019-02-26 13:12:53 -08:00
Richard Belleville 2286fcd63e Merge branch 'master' into enable-deadline-propagation 2019-02-26 12:35:38 -08:00
Richard Belleville 969f698cf2 Enable deadline propagation 2019-02-26 12:33:53 -08:00
Eric Gribkoff 1c2303c635 use isinstance for internal api to not catch mocks 2019-02-25 21:44:26 -08:00
Lidi Zheng 07b2b54f07
Merge pull request #18116 from lifanov/cstd
generalize macOS workaround for -std=c++11 passed in C mode
2019-02-25 11:09:19 -08:00
yang-g 456f748b2f Revert "Merge pull request #18146 from grpc/revert-17308-shutdown"
This reverts commit 9079e98dfc, reversing
changes made to 76a38bfcc2.
2019-02-25 10:11:06 -08:00
Yang Gao 4bc2ca4de6
Revert "Move grpc_shutdown internals to a detached thread" 2019-02-22 16:34:24 -08:00
Nikolai Lifanov 580b720a39 address comments by ericgribkoff@
o re-add USE_PREBUILT_GRPC_CORE option that was erroneously removed
o fix typo in comment
2019-02-22 15:55:59 -08:00
Lidi Zheng 75df1eccad
Merge pull request #17881 from lidizheng/bzl-py3-fix
[Roll Forward] Enable Python 3 for Bazel to Run Tests
2019-02-22 11:42:42 -08:00
Nikolai Lifanov a916a53347 use str instead of Text to appease Python 2.7
The Python 2.7 Linux test runner doesn't have typing module available.
2019-02-22 11:32:26 -08:00
Mark D. Roth 5f00cfd3bd
Merge pull request #18096 from markdroth/lb_policy_api
Second attempt: LB policy picker API
2019-02-22 10:10:43 -08:00
Nikolai Lifanov 9eb1171dfb be compatible with Python 2 and Python 3
In Python 3, cc_err is going to be bytes().
2019-02-21 17:54:27 -08:00
Mehrdad Afshari 0ac7203777 Removed unused ChannelCredentials.c_credentials 2019-02-21 17:21:35 -08:00
Nikolai Lifanov ad093660ff format with yapf
This was already formatted with yapf, but perhaps I didn't do this
correctly. I copied the diff directly from kokoro build log this
time.
2019-02-21 16:15:33 -08:00
Nikolai Lifanov c1451e83d5 generalize macOS workaround for -std=c++11 passed in C mode
GCC allows this, but notably clang does not. Other systems,
like FreeBSD and some Linux distros ship with clang as default
compiler. While here, switch the approach to filtering out std
flag since the make workaround relies on GNU make syntax and
'make' binary could be bmake and/or gmake could be absent.

The idea to filter the flags was taken from an answer to this
Stack Overflow question:
https://stackoverflow.com/questions/15527611/how-do-i-specify-different-compiler-flags-in-distutils-for-just-one-python-c-ext
2019-02-21 15:49:04 -08:00
Lidi Zheng 9a548969ed
Merge branch 'master' into bzl-py3-fix 2019-02-21 14:14:23 -08:00
Yang Gao b03e014ad8
Merge pull request #17308 from yang-g/shutdown
Move grpc_shutdown internals to a detached thread
2019-02-20 15:37:18 -08:00
Lidi Zheng d209deb14b Revert "Revert "Merge pull request #17644 from lidizheng/bzl-py3""
This reverts commit 7da0aacef2.
2019-02-20 14:07:34 -08:00
Eric Gribkoff ae44187910 Merge branch 'master' into non_blocking_stream 2019-02-20 11:22:25 -08:00
Eric Gribkoff bf7107b9dc comments 2019-02-20 11:00:04 -08:00
Richard Belleville 4f299d84ed Add private _finalize_state method to ServicerContext 2019-02-20 09:44:41 -08:00
yang-g fe3555f0fd Merge with head and resolve conflict 2019-02-19 20:46:51 -08:00
Eric Gribkoff 0346ec2f45 stream_observer->on_next_callback 2019-02-19 14:18:00 -08:00
Eric Gribkoff 9345eac211 non-blocking server streaming for health service 2019-02-19 13:24:31 -08:00
Mark D. Roth aa149fedbb Revert "Merge pull request #18093 from grpc/revert-17770-lb_policy_picker_api"
This reverts commit f327b83706, reversing
changes made to b3b5d63423.
2019-02-19 13:19:24 -08:00
hcaseyal 275296c594
Revert "LB policy picker API" 2019-02-19 11:05:52 -08:00
yang-g 0df63d3c98 Merge branch 'master' into shutdown 2019-02-15 21:51:03 -08:00
Eric Gribkoff b7947776f8
Merge pull request #16513 from ericgribkoff/python_unit_fork_tests
Add fork tests as Python unit tests
2019-02-15 18:31:45 -08:00
yang-g 3c61849461 python changes 2019-02-15 15:48:52 -08:00
Eric Gribkoff 2ea6d3ef0b Add fork tests as Python unit tests 2019-02-15 09:50:46 -08:00
Srini Polavarapu f7f6861720
Merge pull request #18033 from srini100/master
Bump master to v1.20.x and pick "godric" for that release
2019-02-13 12:17:12 -08:00
Mark D. Roth bab8123763 LB policy picker API 2019-02-13 08:30:04 -08:00
Srini Polavarapu b0efc103e3 Regenerate projects 2019-02-12 21:07:42 -08:00
Arjun Roy 195a30bb8b Grpc: Change grpc_handshake and grpc_handshake_mgr to use CPP implementations.
grpc_handshake is renamed to GrpcHandshake, using C++ class definitions
instead of C-style vtable classes. Update callers to use new interfaces.
We use RefCountedPtr to simplify reference tracking.
2019-02-11 11:35:08 -08:00
Eric Gribkoff c5255e9a5e python: do not store raised exception in _Context.abort()
Python 3 exceptions include a `__traceback__` attribute that includes
refs to all local variables. Saving the exception results in leaking
references to the, among other things, the Cython grpc_call wrapper and
prevents garbage collection and release of core resources, even after
the server is shutdown.

See
https://www.python.org/dev/peps/pep-3134/#open-issue-garbage-collection
2019-02-01 09:32:39 -08:00
Eric Gribkoff 7da0aacef2 Revert "Merge pull request #17644 from lidizheng/bzl-py3"
This reverts commit a25828ad78, reversing
changes made to 5176fd80fc.
2019-01-29 13:50:16 -08:00
Yihua Zhang a3d997cbdc Add a TLS credential surface API (experimental) 2019-01-29 10:04:28 -08:00
Lidi Zheng a25828ad78
Merge pull request #17644 from lidizheng/bzl-py3
[gRPC] Enable Python 3 for Bazel to Run Tests
2019-01-28 16:23:33 -08:00
Lidi Zheng 91fde06b12 Remove the dependency of 'six' 2019-01-28 12:12:06 -08:00
Lidi Zheng 1a688982a4 Cast the str type if it is unicode 2019-01-28 11:33:19 -08:00
Eric Gribkoff 196889cdad
Merge pull request #17724 from ericgribkoff/rename_context_hooks
rename census context hooks
2019-01-24 13:45:08 -08:00
Lidi Zheng 0aa05958c2
Merge pull request #17543 from lidizheng/remove-foundation-dep
Remove dependency of grpc.framework.foundation.callable_util
2019-01-18 11:19:12 -08:00
Juanli Shen bbe2587c39 Enable per-channel subchannel pool 2019-01-15 14:15:18 -08:00
Eric Gribkoff 30a95d354c rename census context hooks 2019-01-15 13:04:34 -08:00
Yang Gao 75b8b1e2c6
Merge pull request #17697 from rmstar/remote_network_status_test
Remove network_status_tracker
2019-01-14 10:20:16 -08:00
Eric Gribkoff 4d391b64e1 avoid AttributeError when object init fails 2019-01-11 13:35:02 -08:00
Prashant Jaikumar 95965f71d3 Remove network_status_tracker
Remove network_status_tracker and its unit test as it does nothing. We
can add tests for network status change in another commit.
2019-01-11 12:15:37 -08:00
Eric Gribkoff 8d9190c0dd
Merge pull request #17675 from ericgribkoff/really_dealloc
correctly name __dealloc__ method
2019-01-09 12:01:10 -08:00
Eric Gribkoff 025cb9b1e7 correctly name __dealloc__ method 2019-01-09 10:33:48 -08:00
Richard Belleville ca5c0a8366 Switch to absolute import 2019-01-09 09:43:14 -08:00
apolcyn 26dddbb10d
Merge pull request #16187 from apolcyn/ipv6_resolver_scope_ids
Support named scope id's in grpc_parse_ipv6 on posix platforms
2019-01-08 14:36:20 -08:00
Lidi Zheng 0d931d9c8f Make Python 3 pass all unit tests 2019-01-07 13:41:02 -08:00
Lidi Zheng 814c858f3f Enable Python 3 2019-01-04 18:45:01 -08:00
Sanjay Pujare 94d5587643 Regenerate projects 2019-01-03 15:35:20 -08:00
Richard Belleville a76465c65c
Merge pull request #17600 from grpc/memory-leak
Free grpc_channel_args after creation
2018-12-27 16:42:43 -08:00
Richard Belleville 0daa420417 Free grpc_channel_args after creation 2018-12-27 15:21:12 -08:00
Richard Belleville dd4830eae8 Make gRPC version string available as grpc.__version__ 2018-12-27 13:50:30 -08:00
Alexander Polcyn 00763bc3ea Support named scope id's with ipv6 resolver on posix 2018-12-26 11:03:43 -08:00
Mark D. Roth db9be19f5d
Merge pull request #16008 from markdroth/client_channel_refactor
Refactor request routing code out of client_channel
2018-12-20 13:42:51 -08:00
Lidi Zheng 97453a3d81
Merge pull request #17303 from lidizheng/sanity-python-3
Run pylint test in Python 3
2018-12-20 11:22:37 -08:00
Mark D. Roth 09f57c17ee Refactor request routing code out of client_channel. 2018-12-20 10:10:19 -08:00
Lidi Zheng 71094e25c5 Remove dependency of grpc.framework.foundation.callable_util
* Used in _channel.py, _server.py, and _utilities.py
* This API can trace back to 4 years ago
* The code change ensures the logging info is exactly the same
2018-12-18 11:43:53 -08:00
Eric Gribkoff 468ae0f486 add tracking issue 2018-12-17 08:53:09 -08:00
Eric Gribkoff 082b63e095 Refactor server deallocation 2018-12-17 08:53:09 -08:00
Lidi Zheng e9cae6bba3
Merge pull request #17481 from lidizheng/py-status-2
New abort with grpc.Status API
2018-12-12 16:38:14 -08:00
Richard Belleville bd142d6c46 Actually build CensusContext 2018-12-12 14:59:50 -08:00
Lidi Zheng 087d48a8bd Update the documentation about the status code constraint 2018-12-12 14:31:52 -08:00
Lidi Zheng fd74fcf2a0 New abort with grpc.Status API
* Add `abort_with_status` method in ServicerContext
* Add `Status` interface similar to the design of Details in interceptor
* Add 3 unit test cases for abort mechanism
2018-12-12 13:48:39 -08:00
Richard Belleville e829a81118
Merge pull request #17460 from grpc/enable-census
Add hooks for census context propagation
2018-12-11 14:49:19 -08:00
Richard Belleville 6b3baf2618 Add hooks for census context propagation
Appease the yapf gods

Reformat
2018-12-11 12:59:31 -08:00
Noah Eisen 9e9cae7839
Merge pull request #17456 from ncteisen/socket-pagination
Channelz: Add Pagination to ServerSockets
2018-12-11 12:27:49 -08:00
ncteisen 7b1fc0faa2 Add max_results to ServerSockets 2018-12-11 08:24:40 -08:00
Mark D. Roth c5f344deaf
Revert "Revert "Allow encoding arbitrary channel args on a per-address basis."" 2018-12-11 07:48:14 -08:00
Lidi Zheng 8cb2d0546d Upgrade sanity Docker image to debian:stretch
* Use latest pylint in Python 3.7 (they dropped support for PY2)
* Make latest pylint happy
* Forced to upgrade to shellcheck 0.4.4
* Make shellcheck 0.4.4 happy
* Adopt reviewers' advice to reduce global disabled rules
2018-12-10 16:21:49 -08:00
hcaseyal 27e2ba31bf
Revert "Allow encoding arbitrary channel args on a per-address basis." 2018-12-07 16:13:37 -08:00
Mark D. Roth dedff37b4f Allow encoding arbitrary channel args on a per-address basis. 2018-12-07 12:41:51 -08:00
Eric Gribkoff a324bcaad0 Pre-fix python3 pylint failures 2018-12-06 14:51:00 -08:00
Eric Gribkoff 8998dfcb7a
Merge pull request #17396 from ericgribkoff/creds_close_hang
credentials: call grpc_init/grpc_shutdown when created/destroyed
2018-12-04 18:31:45 -08:00
Eric Gribkoff e699c47c1e credentials: call grpc_init/grpc_shutdown when created/destroyed
This addresses https://github.com/grpc/grpc/issues/17001. Prior to
https://github.com/grpc/grpc/pull/13603, our credentials cython objects
used grpc_initi() and grpc_shutdown() on creation and destruction. These are
now managed differently, but the grpc_init() and grpc_shutdown() calls
are still required. See the MetadataCredentialsPluginWrapper in C++,
which extends the GrpcLibraryCodegen class to ensure that grpc_init()
and grpc_shutdown() are called appropriately.

Without this, we can deadlock when a call to grpc.Channel#close()
triggers grpc_shutdown() to block and wait for all timer threads to
finish: one of these timer threads may end up unreffing the subchannel
and triggering grpc_call_credentials_unref, which will jump back into
Cython and hang when it tries to reacquire the GIL.
2018-12-04 14:29:04 -08:00
Lidi Zheng c339ba3229
Merge pull request #16971 from lidizheng/surface-exceptions
Surface exceptions from Cython to Python as much as possible
Fixed #16643
2018-12-03 16:42:13 -08:00
Lidi Zheng 7ef8fc826c
Merge pull request #17266 from lidizheng/python-channelz
Channelz Python wrapper implementation
2018-11-29 16:10:32 -08:00
Eric Gribkoff 3a47e2c41d
Merge pull request #17307 from ericgribkoff/create_server_format
fix docstring on grpc.server
2018-11-29 09:40:03 -08:00
Lidi Zheng 99f248ae12 Remove the `del` hack and skip server related test cases 2018-11-28 14:49:28 -08:00
Lidi Zheng d75abb6663 Adding comment about `del` about #17258 2018-11-28 14:32:36 -08:00
Eric Gribkoff d9f656a911 fix docstring on grpc.server 2018-11-28 11:13:06 -08:00
Lidi Zheng 53476eced4 Adopt reviewer's suggestions
* Correct the StatusCode
* Format code
* Use @staticmethod
* Fix typo
2018-11-28 10:30:39 -08:00
Mehrdad Afshari 8199aff7a6 Fix Python blocking interceptors facing RpcError
RpcError should be returned from the continuation intact,
not raised.
2018-11-28 00:53:46 -08:00
Lidi Zheng 43599facf4 Channelz Python wrapper implementation
* Expose the C-Core API in Cython layer
* Handle the object translation
* Create a separate package for Channelz specifically
* Handle nullptr and raise exception if seen one
* Translate C++ Channelz unit tests
* Adding 5 more invalid query unit tests

Adding peripheral utility for grpcio-channelz package
* Add to `pylint_code.sh`
* Add to Python build script
* Add to artifact build script
* Add to Bazel
* Add to Sphinx module list
2018-11-27 17:27:39 -08:00
Lidi Zheng 3adca9ff93 Surface exceptions from Cython to Python as much as possible 2018-11-27 12:11:09 -08:00
Ruslan Nigmatullin f8f711ae4c [cython] Declare symbols once 2018-11-26 22:12:16 -08:00
Lidi Zheng 4bc98acfd7
Merge pull request #17281 from lidizheng/issue-16718
Raise the exception while credential initialization
2018-11-26 10:35:20 -08:00
Lidi Zheng b7fd18daa4 Raise the exception while credential initialization 2018-11-26 10:15:14 -08:00
Lidi Zheng e0d9692fa3
Merge pull request #17268 from mehrdada/remove-beta-elements-from-bazel
Remove beta module dependency from the Python Bazel package
2018-11-21 15:56:50 -08:00
Mehrdad Afshari e69c1b960f Remove BUILD.bazel files from beta code elements
Beta code elements are going to get deprecated and
Bazel support is much newer, so Bazel users are
not supposed to accidentally depend on beta code
elements.  Preventing Bazel from building and
including beta code elements makes our tests pass
without depending on beta in grpcio target and
helps avoid including that dependency accidentally
if you are using Bazel.
2018-11-21 13:40:10 -08:00
Yash Tibrewal 248e304671 Merge branch 'master' into httpplumbing 2018-11-21 11:48:41 -08:00
Mehrdad Afshari 989af50e1d Remove beta modules from the Python Bazel package 2018-11-21 00:17:25 -08:00
Muxi Yan f3e4ae633e Regenerate projects 2018-11-19 15:24:53 -08:00
Yash Tibrewal fc332d2c92 Merge master 2018-11-16 11:11:04 -08:00
Juanli Shen 8a880801ae Add support for LB config in service config 2018-11-15 13:31:27 -08:00
Yihua Zhang 3fefdde3cc remove ALTS shared resources 2018-11-13 09:44:28 -08:00
Lidi Zheng 9b65b40247 Label wait-for-ready argument in multicallables as experimental 2018-11-12 13:57:59 -08:00
Richard Belleville ecd9063424 Use single NullHandler for whole library
I was trying to get a feel for what the rest of the python ecosystem
does with its logging, so I looked into the top few libraries on pypi:

urllib3 maintains a logger for not quite every module, but for each
one that does heavy lifting. The logger name is `__name__`, and no
handlers are registered for any module-level loggers, including
NullHandler. Their documentation spells out how to configure logging
for the library.

They explicitly configure a library root-level logger called `urllib3`
to which they attach a `NullHandler`. This addresses the "no handlers
could be found" problem.

Their tests explicitly configure handlers, just like ours do.

scrapy is more hands-on. It provides a configuration module for its
logging and a whole document on how to handle logging with scrapy. It
looks like log.py's whole reason for existence is making sure that a
handler is attached to to the scrapy handler at startup.

I think the extra complexity here is because scrapy also offers a CLI,
so there has to be some way to configure logging without resorting to
writing python, so I felt we didn't need to resort to this added
complexity.

---

Based on all of the libraries I've looked at, I think our current
approach is reasonable. The one change I would make is to explicitly
configure a `grpc` logger and to only attach a `NullHandler` to it
instead of putting the burden on the author of each new module to
configure it there.

With this change, I have

- Configured a logger in each module that cares about logging
- Removed all NullHandlers attached to module-level loggers
- Explicitly configured a `grpc` logger with a `NullHandler` attached

Resolves: #16572
Related: #17064
2018-11-09 08:47:42 -08:00
Lidi Zheng 678ea08950
Merge pull request #16919 from lidizheng/wait-for-ready
Add wait-for-ready semantics
2018-11-07 11:10:23 -08:00
Lidi Zheng a7a3f5b42e
Merge pull request #17074 from lidizheng/python-doc-gen
The new gRPC Python documentation generator
2018-11-07 11:08:19 -08:00
Lidi Zheng cabe8d8f10 New Python documentation generation
* Use templates instead of generating them every time
* Theme changed
* Add grpc_* modules
* APIs grouped
* No documentation for class members without docstring
* Add docstring for status code
2018-11-06 18:07:03 -08:00
Lidi Zheng 4821221e3a Add wait-for-ready semantics
* Include unit tests to test default behaviour, disable behaviour, enable behaviour of the wait-for-ready mechanism
* Import flags constants from grpc_types.h
* Use WaitGroup to wait for TRANSIENT_FAILURE state in unit test
2018-11-06 17:16:52 -08:00
Lidi Zheng 88150dbe2c
Merge pull request #17128 from lidizheng/add-comment-to-commands-py
Add background about gRPC Python's building process on macOS
2018-11-06 17:05:55 -08:00
Lidi Zheng 03841be6ce Add background about the special condition 2018-11-06 16:12:27 -08:00
Jan Tattermusch 7517b839ac
Merge pull request #17057 from jtattermusch/faster_python_build
Add python monkey-patch for parallel build_ext compilation
2018-11-06 12:13:18 +01:00
Lidi Zheng 2a1fbccb2c
Merge pull request #16976 from benjaminp/remove-pkg_resources
Replace pkg_resources with pkgutil.
2018-11-05 17:00:46 -08:00
Lidi Zheng b8a9989005 Add support for utf-8 error messages
* Both server and client should be fine with utf-8 error messages now
* Adding an interop test: special status message
2018-11-05 13:31:02 -08:00
yihuaz 5e9c9792b5
Merge pull request #16773 from yihuazhang/alts_tsi_handshaker_use_pollset_set
Use gRPC thread model (i.e., pollset_set) in ALTS TSI implementation
2018-11-02 11:05:54 -07:00
Noah Eisen 53657b5de3
Merge pull request #17050 from ncteisen/channelz-sockets
Channelz: Socket Tracks Addresses
2018-11-01 23:39:51 -04:00
Benjamin Peterson 187f7e4e4c Replace pkg_resources with pkgutil.
pkg_resources (part of setuptools) is overkill for reading resource files. The standard library module pkgutil can do that just fine.
2018-11-01 17:01:12 -07:00
Yihua Zhang cd768ec12a use gRPC thread model 2018-11-01 16:26:46 -07:00
Richard Belleville b741454fe4
Merge pull request #17064 from gnossen/fix-logging
Fix logging
2018-11-01 16:11:28 -07:00
Lidi Zheng f091ba1b66
Merge pull request #17008 from stub42/yay_destructors
Handle missing globals in Python Channel destructors
2018-11-01 14:15:16 -07:00
ncteisen 44b262c361 fix build and sanity 2018-10-31 21:11:28 -07:00
ncteisen 1a3c2d3e3a Move uri_parser to lib 2018-10-31 14:14:09 -07:00
Jan Tattermusch 185a0a7028 add python monkey-patch for parallel build_ext compilation 2018-10-31 09:01:01 +01:00
Richard Belleville 4d086ef0f4 Fix various mind-numbing typos 2018-10-30 18:53:00 -07:00
Richard Belleville 839722adc5 Add NullHandler to avoid warnings about no handler 2018-10-30 18:16:53 -07:00
Richard Belleville 1e05d48d2d Revert "Configure module level loggers with basicConfig()"
This reverts commit a20e2073c1.
2018-10-30 17:53:50 -07:00
ncteisen 3cb8b0b8cb Move uri_parser to common spot 2018-10-30 11:39:26 -07:00
Lidi Zheng 4e5ee57000 Change flag to `REQUIRE_CUSTOM_LIBRARIES_opt` 2018-10-30 10:00:55 -07:00
Lidi Zheng 7502a2311a
Try cleaner separation
* reduce possible contamination of environment variables
2018-10-29 22:48:35 -07:00
Lidi Zheng 688db0ec5b
Remove the environment variable changing line
* This commit failed `tools/run_tests/artifacts/build_artifact_csharp.sh`
* It doesn't make any sense!
2018-10-29 21:14:49 -07:00
Lidi Zheng 9569ebe770 Add reference to the issue 2018-10-29 16:38:20 -07:00
Lidi Zheng 465886533f Ensure libboringssl.a is always built for Python 2018-10-29 16:35:21 -07:00
Stuart Bishop 11ab724b97
Handle missing globals in Python Channel destructors
If the last reference to a Python object is at module scope, when
its destructor is run before program termination it may find that
the globals it requires no longer exist. Destructors of objects
likely to be stored at module global scope need to check that
globals exist before attempting to use them, to avoid warnings
being printed by the Python interpreter.

See grpc#17004
2018-10-26 00:54:21 +07:00
Mark D. Roth 496d0676c8
Merge pull request #16507 from markdroth/health_checking_client
Health checking client
2018-10-24 13:17:01 -07:00
Mark D. Roth f85fd026e3 Client-side health checking support. 2018-10-24 12:29:04 -07:00
Yihua Zhang 81bc942cd8 security connector refactor 2018-10-22 09:37:48 -07:00
Vishal Powar a33e796575 Changes to register xds plugin init and shutdown.
Also,
 - Changes to extract grpclb_proto into its own build target
 - Remove client_load_reporting_filter from xds plugin.
2018-10-18 12:43:42 -07:00
Lidi Zheng 118e134ded fix Exception throw for invalid channel args
* unit test included
* throw ValueError exception from Cython to Python
* prevent the deconstruction method from failing when Channel initialization failed
2018-10-14 23:33:58 -07:00
Stanley Cheung e5ce1e36e6 Regenerate projects 2018-10-08 15:50:50 -07:00
hcaseyal a46ac13db3
Merge pull request #16735 from hcaseyal/delete_lookup_table
Delete hpack lookup table
2018-10-01 15:22:05 -07:00
Hope Casey-Allen 4772a743e8 Delete hpack lookup table 2018-09-28 13:47:04 -07:00
Vijay Pai be18cedf90 Delete epollsig poller and tests using it 2018-09-22 08:07:47 -07:00
hcaseyal 5bb69e0f01
Merge pull request #16488 from hcaseyal/hpack_static_table
Hpack changes part 1: make grpc use the static hpack table on the encode path and optimize encoding
2018-09-20 09:32:59 -07:00
Hope Casey-Allen 327c514fe7 Some reorganizing to respond to code review comments 2018-09-19 13:50:25 -07:00
Mehrdad Afshari 3586ac1c99 Fix SSL channel credential when an argument is None 2018-09-17 11:08:00 -07:00
Nathaniel Manista 9eebb6d13d
Merge pull request #16378 from ghostwriternr/module-level-logger-fix
Configure module level loggers with basicConfig().
2018-09-06 17:45:50 +02:00
Ruslan Nigmatullin dcc0a223c6 [bazel] Fix python BUILD rules
* Add missing cython sources
* Make grpcio a library as it is not a binary
2018-09-04 23:19:57 +00:00
Juanli Shen 35501ad1df
Merge pull request #16467 from AspirinSJL/bump_master
Bump version to 1.16.0-dev
2018-08-27 18:34:38 -07:00
Yash Tibrewal 8d47cd4992
Revert "Revert "Fathom tcp changes"" 2018-08-27 14:56:01 -07:00
Juanli Shen 8ceb27a324 Regenerate projects 2018-08-27 14:27:55 -07:00
Jan Tattermusch 97ba943f17
Revert "Fathom tcp changes" 2018-08-27 12:43:20 +02:00
Yash Tibrewal f71fd84e42 more stuff 2018-08-24 17:05:30 -07:00
Yash Tibrewal aab47cbdf2
Merge pull request #15941 from yashykt/fathomtcpchanges
Fathom tcp changes
2018-08-24 12:27:56 -07:00
Eric Gribkoff 3d1dacd73d Check poll strategy in core fork handler and log error if unsupported 2018-08-23 09:40:39 -07:00
Eric Gribkoff acc020caf7 Support tracking and closing fds post-fork in ev_poll_posix
This extends gRPC Python's fork compatibility to Mac OS, which does not support
epoll

The changes are a no-op if fork support is disabled
2018-08-23 09:40:39 -07:00
Mehrdad Afshari 77b7133244
Merge pull request #16435 from mehrdada/move-cred-wrapper-into-credentials.pyx
Move _server_cert_config_fetcher_wrapper to credentials.pyx.pxi
2018-08-23 08:42:04 -07:00
Eric Gribkoff dcbfa70226
Merge pull request #16432 from ericgribkoff/allow_pthread_atfork_mac
Define the allow pthread atfork macro for gRPC Python MacOS builds
2018-08-22 21:01:58 -07:00
Mehrdad Afshari 3a5da64e5d Move _server_cert_config_fetcher_wrapper to credentials.pyx.pxi 2018-08-22 18:25:18 -07:00
Eric Gribkoff b59d8674d2 Python post-fork handler: exit if grpc shutdown fails 2018-08-22 13:07:22 -07:00
Eric Gribkoff 0ff641a246 Define the allow pthread atfork macro for gRPC Python MacOS builds 2018-08-22 12:25:08 -07:00
Eric Gribkoff f8cf7ee56d Support gRPC Python client-side fork with epoll1
A process may fork after invoking grpc_init() and use gRPC in the child
if and only if the child process first destroys all gRPC resources
inherited from the parent process and invokes grpc_shutdown().
Subsequent to this, the child will be able to re-initialize and use
gRPC. After fork, the parent process will be able to continue to use
existing gRPC resources such as channels and calls without interference
from the child process.

To facilitate gRPC Python applications meeting the above constraints,
gRPC Python will automatically destroy and shutdown all gRPC Core
resources in the child's post-fork handler, including cancelling
in-flight calls (see detailed design below). From the client's
perspective, the child process is now free to create new channels and
use gRPC.
2018-08-22 10:34:54 -07:00
Naresh a20e2073c1
Configure module level loggers with basicConfig()
Module level loggers were introduced to gRPC Python in 06e1683, but
missed configuring these, leading to 'No handler found for module'
errors. Using the root logger implicitly calls basicConfig() which does
the basic configuration for the logging system by creating a
StreamHandler with a default Formatter and adding it to the logger. But
this is not the case for module level loggers.

Fix this issue by explicitly calling logging.basicConfig().
2018-08-17 12:24:58 +00:00
Vijay Pai 381bcab8bd Move a file from src/cpp to src/core since core depends on it 2018-08-16 15:44:19 -07:00
Paul Petit 33e5c0d091 Replace is by == for a status comparison
This worked fine with CPython, but the condition
was always evaluated to False with Pypy, causing
bugs down the road.
Tested with Pypy 6.0.
2018-08-16 11:35:30 +02:00
Yash Tibrewal 556775d7c7 Merge master 2018-08-13 10:53:06 -07:00
Eric Gribkoff ea7c0a60c5
Merge pull request #16296 from ericgribkoff/close_segfault_fix
Check if Python channel is closed before starting core ops
2018-08-10 13:35:24 -07:00
tdbhacks bcd747d42d Added system roots feature to load roots from OS trust store
Added a flag-guarded feature that allows gRPC to load TLS/SSL
roots from the OS trust store. This is the Linux-specific
implementation of such feature.
2018-08-09 11:01:31 -07:00
Eric Gribkoff 5a664d7260 check if channel is closed before starting core ops 2018-08-09 09:02:32 -07:00
Nathaniel Manista 4725386352
Merge pull request #15993 from ghostwriternr/python_bazel_2
Minimal Bazel BUILD files for grpcio Python.
2018-08-03 06:56:12 +02:00
Mehrdad Afshari f61e16144e Add op index support for custom hooks 2018-08-02 09:56:52 -07:00
Naresh 848fd9d75f
Minimal Bazel BUILD files for grpcio Python
Follow-up on the additions in #15992. Pad the grpcio Python package
with necessary BUILD files along with 2 simple tests.
2018-08-02 14:46:36 +00:00
Mehrdad Afshari c666aa6151 Add low-level Cython debug/expansion hooks 2018-08-02 02:30:08 -07:00
Mehrdad Afshari 603b82c559 Add a matching _unwrap_grpc_arg 2018-07-31 11:43:40 -04:00
Mehrdad Afshari fbfebd8e4e Add Cython functionality to directly wrap grpc_arg 2018-07-30 22:24:36 -07:00
Alexander Polcyn 9896c64186 Revert "Merge pull request #16158 from apolcyn/revert_windows_breakage"
This reverts commit d9e8f86675, reversing
changes made to 04847aeb1e.
2018-07-27 01:38:26 -07:00
Alexander Polcyn f34c653936 Revert "Merge pull request #15797 from apolcyn/windows_compile_and_sort"
This reverts commit ae8d3efc3a, reversing
changes made to e41215e181.
2018-07-26 14:32:07 -07:00
Alex Polcyn 1b1d5e52e7 Get c-ares to compile and do address sorting on windows 2018-07-25 13:21:43 -07:00
Srini Polavarapu 8c9af7464c Regenerate projects 2018-07-19 09:52:56 -07:00
Yash Tibrewal f0397933b0 Fathom TCP level changes. TracedBuffer for keeping track of all buffers
to be traced. Adding tests for Fathom and TracedBuffer. A lot more.
Please read PR description.
2018-07-16 16:28:15 -07:00
ncteisen afb9829819 Fix the muddled linkeage of channelz 2018-07-06 15:34:54 -07:00
Yihua Zhang c5f1eda10f implement loca credentials 2018-07-02 13:29:27 -07:00
David G. Quintas 3acf8e6207
Merge pull request #15840 from dgquintas/common_nanopb
Update to use the canonical version of LB proto
2018-06-22 16:04:32 -07:00
Juanli Shen f5f1d57d7a Add load reporting filter 2018-06-22 10:00:48 -07:00
David Garcia Quintas f3955ba711 Update to use the canonical version of LB proto 2018-06-21 17:46:31 -07:00
ncteisen 68d4f50f77 Merge branch 'master' of https://github.com/grpc/grpc into channelz 2018-06-19 14:00:52 -07:00
Mark D. Roth 9e3e64604d
Merge pull request #15274 from JackOfMostTrades/verify-callback-core
Create verify_peer_options when creating ssl credentials to support a peer verification callback
2018-06-19 10:00:16 -07:00
Jim King 01cbab60f3
Merge pull request #15070 from Vizerai/filter_port
Adding opencensus grpc plugin with bazel support.
2018-06-18 17:01:26 -07:00
Alexander Polcyn 7eda61937e Separate the posix part of the c-ares driver 2018-06-15 13:14:52 -07:00
ncteisen c14e95fc63 Merge branch 'master' of https://github.com/grpc/grpc into channelz 2018-06-15 11:13:46 -04:00
Srini Polavarapu d6616280d3
Merge pull request #15694 from srini100/bump-to-v1.14
Bump master to v1.14
2018-06-14 19:57:13 -07:00
Nathaniel Manista a5530e9e36 Specify thread-safety of grpc-created channels 2018-06-14 22:04:46 +00:00
Mehrdad Afshari b291f186be Refactor: reorder 2018-06-14 13:57:50 -07:00
Mehrdad Afshari 56142a5dbf Refactor: avoid calling with_call API
Avoid calling the public self.with_call
API internally and opt for sharing the
method body in a separate private method
and calling that instead.
2018-06-14 13:17:00 -07:00
ncteisen f92460e539 Merge branch 'master' of https://github.com/grpc/grpc into channelz 2018-06-13 23:00:07 -07:00
Mehrdad Afshari a33b807507 Re-raise grpc.RpcError instead of eating it 2018-06-13 16:32:00 -07:00
Mehrdad Afshari e9cbad592e Refactor: rename _LocalFailure to _FailureOutcome 2018-06-13 15:39:03 -07:00
Mehrdad Afshari e2ebd89a5f Optimize blocking intercepted stream-unary calls
Change the blocking stream-unary call code path to rely
on the underlying synchronous API, as opposed to calling
the Future-based underlying async API and invoking `.result()`
on the returned Future object immediately, which can be
resource-intensive.
2018-06-13 15:39:03 -07:00
Mehrdad Afshari 32919791c7 Optimize blocking intercepted unary-unary calls
Change the blocking unary-unary call code path to rely
on the underlying synchronous API, as opposed to calling
the Future-based underlying async API and invoking `.result()`
on the returned Future object immediately, which can be
resource-intensive.
2018-06-13 15:39:03 -07:00
Ian Haken 68eff58df6 Create verify_peer_options when creating ssl credentials in order to expose a verification callback option.
These options are not yet exposed to languages outside of core.
2018-06-12 12:59:37 -07:00
Nathaniel Manista 759eb90d2c
Merge pull request #15707 from ghostwriternr/fix-cython-file-endings
Update grpc_gevent cython files to include .pxi.
2018-06-11 16:01:42 -07:00
Nathaniel Manista b436d56d8b
Merge pull request #15689 from nathanielmanistaatgoogle/generic-rpc-handler-validation
Check conformance to grpc.GenericRpcHandler type.
2018-06-11 16:00:48 -07:00
Naresh 435c6f8d1e
Update grpc_gevent cython files to include .pxi
All files under `grpc/_cython/_cygrpc` in grpcio Python package
are used as include files and thus have a .pxi file extension.
grpc_gevent implementation was added in 1bfff8e, but didn't include the
.pxi file extension. Update these file names.
2018-06-11 23:34:59 +05:30
Srini Polavarapu c79c156307 Regenrate projects 2018-06-08 17:01:18 -07:00
Mehrdad Afshari 92a06353e2
Merge pull request #15682 from mehrdada/bump-pylint
Bump pylint to 1.9.2
2018-06-08 15:21:29 -07:00
Nathaniel Manista 369d827445 Check conformance to grpc.GenericRpcHandler type 2018-06-08 21:07:14 +00:00
Nathaniel Manista 8872a312c3
Merge pull request #14879 from santoshankr/python_ssl_session_cache_lru
TLS session resumption support for Python clients.
2018-06-08 11:31:33 -07:00
Mehrdad Afshari d6547ea1a4 Change exception type to AssertError 2018-06-08 09:14:12 -07:00
Mehrdad Afshari f07f6c9a87 Remove comment that is no longer relevant 2018-06-08 08:31:30 -07:00
Mehrdad Afshari ebb176780b Implement abstract methods _LocalFailure inherits 2018-06-07 23:17:27 -07:00
Mehrdad Afshari a99945d500 Fix arguments-differ pylint warning 2018-06-07 23:12:10 -07:00
Mehrdad Afshari 4b7223d334 Remove unnecessary pylint suppressions 2018-06-07 22:52:51 -07:00
Mehrdad Afshari 0aaeedcbd4 Fix inconsistent-return-statements pylint warnings 2018-06-07 22:50:23 -07:00
Mehrdad Afshari c48acb86fd Fix code to pass len-as-condition pylint test 2018-06-07 22:39:42 -07:00
Nathaniel Manista 06e1683c7c
Merge pull request #14557 from ghostwriternr/py-custom-logger
Update logging in Python to use module-level logger.
2018-06-07 19:31:46 -07:00
Santosh Ananthakrishnan fd4c5dd031 TLS session resumption support for Python clients
This change adds an experimental ssl_session_cache_lru function to the
Python API that returns an encapsulated grpc_ssl_session_cache (#14483).
Python clients may use this object as an argument for the
grpc.ssl_session_cache channel option if they wish to cache and resume
TLS sessions with a server.
2018-06-07 22:20:31 +00:00
Nathaniel Manista b441dbbc2c
Merge pull request #15666 from nathanielmanistaatgoogle/15662
Retain references to channel arguments.
2018-06-07 13:14:03 -07:00
Nathaniel Manista 9c86b20bac Retain references to channel arguments
This works around issue 15662 which is not as easy to implement as I
would prefer it to be.
2018-06-06 21:57:39 +00:00
ncteisen c3c6e064b3 Add basic support for GetChannel 2018-06-05 16:59:25 -07:00
kpayson64 f423280a90
Merge pull request #15607 from kpayson64/upmerge_changes
Upmerge changes
2018-06-04 13:19:27 -07:00
kpayson64 b26b2af1db Merge remote-tracking branch 'upstream/v1.12.x' into upmerge_changes 2018-06-01 10:42:08 -07:00
kpayson64 0647b03296 Use gevent greenlets for metadata callbacks 2018-05-31 17:35:48 -07:00
Augie Fackler 38689e6587 Python: wordsmith documentation on Server.stop()
@nathanielmanistaatgoogle and I just had a good session helping me
figure out how to use this API correctly, and this rewording of the
documentation was the result.
2018-05-31 17:25:58 -04:00
Naresh 2e113ca6b2 Update logging in Python to use module-level logger
All logging in Python so far was done with the root logger, resulting
in logs like: `ERROR:Exception calling application:`. With module-level
loggers, the logs will instead include the module in which the
exception is raised: `ERROR:grpc._server:Exception calling application:`
2018-05-31 08:08:25 +00:00
Vizerai e501a3d3fd Merge branch 'master' of https://github.com/Vizerai/grpc into filter_port 2018-05-29 10:45:32 -07:00
Jan Tattermusch 272cdca728 regenerate projects 2018-05-24 14:46:33 -07:00
Noah Eisen 654ecedd03
Merge pull request #15341 from ncteisen/registry++
C++-ify the ChannelzRegistry, Adds Generic Object Support
2018-05-17 19:34:15 -07:00
ncteisen bba8840a4b Change filename to channelz 2018-05-17 15:07:51 -07:00
Noah Eisen 0b8b9a08e2 Surfaces debug_error_string to Python API
In case of error, the user can access call.debug_error_string()
which contains a string representation of error from the c core.
2018-05-17 07:42:02 -07:00
Mehrdad Afshari 4ecc5d8225 Regenerate projects 2018-05-14 22:42:39 -07:00
kpayson64 4fad281ce8 Merge remote-tracking branch 'upstream/master' into fork_exec_ctx_check 2018-05-11 12:20:11 -07:00
Vizerai 41e4cedb70 Adding opencensus grpc plugin.
Rebasing to merge commits.
2018-05-10 11:41:15 -07:00
jiangtaoli2016 274840e4d3 Migrate SSL_transport_security TSI to new TSI handshaker API 2018-05-09 14:42:48 -07:00
kpayson64 6d6c780ffc Merge remote-tracking branch 'upstream/master' into remove_cleanup_thread 2018-05-03 15:50:56 -07:00
Mehrdad Afshari 2d43a45ad1 Regenerate projects 2018-05-02 22:49:52 -07:00
Mehrdad Afshari e388cdfb63 Regenerate projects 2018-05-02 22:38:37 -07:00
Nathaniel Manista 72a85b1b2d
Merge pull request #15254 from nathanielmanistaatgoogle/12531
Add grpc.Channel.close.
2018-05-02 18:36:46 -07:00
Nathaniel Manista bccd32dafa Add grpc.Channel.close 2018-05-02 23:59:15 +00:00
Nathaniel Manista c955125c32
Merge pull request #15132 from nathanielmanistaatgoogle/12531
Keep Core memory inside cygrpc.Channel objects.
2018-05-02 13:30:05 -07:00
Nathaniel Manista ca7ba4d0ac Keep Core memory inside cygrpc.Channel objects
This removes invocation-side completion queues from the _cygrpc API.
Invocation-side calls are changed to no longer share the same lifetime
as Core calls.

Illegal metadata is now detected on invocation rather than at the start
of a batch (so passing illegal metadata to a response-streaming method
will now raise an exception immediately rather than later on when
attempting to read the first response message).

It is no longer possible to create a call without immediately starting
at least one batch of operations on it. Only tests are affected by this
change; there are no real use cases in which one wants to start a call
but wait a little while before learning that the server has rejected
it.

It is now required that code above cygrpc.Channel spend threads on
next_event whenever events are pending. A cygrpc.Channel.close method
is introduced, but it merely blocks until the cygrpc.Channel's
completion queues are drained; it does not itself drain them.

Noteworthy here is that we drop the cygrpc.Channel.__dealloc__ method.
It is not the same as __del__ (which is not something that can be added
to cygrpc.Channel) and there is no guarantee that __dealloc__ will be
called at all or that it will be called while the cygrpc.Channel
instance's Python attributes are intact (in testing, I saw both in
different environments). This commit does not knowingly break any
garbage-collection-based memory management working (or "happening to
appear to work in some circumstances"), though if it does, the proper
remedy is to call grpc.Channel.close... which is the objective towards
which this commit builds.
2018-05-02 18:24:47 +00:00