aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/python/grpcio/grpc/_server.py
Commit message (Collapse)AuthorAge
* Refactor server deallocationGravatar Eric Gribkoff2018-12-17
|
* New abort with grpc.Status APIGravatar Lidi Zheng2018-12-12
| | | | | | * 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
* Add hooks for census context propagationGravatar Richard Belleville2018-12-11
| | | | | | Appease the yapf gods Reformat
* Revert "Configure module level loggers with basicConfig()"Gravatar Richard Belleville2018-10-30
| | | | This reverts commit a20e2073c1c53cbdd81a4fb750982a0b13e0c24e.
* Configure module level loggers with basicConfig()Gravatar Naresh2018-08-17
| | | | | | | | | | | 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().
* Merge pull request #15689 from ↵Gravatar Nathaniel Manista2018-06-11
|\ | | | | | | | | nathanielmanistaatgoogle/generic-rpc-handler-validation Check conformance to grpc.GenericRpcHandler type.
| * Check conformance to grpc.GenericRpcHandler typeGravatar Nathaniel Manista2018-06-08
| |
* | Change exception type to AssertErrorGravatar Mehrdad Afshari2018-06-08
| |
* | Fix inconsistent-return-statements pylint warningsGravatar Mehrdad Afshari2018-06-07
|/
* Update logging in Python to use module-level loggerGravatar Naresh2018-05-31
| | | | | | | 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:`
* Remove CleanupThreadGravatar kpayson642018-04-30
| | | | | This is no longer needed with the addition of a close() API that allows clean shutdown.
* Merge pull request #14107 from nathanielmanistaatgoogle/12531Gravatar Nathaniel Manista2018-01-26
|\ | | | | Elide cygrpc.ChannelArg and cygrpc.ChannelArgs.
| * Elide cygrpc.ChannelArg and cygrpc.ChannelArgsGravatar Nathaniel Manista2018-01-26
| |
* | Merge pull request #13965 from evanj/python-abort-fixGravatar kpayson642018-01-12
|\ \ | |/ |/| python: Context.abort should fail RPC even for StatusCode.OK
| * python: Context.abort should fail RPC even for StatusCode.OKGravatar Evan Jones2018-01-12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | grpc.ServicerContext.abort is documented to always raise an exception to terminate the RPC. The code argument "must not be StatusCode.OK." However, if you do pass StatusCode.OK, the RPC terminates successfully on the client side, but returns None. _server.py: If the user accidentally passes StatusCode.OK, treat it as StatusCode.UNKNOWN. This is what happens if the user accidentally passes something that is not a StatusCode instance. Additionally set details to ''. _metadata_code_details_test.py: update test to verify the behavior of abort with invalid codes.
* | Elide cygrpc.TimespecGravatar Nathaniel Manista2018-01-10
|/
* Upgrade yapf to 0.20.0Gravatar Mehrdad Afshari2018-01-02
| | | | Upgrade yapf version to 0.20.0 and reformat Python files.
* Reform cygrpc.OperationTag and cygrpc.EventGravatar Nathaniel Manista2017-12-31
| | | | | | Rather than single classes they are now broken up into class families with each class containing only those fields and methods that are needed in the context in which the class is used.
* Reform cygrpc.OperationGravatar Nathaniel Manista2017-12-21
| | | | | | | | | It is now a family of classes conforming to an interface rather than a single class no single instance of which makes use of all behavior scoped to the class. It also now only uses gRPC Core memory for the time of a single batch rather than for the entire lifetime of the instance.
* Fixes race condition in Python server shutdownGravatar Ken Payson2017-12-14
| | | | | | | | | | | | | | | | | | | 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.
* Add gRPC Python service-side interceptor machineryGravatar Mehrdad Afshari2017-12-12
|
* Introduce ServicerContext.abort to abort an RPCGravatar Mehrdad Afshari2017-12-10
| | | | | | | | | | | | 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.
* Elide cygrpc.OperationsGravatar Nathaniel Manista2017-12-08
|
* Streamline metadata in gRPC PythonGravatar Nathaniel Manista2017-12-08
|
* Enable wrong-import-order lintGravatar Nathaniel Manista2017-06-24
|
* auto-fix most of licensesGravatar Jan Tattermusch2017-06-08
|
* Expose Auth Context in PythonGravatar Ken Payson2017-05-11
|
* Fix Python poll() server spinlock bugGravatar Ken Payson2017-03-28
|
* Add max_requests argument to serverGravatar Ken Payson2017-03-17
| | | | If the server is already serving max requests, return RESOURCE_EXHAUSTED
* Fix and enable redefined-outer-name lintGravatar Nathaniel Manista2017-03-03
|
* Fix and enable unused-variable lintGravatar Nathaniel Manista2017-03-02
| | | | | | | | | | In _server.py start_server_batch_result is removed because start_server_batch can only ever fail as a result of a programming defect in gRPC Python and not the application. This differs from some analogous-appearing points in _channel.py where the result of start_client_batch is checked because at those points it is possible for a failure to indicate a programming defect on the part of the application.
* Fix and enable no-member lintGravatar Nathaniel Manista2017-02-22
|
* Re-run yapf code, and pin versionGravatar Ken Payson2017-02-06
|
* Revert "Revert "Metadata handling rewrite""Gravatar Craig Tiller2017-01-23
| | | | This reverts commit 5e01e2ac977655aa074faf7fde0a74298f5e4c55.
* Revert "Metadata handling rewrite"Gravatar Craig Tiller2017-01-20
|
* Merge pull request #9420 from nathanielmanistaatgoogle/time_remainingGravatar Nathaniel Manista2017-01-20
|\ | | | | Fix grpc._server._Context.time_remaining.
| * Fix grpc._server._Context.time_remainingGravatar Nathaniel Manista2017-01-20
| | | | | | | | A weak test is included; proper test coverage will come later.
* | Merge github.com:grpc/grpc into metadata_filterGravatar Craig Tiller2017-01-17
|\|
| * Run Python formattingGravatar Masood Malekghassemi2017-01-17
| |
* | Paper-over Python errorsGravatar Masood Malekghassemi2017-01-13
|/ | | | | | | This reads directly off of the slices rather than ref'ing and unref'ing them. There's likely some silliness w.r.t. interned slices and references to them outliving their associated call objects, but we are just ignoring that for now.
* Revert "Add configurable exit grace periods and shutdown handlers"Gravatar Ken Payson2016-12-08
| | | | This reverts commit 3045a379aa76ce9ee930f427daa4ee799b0162aa.
* Add configurable exit grace periods and shutdown handlersGravatar Ken Payson2016-12-01
| | | | | | | | The server cleanup method is untested. The join() function that exposes it is only called by the internals of threading.py, and we don't hold a reference to the server thread to explicitly join() it, and I'm not sure we should add a reference just for this purpose. Moreover, the threading.py only calls join(None), the code path in question isn't even exercised by the internals of threading.py. Its just there to make sure we properly follow the join(timeout) semantics.
* Merge pull request #8324 from grpc/v1.0.xGravatar Nathaniel Manista2016-10-07
|\ | | | | v1.0.x → master upmerge.
| * Drop unnecessary return statementGravatar Nathaniel Manista2016-10-04
| |
* | Add parameter for server optionsGravatar Ken Payson2016-09-19
|/
* Merge pull request #7160 from nathanielmanistaatgoogle/handlers-optionalGravatar kpayson642016-07-08
|\ | | | | Make handlers optional at server construction
* | Removed cython client-side call trackingGravatar Ken Payson2016-07-07
| | | | | | | | | | | | This ensures sync calls get cancelled after a keyboard interrupt, as well as all calls getting destroyed before grpc_shutdown()
| * Make handlers optional at server constructionGravatar Nathaniel Manista2016-07-07
|/
* Changed default string type to be strGravatar Ken Payson2016-06-29
| | | | | | | | | This impacts the following APIs: Metadata: Key is always a str, Value is bytes for binary metadata, str otherwise Call Details: str type gRPC method: str type hostname/target: str type
* Merge pull request #6904 from ↵Gravatar Jan Tattermusch2016-06-14
|\ | | | | | | | | nathanielmanistaatgoogle/unimplemented-for-cardinality-violation UNIMPLEMENTED status for cardinality violation