Commit Graph

1392 Commits

Author SHA1 Message Date
Mehrdad Afshari 5b6b591343
Merge pull request #13789 from grpc/v1.8.x
Upmerge changes from v1.8.x to master
2017-12-14 13:56:36 -08:00
kpayson64 f5649c7e96
Merge pull request #13786 from kpayson64/fix_python_server_race
Fixes race condition in Python server shutdown
2017-12-14 13:11:35 -08:00
Ken Payson 8179b9523a Fixes race condition in Python server shutdown
When we set the call state to "CANCELLED" after
grpc_cancel_all_calls, we would block other start batch
operations from happening. The rpc_state for the cancelled
call would still be in the server's rpc_states set, but it
would never get removed because there were no active batches
for the call, and the only place we remove from rpc_states is
when a batch completes.

It is better to rely on c-core's cancellation. Once a call
is cancelled, all subsequent ops on that call will return
immediately with a cancellation error.

The RLock() change is due to the possibility that
_on_call_completed
gets invoked immediately when the call has already completed when the
rpc_future callback is created.
2017-12-14 12:07:07 -08:00
Nathaniel Manista e1c4021726 Reallow out-of-spec metadata
This restore unsupported, de facto behavior that was dropped in
80516e884a but that it turns out a lot of folks
have been using.
2017-12-14 18:52:37 +00:00
Mehrdad Afshari 0ba96edc41 v1.8.0-pre2 is now v1.8.0 2017-12-12 14:01:25 -08:00
Mehrdad Afshari 108500f194 Add gRPC Python client-side interceptor machinery 2017-12-12 12:01:07 -08:00
Mehrdad Afshari 68e1978e9e Add gRPC Python service-side interceptor machinery 2017-12-12 12:01:02 -08:00
Mehrdad Afshari c5ba665b22 Merge remote-tracking branch 'origin/v1.8.x' 2017-12-11 11:32:11 -08:00
ncteisen 128366374f Yapf-ize grpcio/grpc_.py 2017-12-11 16:14:24 -08:00
Mehrdad Afshari 9bc44e3829 Introduce ServicerContext.abort to abort an RPC
gRPC Python required RPCs terminating with non-OK status code to still
return a valid response value after calling set_code, even though the
response value was not supposed to be communicated to the client, and
returning None is considered a programming error.

This commit introduces an alternative mechanism to terminate RPCs by
calling the `abort` method on `ServicerContext` passed to the handler,
which raises an exception and signals to the gRPC runtime to abort the
RPC with the specified status code and details.
2017-12-10 20:45:13 -08:00
Nathaniel Manista d14035c55a
Merge pull request #13688 from nathanielmanistaatgoogle/12531
Elide cygrpc.Operations.
2017-12-08 14:40:37 -08:00
Nathaniel Manista c5c1216a65 Elide cygrpc.Operations 2017-12-08 20:55:15 +00:00
Nathaniel Manista 5cff6d3c2d
Merge pull request #13672 from nathanielmanistaatgoogle/12531
Streamline metadata in gRPC Python.
2017-12-08 10:50:22 -08:00
Nathaniel Manista 80516e884a Streamline metadata in gRPC Python 2017-12-08 11:07:35 +00:00
Yash Tibrewal caaf416eba virtual destructor in exec_ctx, remove unneeded flush in grpc_shutdown and remove grpc_exec_ctx from .pxi files in python 2017-12-07 21:09:11 -08:00
Nathaniel Manista ae74a320dc Fix Beta API metadata looseness 2017-12-08 03:02:32 +00:00
Mehrdad Afshari aaf63d9277 Upmerge changes from v1.8.x to master 2017-12-05 10:01:41 -08:00
Mehrdad Afshari bfdaefef43 Refactor: rename 'e' to 'exception' 2017-12-04 21:49:45 -08:00
Mehrdad Afshari b030ccae05 Return UNKNOWN on GenericRpcHandler failure
A GenericRpcHandler registered on a gRPC Server is not supposed to raise
an exception and if it does so it is considered a programming defect.
However, gRPC is supposed to respond to the client with an UNKNOWN
status code.  Previously, this situation was left unhandled and the
client ended up receiving a response with CANCELLED status code.

This commit fixes the issue https://github.com/grpc/grpc/issues/13629.
2017-12-04 15:21:49 -08:00
Nathaniel Manista 562544151d
Merge pull request #13603 from nathanielmanistaatgoogle/credentials
Change client-side credentials' use of gRPC Core.
2017-12-04 08:39:08 -08:00
Nathaniel Manista 0c1f59e6d5
Merge pull request #13593 from nathanielmanistaatgoogle/12531
Refactor _plugin_wrapping.
2017-12-04 07:52:27 -08:00
Nathaniel Manista dfe8403280 Change client-side credentials' use of gRPC Core
Rather than allocating gRPC Core memory when instantiated and
retaining it until deleted, gRPC Python's credentials objects now
offer methods to create gRPC Core structures on demand.
2017-12-03 22:33:19 +00:00
Nathaniel Manista 992b8c10b4 Fix some doc string formatting and content 2017-12-03 21:11:46 +00:00
Nathaniel Manista 460e0aa9e6 Refactor _plugin_wrapping 2017-12-01 22:41:10 +00:00
Nathaniel Manista 6267d779b5
Merge pull request #13587 from nathanielmanistaatgoogle/access-token-auth-metadata-plugin
Correct AccessTokenAuthMetadataPlugin name.
2017-12-01 10:39:12 -08:00
Nathaniel Manista 6288753742 Correct AccessTokenAuthMetadataPlugin name
It was never itself a "call credentials" of any sort.
2017-12-01 16:00:17 +00:00
Vijay Pai 195cf1ebfd Move histogram to test/core/util 2017-11-30 15:02:04 -08:00
Nicolas "Pixel" Noble 7d199c95a2 Merge branch 'master' of https://github.com/grpc/grpc into v1.8.x 2017-11-30 09:08:01 +01:00
Nicolas "Pixel" Noble 361f8108e4 Merge branch 'master' of https://github.com/grpc/grpc into upmerge-from-v1.7 2017-11-29 19:31:42 +01:00
Nathaniel Manista 95bcb4924b Avoid unsupported and unintended API self-use
"Do not make undocumented and unsupported use of one part of an API
from within the implementation of another part of the same API" is one
of the rules of Abstraction Club. Not sure if it's important enough to
be the first two rules, but it's up there.
2017-11-28 22:51:07 +00:00
Nathaniel Manista 6e6e31e75b grpc.CallCredentials doc string correction 2017-11-28 22:21:14 +00:00
Mehrdad Afshari d39d007e8f
Merge pull request #13515 from mehrdada/bump-master-version
Bump 1.8.0-dev to 1.9.0-dev
2017-11-28 13:30:54 -08:00
Mehrdad Afshari 14e96f9ae8 Bump 1.8.0-dev to 1.9.0-dev 2017-11-27 17:14:15 -08:00
Mehrdad Afshari 552a7ca088 Bump 1.8.0-dev to 1.8.0-pre1 2017-11-27 16:51:21 -08:00
Vijay Pai 891254292e Remove lockfree stack, again 2017-11-22 10:22:28 -08:00
Nathaniel Manista bb9333c485
Merge pull request #13486 from nathanielmanistaatgoogle/elide-local-field
Elide local field by directly returning values.
2017-11-22 04:29:26 -08:00
Nathaniel Manista 9e8a6922ca
Merge pull request #13485 from nathanielmanistaatgoogle/const
Add missing const.
2017-11-21 19:03:01 -08:00
Nathaniel Manista 0eacb45a48 Elide local field by directly returning values 2017-11-22 02:10:52 +00:00
Nathaniel Manista 77d2c721cb Add missing const 2017-11-22 01:42:56 +00:00
Nathaniel Manista 76c27a5768
Merge pull request #13479 from nathanielmanistaatgoogle/certificate-configuration
Avoid abbreviation in Python API.
2017-11-21 13:38:51 -08:00
Nathaniel Manista 1628da0136 Avoid abbreviation in Python API
I should have requested this during code review of bcf083fa90
but it slipped my mind.
2017-11-21 19:22:44 +00:00
Nathaniel Manista ec4791254e
Merge pull request #13188 from cauthu/python-server-cert-reload
Add Python support for server SSL certificate reloading.
2017-11-20 16:26:44 -08:00
Nicolas "Pixel" Noble 18a6837bb0 Merge branch 'v1.7.x' of https://github.com/grpc/grpc 2017-11-21 00:36:21 +01:00
Giang Nguyen bcf083fa90 Add Python support for server SSL cert reloading
Previously, a secure server is configured with SSL credentials during
initialization, and those credentials will be used for the lifetime of
the server. If the user wants the server to use new credentials, the
user has to restart the server, resulting in server downtime. This
change enables the user to optionally configure the server with a
"certificiate config fetcher," such that on every new client
connection, the server will call the config fetcher before performing
the handshake, allowing the user application to optionally specify new
certificate configuration for the server to use (the fetcher can
return a "no change" and the server continues to use its current
certificate configuration).
2017-11-20 23:09:56 +00:00
ncteisen dd34f3caf6 Inline closure 2017-11-12 20:18:24 -08:00
Alexander Polcyn 9f5163eb85 Bump v1.7.x branch to 1.7.2 2017-11-01 11:07:28 -07:00
Jim King 3e0769957e
Merge pull request #13106 from Vizerai/census_update
Cleaning up census code.
2017-10-31 11:10:00 -07:00
Yuchen Zeng 9e6837d397
Merge pull request #12732 from y-zeng/connectivity_watcher
Client channel backup poller
2017-10-30 14:47:24 -07:00
Yuchen Zeng 0bad30a244 Use backup pollser instead of connectivity watcher 2017-10-30 12:06:52 -07:00
Yuchen Zeng f8ed4fa7f4 convert connectivity_watcher to cpp file 2017-10-30 12:06:52 -07:00