Commit Graph

296 Commits

Author SHA1 Message Date
Soheil Hassas Yeganeh ad1b3e5094 Introduce grpc_byte_buffer_reader_peek and use it for Protobuf parsing.
grpc_byte_buffer_reader_next() copies and references the slice. This
is not always necessary since the caller will not use the slice
after destroying the byte buffer.

A prominent example is the protobuf parser, which
calls grpc_byte_buffer_reader_next() and immediately unrefs the slice
after the call. This ref() and unref() calls can be very expensive
in the hot path.

This commit introduces grpc_byte_buffer_reader_peek() which
essentialy return a pointer to the slice in the buffer, i.e.,
no copies, and no refs.

QPS of 1MiB 1 Channel callback benchmark increases by 5%.
More importantly insructions per cycle is increased by 10%.

Also add tests and benchmarks for byte_buffer_reader_peek()

This commit reaplies 509e77a5a3
2019-03-21 06:03:45 -04:00
Vijay Pai 50576179f8 Merge pull request #17978 from yashykt/interceptorcleanup1
Global Interceptor Registration allowed only once
2019-03-20 19:13:55 -07:00
Vijay Pai 7b3a120295 Address reviewer comments 2019-03-18 16:51:15 -07:00
Vijay Pai 93f0a3f653 Address reviewer comments 2019-03-18 15:37:35 -07:00
Vijay Pai 04a6b8467c Support callback on cancellation of server-side unary RPCs 2019-03-18 12:00:57 -07:00
Vijay Pai 8c3d4a7dfd Merge pull request #18072 from vjpai/client_streaming_hold
C++ callback API: Add support for client-side extra-reaction operations via Holds
2019-03-16 10:27:36 -07:00
Vijay Pai 797b01a85e Merge pull request #17760 from Norman0406/fix-interceptor_memory_leak
Fixing memory leak in interceptor by removing unsued send_status_
2019-03-16 10:14:19 -07:00
Vijay Pai 48ce4ca939 Add support for extra-reaction operations via Holds 2019-03-15 16:17:01 -07:00
Karthik Ravi Shankar 2bf934f97d Revert "Fold opencensus into grpc_impl namespace" 2019-03-15 10:20:06 -07:00
Norman Link 3d28761029 Fixing memory leak in interceptor by removing unsued send_status_ 2019-03-13 21:42:02 +01:00
Vijay Pai 85f8e0f4b0 Merge pull request #18289 from vjpai/unimplemented_rpc
C++ callback API: properly handle and test unimplemented RPC method
2019-03-13 12:47:36 -07:00
Karthik Ravi Shankar b3889585a1 Revert "Moving ::grpc::ResourceQuota to ::grpc_impl::ResouceQuota" 2019-03-12 12:25:38 -07:00
Karthik Ravi Shankar cc632f8121 Merge pull request #18220 from grpc/grpc_namespace
Moving ::grpc::ResourceQuota to ::grpc_impl::ResouceQuota
2019-03-12 11:20:27 -07:00
Karthik Ravi Shankar 276c4dc593 Merge pull request #18223 from grpc/grpc_namespace_opencensus
Fold opencensus into grpc_impl namespace
2019-03-08 15:45:03 -08:00
Vijay Pai b7f14fdab8 Properly implement unimplemented RPCs at callback-only server 2019-03-06 23:43:34 -08:00
Karthik Ravi Shankar f7dd48b2b6 Moving ::grpc::ResourceQuota to ::grpc_impl::ResouceQuota
This change moves ResourceQuota class fron grpc namespace to grpc_impl
namespace.
2019-03-06 10:12:23 -08:00
Karthik Ravi Shankar b606cad6cc Fold opencensus into grpc_impl namespace
Moving opencensus into grpc_impl namespace..
2019-03-04 15:47:37 -08:00
Vijay Pai 05d8ddfc6e Support callback-based generic service 2019-03-04 13:13:12 -08:00
Soheil Hassas Yeganeh 509e77a5a3 Introduce grpc_byte_buffer_reader_peek and use it for Protobuf parsing.
grpc_byte_buffer_reader_next() copies and references the slice. This
is not always necessary since the caller will not use the slice
after destroying the byte buffer.

A prominent example is the protobuf parser, which
calls grpc_byte_buffer_reader_next() and immediately unrefs the slice
after the call. This ref() and unref() calls can be very expensive
in the hot path.

This commit introduces grpc_byte_buffer_reader_peek() which
essentialy return a pointer to the slice in the buffer, i.e.,
no copies, and no refs.

QPS of 1MiB 1 Channel callback benchmark increases by 5%.
More importantly insructions per cycle is increased by 10%.

Also add tests and benchmarks for byte_buffer_reader_peek()
2019-03-04 14:17:46 -05:00
Vijay Pai 2eb25c871e Avoid build errors 2019-02-26 03:08:06 -08:00
Vijay Pai 857e622e6f Merge pull request #18098 from vjpai/try_2
Reduce starting callback counter to exclude client-side StartCall
2019-02-22 19:52:29 -08:00
Vijay Pai 147c61b2a4 Exclude StartCall from starting callback counter value 2019-02-20 21:13:44 -08:00
Yuwei Huang 3cbf4f50ea Remove extra semicolons after function definitions
We are planning to enable -Wextra-semi flag in our project but some
header files in gRPC have extra semicolons that violates the check and
blocks us from enabling the flag.

This change removes unnecessary semicolons in the code. Note that having
semicolon after the GRPC_ABSTRACT macro technically also violates the
check, but it's fine for us since they are not used in public headers,
and it will be confusing to have lines ending only with GRPC_ABSTRACT,
so I keep them as-is.
2019-02-20 17:58:30 -08:00
Nicolas Noble 2ad245cb0c Revert "Folding the Channel class into the grpc_impl namespace." 2019-02-15 09:52:15 -08:00
Yash Tibrewal 73353ad281 Merge branch 'master' into interceptorcleanup1 2019-02-13 12:47:47 -08:00
Yash Tibrewal 50497c2317 Reviewer comments 2019-02-13 12:46:07 -08:00
Nicolas "Pixel" Noble 3e30c38f1c Adressing comments. 2019-02-13 00:20:50 +01:00
Nicolas "Pixel" Noble 63db582516 Merge branch 'master' of https://github.com/grpc/grpc into channel 2019-02-13 00:19:23 +01:00
Yash Tibrewal c71b2f4fb7 Global Interceptor Registration allowed only once 2019-02-07 19:36:51 -08:00
Yash Tibrewal 89ee1a8b10 Improved interception docs 2019-02-07 19:18:40 -08:00
Vijay Pai 45c684f894 Allow an alarm to be set again after firing 2019-02-05 14:07:40 -08:00
Vijay Pai 8521c0394b Address optional reviewer comments 2019-02-01 15:21:13 -08:00
Vijay Pai e56c832c0d Replace list of outstanding callback requests with count only 2019-02-01 13:44:50 -08:00
Yash Tibrewal 5e2e61b6e5 Note on conditions of usage 2019-01-28 16:37:02 -08:00
Yash Tibrewal 3a2cfe50ec Rever copyright changes 2019-01-28 16:18:49 -08:00
Yash Tibrewal 786598a6ff Merge branch 'master' into interceptorcqavalanching 2019-01-28 11:54:39 -08:00
Yash Tibrewal 9b7b1f4447 Merge pull request #17662 from yashykt/sendmsgintdoc
Update Send message interception methods docs
2019-01-28 11:53:36 -08:00
Vijay Pai 7a164229db Address reviewer comments 2019-01-25 10:25:08 -08:00
Yash Tibrewal 9dd8a13439 Restructure code to handle cases exposed by the callback api 2019-01-24 19:03:55 -08:00
Nicolas "Pixel" Noble cabbd35014 Reformat. 2019-01-24 23:42:12 +01:00
Yash Tibrewal 4dcb14ec9e Fix codegen_test_minimal 2019-01-24 13:05:05 -08:00
Yash Tibrewal d347ec7ce0 Register for cq avalanching when interceptors are going to be run 2019-01-23 19:11:51 -08:00
Nicolas "Pixel" Noble 2fd079ff7c Channel folding. 2019-01-23 21:40:07 +01:00
Vijay Pai fab05d336c Dynamic callback requesting, graceful server shutdown, and separate ExecCtx for callbacks 2019-01-23 11:21:50 -08:00
Mehrdad Afshari b12dd1be05 Fix GrpcCodegen initialization
Initializing GrpcCodegen as a global static variable
is problematic because it is possible for it to get
destructed before the last instance of `GrpcLibraryCodegen`
gets destructed and leaves the program dealing with
a dangling pointer (imagine a scenario where another
thread is using gRPC resources and the main thread
tries to join it in an object's destructor after
main ends and CoreCodegen is destructed.)

In fact, Google style guide explicitly forbids
non-trivially-destructible global variables of static
storage duration for this and other reasons and the
solution in this commit is among the recommended
workarounds referenced in
https://google.github.io/styleguide/cppguide.html#Static_and_Global_Variables
2019-01-10 22:12:03 -08:00
Yash Tibrewal 73b1a918e4 Slight update to grammar. Can probably be improved more 2019-01-08 09:28:09 -08:00
Yash Tibrewal b8a542cd23 Update Send message interception methods docs 2019-01-08 09:20:15 -08:00
Vijay Pai 1730c06c48 Merge pull request #17655 from yashykt/callbackwriteoptions
Use the WriteOptions in Client Callback API
2019-01-08 08:15:43 -08:00
Yash Tibrewal 361acdbed1 Use the WriteOptions in Client Callback API 2019-01-07 17:33:16 -08:00
Yash Tibrewal b35b449166 Update docs according to #17630 2019-01-07 17:20:58 -08:00