Commit Graph

11847 Commits

Author SHA1 Message Date
Arjun Roy a3fe7c0c90 Renamed macros for memory alignment 2019-04-29 15:38:41 -07:00
Arjun Roy 333ba8feae Use aligned_alloc directly for grpc_core::Arena 2019-04-29 15:37:17 -07:00
Arjun Roy 9c882bc725
Merge pull request #18894 from arjunroy/arena_create_alloc_coalesce
Coalesce arena create/first alloc for grpc_call.
2019-04-29 15:34:41 -07:00
Arjun Roy ed43236377 Coalesce arena create/first alloc for grpc_call. 2019-04-29 12:07:37 -07:00
Soheil Hassas Yeganeh e74bde7702
Merge pull request #18899 from soheilhy/grpc-fix-h2-typo
Fix a typo in chttp2 stream initialization.
2019-04-29 14:16:47 -04:00
Jan Tattermusch 7820b44c20
Merge pull request #18060 from frazenshtein/master
Pass WSA_FLAG_NO_HANDLE_INHERIT flag to the WSASocketA() to avoid handle leaking on the Windows in case of using CreateProcess() on the server
2019-04-29 19:09:41 +02:00
Soheil Hassas Yeganeh 069547e944 Fix a typo in chttp2 stream initialization.
Found this during performance optimizations. We always reinitialize
this to the correct value, so this wasn't caught in tests.
2019-04-28 17:14:05 -04:00
Arjun Roy 664d4d984b Removed gpr_atm from UserData 2019-04-26 18:23:15 -07:00
Arjun Roy b779a954b1 Inlined md_ref/unref and saved some unnecessary ops 2019-04-26 16:07:58 -07:00
murgatroid99 9f3c78177f Resolve final comments 2019-04-26 15:40:53 -07:00
Yash Tibrewal 6fac033568
Merge pull request #18746 from yashykt/svc_cfg2
Service config changes Part 2
2019-04-26 15:27:39 -07:00
Yash Tibrewal 5ff8df71d4 Add default constructor back to optional 2019-04-26 13:41:30 -07:00
Yang Gao 9e0f3b475e
Merge pull request #18869 from yang-g/init_test
Start tcp servers in place without sending them to executor
2019-04-26 13:40:40 -07:00
Yash Tibrewal 79c3990d50 Move declaration order to how it was earlier in optional, and if check for uri 2019-04-26 13:17:44 -07:00
Yash Tibrewal d3035a3d5f Revert changes to optional 2019-04-26 12:38:36 -07:00
Yash Tibrewal b476a30e69 Merge branch 'master' into svc_cfg2 2019-04-26 11:43:12 -07:00
Yash Tibrewal 73dbdccc5d Reviewer comments and cleanup 2019-04-26 11:42:48 -07:00
Yash Tibrewal a2cea50402
Merge pull request #18874 from yashykt/atleast
s/atleast/at\ least
2019-04-26 10:46:51 -07:00
Arjun Roy 887ef819a7
Merge pull request #18857 from arjunroy/memset_remove
Removed some unnecessary memset operations in core.
2019-04-25 17:34:00 -07:00
Yash Tibrewal 9345b7e276 s/atleast/at\ least 2019-04-25 17:15:30 -07:00
Yash Tibrewal 1214dff100 Clean up 2019-04-25 17:07:38 -07:00
Yash Tibrewal 156d743c37 Reviewer comments 2019-04-25 16:38:10 -07:00
Arjun Roy cf9301f964 Removed some unnecessary memset operations in core. 2019-04-25 13:59:10 -07:00
murgatroid99 e457584c05 Address comments 2019-04-25 11:07:36 -07:00
yang-g 9cac231163 Inline start the tcp servers 2019-04-25 09:07:27 -07:00
Arjun Roy 4fa4f8e74b
Merge pull request #18786 from arjunroy/arena_shrink
Shrink arena size by 40 bytes and cache align.
2019-04-24 21:48:25 -07:00
Yash Tibrewal 71ecf17eb7 clang tidy 2019-04-24 17:31:29 -07:00
Yash Tibrewal f7c8e8be62 clang tidy 2019-04-24 16:51:59 -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
Yash Tibrewal 51fd073b7c Don't add API to Optional 2019-04-24 16:17:32 -07:00
Yash Tibrewal a045170818 Merge branch 'master' into svc_cfg2 2019-04-24 15:45:16 -07:00
Yash Tibrewal a2316142b2 Reviewer comments 2019-04-24 15:29:46 -07:00
Jan Tattermusch 59ccf3f12b
Merge pull request #18846 from jtattermusch/upmerge_1_20_x
Upmerge changes from v1.20.x to master
2019-04-24 21:22:11 +02:00
murgatroid99 2fa5759d79 Fix missing include in windows file 2019-04-24 09:41:18 -07:00
Mark D. Roth ad7ccf6f6b
Merge pull request #18596 from markdroth/c++_call_combiner
Convert call_combiner to C++.
2019-04-24 06:53:38 -07:00
Jan Tattermusch 8c5e4367ef Merge remote-tracking branch 'upstream/v1.20.x' into HEAD 2019-04-24 03:08:12 -04:00
Yash Tibrewal 7ee19a0b6b Reviewer comments - mainly make ParsedLoadBalancingConfig refcounted 2019-04-23 18:14:03 -07:00
Juanli Shen 438cb44378 Add fallback-at-startup into xds 2019-04-23 17:06:23 -07:00
rmstar 07f5c11748
Merge pull request #18806 from rmstar/cronet_trace
Add trace flag in cronet transport
2019-04-23 16:30:07 -07:00
murgatroid99 634cece3f3 Fix sanity tests 2019-04-23 15:51:53 -07:00
murgatroid99 33722ff1c6 Put callback behind a combiner, cancel callbacks in shutdown 2019-04-23 15:31:30 -07:00
Mark D. Roth ce3ff86763 Convert call_combiner to C++. 2019-04-23 15:27:06 -07:00
Prashant Jaikumar f36e08e6dd Add trace flag in cronet transport 2019-04-23 14:09:52 -07:00
Arjun Roy abf75e2cd7
Merge pull request #18807 from arjunroy/md_eq_static
Fast-pathed grpc_mdelem_eq for known static cases.
2019-04-23 14:03:42 -07:00
Yash Tibrewal edd817a46f Reviewer comments 2019-04-23 12:10:08 -07:00
Karthik Ravi Shankar 4f4476e00f Make the exector to LONG from SHORT 2019-04-23 10:17:13 -07:00
Jan Tattermusch 9af9f11760 Revert "Enable SIO_LOOPBACK_FAST_PATH on Windows"
This reverts commit f5f5ee31a2.
2019-04-23 08:19:41 +02:00
Yash Tibrewal 4309a98b66 Health checking service name to be passed as a channel arg for now 2019-04-22 21:18:47 -07:00
Yash Tibrewal 70839d966f Reviewer comments 2019-04-22 19:12:11 -07:00
murgatroid99 dc1bcf8762 Consolidate helper function from windows and libuv 2019-04-22 17:31:55 -07:00
Muxi Yan 6d0a7936bf
minor fix in CFStream 2019-04-22 14:19:20 -07:00
SataQiu bca4a6db2c fix some spellings mistakes 2019-04-21 11:07:21 +08:00
Yash Tibrewal baa52808f1 Use a single copy of CreateErrorFromVector from ServiceConfig 2019-04-19 15:46:16 -07:00
Yash Tibrewal 07e899f5f3 Separate out message size parsing into a different file to avoid build issues 2019-04-19 14:15:59 -07:00
Arjun Roy ffb0b63b59
Merge pull request #18407 from arjunroy/slice_ref_devirt
grpc_slice_refcount devirtualization
2019-04-19 14:03:19 -07:00
Karthik Ravi Shankar 56e34854ca Fix review comments and clang fixes. 2019-04-19 13:52:55 -07:00
Karthik Ravi Shankar d243f3dbe3 Merge branch 'master' into callback-rpc-lock 2019-04-19 12:59:04 -07:00
Karthik Ravi Shankar 72312daadf Move callback-based API to use Executors over ApplicationExecutionCtx 2019-04-19 12:57:32 -07:00
Yash Tibrewal 3b65effb82 Cleanup 2019-04-19 12:42:40 -07:00
Arjun Roy 7d946633ea grpc_slice_refcount devirtualization 2019-04-19 12:20:26 -07:00
Soheil Hassas Yeganeh 4080e7b65f Retire the GRPC_ARENA_INIT_STRATEGY env variable.
This is in the hot path and it is not needed anymore.
Remove it for good.
2019-04-19 12:20:26 -07:00
Arjun Roy e9a79f928c Address initial comments 2019-04-19 12:13:24 -07:00
Arjun Roy 4e24b0e4dc Bugfix - fixed assumptions 2019-04-19 12:13:24 -07:00
Arjun Roy 7f42728fd9 Fast-pathed grpc_mdelem_eq for known static cases. 2019-04-19 12:13:24 -07:00
Yash Tibrewal e770694c31 Merge branch 'master' into svc_cfg2 2019-04-19 11:55:21 -07:00
Yash Tibrewal 1ab9ffe5c0 Do not add message size filter for minimal stack 2019-04-19 11:34:19 -07:00
murgatroid99 a36040d51c Clang format 2019-04-19 10:25:45 -07:00
Moiz Haidry d48b0d2879 Created consolidated xds picker that stored and picks from the locality pickers 2019-04-19 10:01:50 -07:00
murgatroid99 2f2899203b Make cares resolver opt-in with libuv 2019-04-19 09:41:23 -07:00
Mark D. Roth c827d1e163
Merge pull request #18490 from markdroth/c++_client_channel_call_data
Convert client_channel call_data to C++
2019-04-19 09:29:07 -07:00
Mark D. Roth a09d705dbf Convert client_channel call_data to C++. 2019-04-19 08:02:54 -07:00
Yash Tibrewal c3ae72c089 Merge branch 'master' into svc_cfg2 2019-04-19 00:43:32 -07:00
Yash Tibrewal 576828696a Add parsing tests 2019-04-18 23:57:10 -07:00
Yash Tibrewal 116ce0fb24 Use health check parser 2019-04-18 23:57:10 -07:00
Yash Tibrewal 2c4c8438cc Message size filter parser and health check parser 2019-04-18 23:56:54 -07:00
Yash Tibrewal 813865acaf Adding service config parser 2019-04-18 23:56:40 -07:00
murgatroid99 a84d188021 Don't use 'new' or 'delete' 2019-04-18 17:45:36 -07:00
murgatroid99 41871bf7de Add cares glue for libuv event loop 2019-04-18 17:08:51 -07:00
Lidi Zheng fc2376e239
Merge pull request #18793 from lidizheng/fix-clang-tidy
Cleanup Clang Tidy errors
2019-04-18 11:01:59 -07:00
Soheil Hassas Yeganeh bc445360ab
Merge pull request #18797 from soheilhy/memset-envvar
Retire the GRPC_ARENA_INIT_STRATEGY env variable.
2019-04-17 17:24:39 -04:00
Soheil Hassas Yeganeh 212e4b8657 Retire the GRPC_ARENA_INIT_STRATEGY env variable.
This is in the hot path and it is not needed anymore.
Remove it for good.
2019-04-17 15:26:07 -04:00
Lidi Zheng 0d9b4212f8 Cleanup Clang Tidy errors 2019-04-17 11:41:22 -07:00
Soheil Hassas Yeganeh 2b9448a71c Revert "Revert "Introduce C++ wrappers for gpr_mu and gpr_cv.""
This reverts commit d09c9f8e20.
2019-04-17 14:35:29 -04:00
Lidi Zheng 0de83950e6
Merge pull request #18782 from lidizheng/rf-gevent
Revert "Revert "Merge pull request #18547 from lidizheng/fix-gevent""
2019-04-16 16:13:42 -07:00
Lidi Zheng 123fd943f1 Revert "Revert "Merge pull request #18547 from lidizheng/fix-gevent""
This reverts commit a922bd7a03.
2019-04-16 14:13:04 -07:00
Yihua Zhang ef4508ca0d fix memory leaks in ssl credential reload. 2019-04-16 11:09:30 -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
Mark D. Roth 38220243b0 Convert client_channel channel_data to C++. 2019-04-15 14:18:09 -07:00
Mark D. Roth 63777c714f
Merge pull request #18628 from markdroth/remove_error_from_connectivity_state_tracker
Remove error from connectivity state tracking.
2019-04-15 14:05:25 -07:00
Mark D. Roth 432c97e1ba Remove error from connectivity state tracking. 2019-04-15 13:14:19 -07:00
Richard Belleville a922bd7a03 Revert "Merge pull request #18547 from lidizheng/fix-gevent"
This reverts commit 09d1011663, reversing
changes made to e076a30f16.
2019-04-15 12:47:50 -07:00
Juanli Shen 01cd1585f7
Merge pull request #18677 from AspirinSJL/fix_error_msg
Fix error message upon pick failure
2019-04-15 09:14:36 -07:00
Jan Tattermusch 1d9e442b4d
Merge pull request #18707 from SataQiu/fix-repeated-words
Clean up repeated words
2019-04-15 13:37:09 +02:00
Lidi Zheng 09d1011663
Merge pull request #18547 from lidizheng/fix-gevent
Fix gevent segfault with C-Ares as DNS resolver
2019-04-12 16:30:22 -07:00
Lidi Zheng 5721c518d9 Add DNS resolver test & Disable C-Ares for custom iomgr 2019-04-12 14:44:37 -07:00
Alexander Polcyn 1ed8b62508 Revert "Update upb-generated code for xds api"
This reverts commit cebc65b947.
2019-04-12 11:59:57 -07:00
Nicolas Noble f03d392518
Merge pull request #18729 from beasleyr-vmw/topic/beasleyr-vmw/grpc-glibc-pre-217
include linux/tcp.h on Linux pre-glibc 2.17
2019-04-12 10:40:36 -07:00
vishalpowar da818e887f
Merge pull request #18733 from vishalpowar/update_upb_submodule
Update the upb submodule for proto.oneof fix in generated code.
2019-04-12 10:06:31 -07:00
Vishal Powar cebc65b947 Update upb-generated code for xds api 2019-04-11 21:59:17 -07:00
Alexander Polcyn d09c9f8e20 Revert "Introduce C++ wrappers for gpr_mu and gpr_cv."
This reverts commit a26c09dd25.
2019-04-11 16:52:54 -07:00
Ryan Beasley d47f2d5cc9 include linux/tcp.h on Linux pre-glibc 2.17
Bazel 0.24.0 upgraded grpc from 1.13.0 to 1.18.0, and the latter makes use of
the TCP_USER_TIMEOUT socket option.  Problem:  grpc conditions the option on
the Linux kernel version but sources the option from glibc's `netinet/tcp.h`.
glibc != Linux kernel, and that option wasn't imported to glibc until 2.17.

We can't just build Bazel with glibc 2.17 because we still have to support
CentOS 6 dev nodes which ship with glibc 2.12.  So instead this change
tweaks the grpc headers to conditionally include <linux/tcp.h> instead of
<netinet/tcp.h>.

Resolves https://github.com/grpc/grpc/issues/18728.
2019-04-11 13:35:26 -07:00
Muxi Yan f371fce887 Remove previous fix proposal proved to be wrong 2019-04-10 16:20:31 -07:00
Muxi Yan bec72481b5 Fix thread safety issue 2019-04-10 16:19:13 -07:00
vishalpowar 894c4b1852
Merge pull request #18529 from vishalpowar/xds_lrs_code_gen
Add upb generated code and build rule for lrs protocol.
2019-04-10 13:22:42 -07:00
SataQiu 44f92cdd17 clean up repeated words 2019-04-10 16:25:25 +08:00
Nicolas Noble 58c894fb9e
Merge pull request #18694 from abmahdy/master
Disable Nagle algorithm in Windows
2019-04-09 23:55:41 -07:00
Yash Tibrewal 2378ddcd51 Add service config to call context 2019-04-09 22:23:10 -07:00
Yash Tibrewal aa908cdd8d
Merge pull request #18556 from yashykt/unixpath
Explicitly call getsockname after accept for unix sockets to get the sun_path
2019-04-09 15:04:52 -07:00
Vishal Powar df3d5bc8f7 Add upb generated code and build rule for lrs protocol. 2019-04-09 12:03:21 -07:00
Yash Tibrewal 2b7cab0d41 Remove check on error 2019-04-09 11:37:59 -07:00
Ahmed Mahdy b4e94b652d Fix formatting 2019-04-09 10:05:53 -07:00
Yash Tibrewal 917d025f03 Fix diff between num_entries and idx of path 2019-04-09 09:39:42 -07:00
Yash Tibrewal 74540483c6 Merge branch 'master' into svc_cfg1 2019-04-08 19:51:45 -07:00
Yash Tibrewal 960864736b Unref errors in test 2019-04-08 19:51:20 -07:00
Ahmed Mahdy 1dce1009e6 Disable Nagle algorithm in Windows 2019-04-08 16:58:15 -07:00
Soheil Hassas Yeganeh a26c09dd25 Introduce C++ wrappers for gpr_mu and gpr_cv.
Introduce RAII wrappers in the grpc::internal and grpc_core
namespaces, and use them in place of std::mutex and
std::condition_variable.

Note that, since std::mutex is also used by the public
C++ headers we cannot introduce these wrappers in grpc_core.

Also, note that in grpcpp we cannot use gRPC core and vice versa.
So we had to duplicate the code, once using core_codegen_interface
and once using direct calls.
2019-04-08 18:27:07 -04:00
Yash Tibrewal b7f32af1d0 Fix scoping for service config errors 2019-04-05 19:17:29 -07:00
Juanli Shen 086820227f Fix error message upon pick failure 2019-04-05 17:41:45 -07:00
Yash Tibrewal 3dc6eae912 Merge branch 'master' into svc_cfg1 2019-04-05 13:45:03 -07:00
Yash Tibrewal 327350ab39 ServiceConfig::Create expects non-Null error and better errors 2019-04-05 12:16:37 -07:00
Yihua Zhang 1fb7a84133 fix ALPN issues. 2019-04-05 10:23:29 -07:00
Yash Tibrewal 390078b7a8 Add tests for new service config mechanism 2019-04-04 18:58:15 -07:00
Yash Tibrewal fbe3b3575f Cleanup and continue parsing service config even if parser errors are received 2019-04-04 16:14:59 -07:00
Mark D. Roth a8a166227b
Merge pull request #18636 from markdroth/health_check_client_use_after_free_bug
Fix health check client to wait for subchannel call stack destruction before destroying the arena.
2019-04-04 12:33:36 -07:00
Yash Tibrewal c28f16e481 Reviewer comments 2019-04-04 12:26:26 -07:00
Mark D. Roth 4a19b2f45f Add atomic to ensure we don't cancel twice.
Also convert existing seen_response_ to new atomic API.
2019-04-04 07:29:24 -07:00
Mark D. Roth 56d8f9896b
Merge pull request #18580 from markdroth/data_plane_combiner
Second attempt: Split data plane and control plane into their own combiners.
2019-04-04 07:24:17 -07:00
Yash Tibrewal 0f0e774722 Clean up 2019-04-03 19:05:40 -07:00
Yash Tibrewal 0c8ef41a5e Remove smart pointers from global registry 2019-04-03 18:53:14 -07:00
Yash Tibrewal 9bfd2354ec Add global and method parsing logic 2019-04-03 18:03:42 -07:00
Juanli Shen 5f13d8584e
Merge pull request #18629 from AspirinSJL/backport_pf_fix_1.20.x
Backport pick_first fix to v1.20.x
2019-04-03 16:20:11 -07:00
Michael Lumish 2f113fd0fc
Merge pull request #18633 from nicolasnoble/backports
Backports of 18445 and 18517.
2019-04-03 15:36:54 -07:00
Mark D. Roth 0e7ea67351 Fix health check client to wait for subchannel call stack destruction before destroying the arena. 2019-04-03 13:59:08 -07:00
Yash Tibrewal c871a0bb32 Remove commented code 2019-04-03 13:34:39 -07:00
Yash Tibrewal 4d696c659e Reviewer comments 2019-04-03 13:32:26 -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
Nicolas "Pixel" Noble f97b47c87c Backports of 18445 and 18517. 2019-04-03 21:59:42 +02:00
Nicolas Noble cb01297021
Merge pull request #18445 from nicolasnoble/last-memset-for-real-this-time
Taking care of a last few memsets.
2019-04-03 12:56:03 -07:00
Mark D. Roth ebf4cc1dfa Avoid crash in pick_first when invoking ExitIdleLocked() after shutdown. 2019-04-03 12:48:27 -07:00
Yash Tibrewal 4ac28e61f9 backport #18606 - Add a dummy function to grpc cfstream library 2019-04-03 12:34:53 -07:00
Mark D. Roth 9e841d1aff Backport pick_first fix to v1.20.x 2019-04-03 10:57:25 -07:00
Nicolas "Pixel" Noble 81c6081a3e Fixing failures. 2019-04-03 19:40:53 +02:00
Mark D. Roth 230c33ef14 Merge remote-tracking branch 'upstream/master' into data_plane_combiner 2019-04-03 07:00:27 -07:00
Mark D. Roth a5389c4b29
Merge pull request #18476 from markdroth/c++_client_channel_external_watcher
Convert external connectivity watcher to C++.
2019-04-03 06:45:44 -07:00
Nicolas "Pixel" Noble 21d9436ca6 Merge branch 'master' of https://github.com/grpc/grpc into last-memset-for-real-this-time 2019-04-03 01:30:54 +02:00
Nicolas Noble 53a0cb7d36
Merge pull request #18517 from nicolasnoble/memset-breakout-2
Breakout of #18445 - part 2
2019-04-02 16:29:43 -07:00
Nicolas Noble 683c18306b
Merge pull request #18572 from grpc/revert-18475-fix-jwt
Revert "Fix compilation error in JWT using const_cast."
2019-04-02 16:28:54 -07:00
Mark D. Roth adf5f87284 more code review changes 2019-04-02 15:16:29 -07:00
Mark D. Roth 89a9e9d1dd code review changes 2019-04-02 14:33:11 -07:00
Mark D. Roth c7dc6e55a6 Merge remote-tracking branch 'upstream/master' into c++_client_channel_external_watcher 2019-04-02 14:21:39 -07:00
Mark D. Roth c48385894b
Merge pull request #18598 from markdroth/pick_first_stay_idle_on_empty_update
pick_first: don't go into TRANSIENT_FAILURE upon empty update when in IDLE
2019-04-02 14:07:07 -07:00
Muxi Yan 4a84747b07 Merge remote-tracking branch 'upstream/master' into fix-gettimeofday-oob 2019-04-02 08:35:40 -07:00
Yash Tibrewal 69bbf86d14 Add a dummy function to grpc cfstream library 2019-04-01 16:01:49 -07:00
yihuaz ca471f6143
Merge pull request #18563 from yihuazhang/fix_alpn_issue
Fix ALPN check in gRPC C core SSL stack
2019-04-01 14:56:50 -07:00
Mark D. Roth ee4e4bead3 pick_first: don't go into TRANSIENT_FAILURE upon empty update when in IDLE. 2019-04-01 14:55:29 -07:00
Muxi Yan 39b40cbccb Add guard to the tv_nsec field of gpr_now return value 2019-04-01 13:37:35 -07:00
Yang Gao 681f1c8a98
Merge pull request #18583 from yang-g/pingping
Stop pinging if transport is closed
2019-04-01 12:06:57 -07:00
Soheil Hassas Yeganeh 31a27146f8
Merge pull request #18588 from soheilhy/h2-stream
Ref transport and stream before init of chttp2_stream structure.
2019-04-01 14:24:32 -04:00
Nicolas "Pixel" Noble ffeb4bff6a Merge branch 'master' of https://github.com/grpc/grpc into memset-breakout-2 2019-04-01 19:56:58 +02:00
Yihua Zhang 57caf78407 fix ALPN issues. 2019-04-01 08:48:35 -07:00
Soheil Hassas Yeganeh c239e0416d Initialize time as part of basic initialization.
`gpr_time_init` must happen in `do_basic_init`, because
for normal initialization we may need the precise clock
(e.g., if profilers are enabled).

Otherwise, we will have an stack overflow.

Fixes #18589
2019-03-31 20:18:13 -04:00
Soheil Hassas Yeganeh da3a2320a2 Ref transport and stream before init of chttp2_stream structure.
The stream structure is really big and by the time we get to
ref the stream and the transport, the fields are out of cache.
We need to ref them immediately, before starting to initialize
the stream.

This commit introduces a 0-byte Reffer so that we can
ref the streams on time before the field initializers.
2019-03-30 22:29:12 -04:00
yang-g 47132c099e error handling for start_bdp_ping 2019-03-29 21:45:12 -07:00
Lidi Zheng 1e8ddd7cda
Merge pull request #18584 from lidizheng/bump-version
Bump version to v1.21.0-dev
2019-03-29 17:50:13 -07:00
Yash Tibrewal b2c773d26f Global Registry for Service Config Parsers 2019-03-29 17:19:08 -07:00
Moiz Haidry 5e26c4339d
Merge pull request #18052 from mhaidrygoog/xds_work
Support for LocalityMap for XDS LB policy
2019-03-29 16:30:42 -07:00
Lidi Zheng 0231bf3b01 Regenerate projects 2019-03-29 16:24:50 -07:00
yang-g 55f9946d3b Stop pinging if transport is closed 2019-03-29 16:19:21 -07:00
Mark D. Roth 96a26fdb0b Use mutext to protect drop call counts in grpclb client stats. 2019-03-29 14:58:58 -07:00
Mark D. Roth 0b5ec20ce8 Revert "Merge pull request #18578 from grpc/revert-18437-data_plane_combiner"
This reverts commit a8477b421f, reversing
changes made to 65b25ce24d.
2019-03-29 13:55:51 -07:00
Moiz Haidry ba00d3c914 Added a locality map class that maintains a child policy per locality. This is used by the xds lb policy to manage multiple localities. Also added a grpc_core::Map which is a templatized map, that is used by the locality map to maintain this info 2019-03-29 12:50:54 -07:00
Mark D. Roth 7e3b8d38ff
Revert "Split data plane and control plane into their own combiners." 2019-03-29 12:12:28 -07:00
Nicolas Noble b400a6bf20
Revert "Fix compilation error in JWT using const_cast." 2019-03-29 10:29:45 -07:00
Yash Tibrewal 685372f61e Close fd if error on getsockname 2019-03-28 14:22:39 -07:00
Mark D. Roth 59cb5193f9 Split data plane and control plane into their own combiners. 2019-03-28 07:54:25 -07:00
Yash Tibrewal 282702d080 Explicitly call getsockname after accept for unix sockets to get the sun_path 2019-03-27 18:13:58 -07:00
Yash Tibrewal 9dede0f029
Merge pull request #18462 from yashykt/execctxfork
Remove unnecessary else condition
2019-03-27 14:29:34 -07:00
rmstar 2e2cecebbf
Merge pull request #18381 from rmstar/concurrentrequests
Fix bug in CFStream endpoint
2019-03-27 14:19:14 -07:00
Soheil Hassas Yeganeh 4ef6a27427
Merge pull request #18545 from soheilhy/tcp-win-null-deref
Fix a NULL deref in tcp_client_windows.cc
2019-03-27 15:50:40 -04:00
Guantao Liu ad55cf8900
Merge pull request #18501 from guantaol/avoid_executor
Avoid using grpc_core::Executor when the background poller is available
2019-03-27 12:28:48 -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
Soheil Hassas Yeganeh b0e75a42d2 Fix a NULL deref in tcp_client_windows.cc
`grpc_sockaddr_to_uri(addr)` can return nullptr, and we are directly
passing it to grpc_slice_from_copied_string. Clusterfuzz found this
issue in https://clusterfuzz.com/testcase-detail/5188592759603200

Use "NULL" when target URI is nullptr, to avoid null deref.

Fixes 18544
2019-03-27 14:12:33 -04:00
Prashant Jaikumar 4e9e662729 Fixed bug in CFStream endpoint.
We were failing to return an error when the transport tried to write to an endpoint that was in an errored state.
2019-03-26 18:36:44 -07:00
Yash Tibrewal 59ffdd9929
Merge pull request #18491 from yashykt/httpclosuresched
Use GRPC_CLOSURE_SCHED instead of GRPC_CLOSURE_RUN in complete_closure_step
2019-03-26 17:45:28 -07:00
Guantao Liu b3c8d918d1 Merge remote-tracking branch 'upstream/master' into avoid_executor 2019-03-26 15:56:29 -07:00
Soheil Hassas Yeganeh 65ec942940
Merge pull request #18475 from soheilhy/fix-jwt
Fix compilation error in JWT using const_cast.
2019-03-26 17:13:33 -04: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
Nicolas "Pixel" Noble 9ff845961e Breakout of #18445 - part 2 2019-03-26 19:21:18 +01:00
Nicolas "Pixel" Noble 9518dd85c5 Merge branch 'master' of https://github.com/grpc/grpc into last-memset-for-real-this-time 2019-03-26 19:05:15 +01:00
Nicolas Noble 4e1a89c78c
Merge pull request #18495 from grpc/forgotten-csharp
Adding missing language :P
2019-03-25 18:09:50 -07:00
Guantao Liu 53065db366 Clang formatting 2019-03-25 16:23:19 -07:00
Guantao Liu 872d2787a0 Avoid using grpc_core::Executor when the background poller is available.
Instead, run closures in the background poller. This will generally
avoid the thread hop in the gRPC runtime.
2019-03-25 16:19:08 -07:00
Nicolas "Pixel" Noble 55e280b7a5 Breakout of #18445 - part 1 2019-03-25 23:20:57 +01:00
Nicolas Noble c9b7ca8e24
Adding missing language :P 2019-03-25 13:44:45 -07:00
vishalpowar d673764a61
Merge pull request #18478 from vishalpowar/xds_cds_upb_generate
Generate upb code for cds protos and BUILD rule changes
2019-03-25 12:48:09 -07:00
Yash Tibrewal 8ef8d912a7 Use GRPC_CLOSURE_SCHED instead of GRPC_CLOSURE_RUN in complete_closure_step 2019-03-25 11:51:14 -07:00
Yash Tibrewal 820d75eaf4
Merge pull request #18481 from yashykt/http2bug
Remove unnecessary hack which causes data races
2019-03-25 00:22:54 -07:00
Yash Tibrewal 9effda48bf
Merge pull request #18482 from yashykt/http2bug2
Fix Potentially Dangerous Typo - locked function being run outside of combiner
2019-03-25 00:20:39 -07:00
Soheil Hassas Yeganeh a3366c1b7f
Merge pull request #18464 from soheilhy/slice-buffer
Introduce grpc_byte_buffer_reader_peek and use it for Protobuf parsing.
2019-03-23 22:42:23 -04:00
Soheil Hassas Yeganeh e5bef12065
Merge pull request #18474 from soheilhy/h2-incoming-md
Preallocate for incoming metadatas.
2019-03-23 04:59:32 -04:00
Soheil Hassas Yeganeh fc2fc03fc3
Merge pull request #18473 from soheilhy/stack-const-ref
Use const ref for `grpc_slice`
2019-03-23 04:58:19 -04:00
Vishal Powar e959373742 Generate upb code for cds protos and BUILD rule changes 2019-03-22 19:40:08 -07:00
Yash Tibrewal 072749b38c Reviewer comments 2019-03-22 16:58:14 -07:00
Yash Tibrewal 65e266b47f Locked function needs to be run inside a combiner 2019-03-22 16:38:50 -07:00
Yash Tibrewal eab66cb6cc Remove unused function 2019-03-22 16:08:11 -07:00
Yash Tibrewal c9e1a71c8e Remove unnecessary hack which causes data races 2019-03-22 16:05:04 -07:00
Mark D. Roth f26ef91c98 Convert external connectivity watcher to C++. 2019-03-22 08:26:10 -07:00
yihuaz b25024136a
Merge pull request #18469 from yihuazhang/revert_ssl_security_connector
Revert the changes in ssl_security_connector.cc made in #18115
2019-03-22 08:21:04 -07:00
Soheil Hassas Yeganeh 5534fb2e23 Fix compilation error in JWT using const_cast.
I got this error on an unrelated patch, and I believe the Distribution
Test is broken:

/var/local/git/grpc/src/core/lib/security/credentials/jwt/jwt_verifier.cc:628:57: error: invalid conversion from 'const uint8_t* {aka const unsigned char*}' to 'unsigned char*' [-fpermissive]
                             GRPC_SLICE_LENGTH(signature)) != 1) {
                                                         ^
In file included from /usr/include/openssl/pem.h:69:0,
                 from /var/local/git/grpc/src/core/lib/security/credentials/jwt/jwt_verifier.cc:35:
/usr/include/openssl/evp.h:642:5: note: initializing argument 2 of 'int EVP_DigestVerifyFinal(EVP_MD_CTX*, unsigned char*, size_t)'
 int EVP_DigestVerifyFinal(EVP_MD_CTX *ctx, unsigned char *sig, size_t siglen);
2019-03-22 06:59:12 -04:00
Soheil Hassas Yeganeh 1014fe507f Use const ref for grpc_slice.
We are copying the slice on every call creation, which is hurting
ping/pong traffic.
2019-03-22 06:38:33 -04:00
Soheil Hassas Yeganeh 88fe29c63d Preallocate for incoming metadatas.
There is usually 9 metadata in incoming headers. We are calling
arena_alloc for all of them and that accounts for 75% of the
calls to arena_alloc.

Simply preallocate 10 of them in the structure so that we can
avoid the atomic op, per header.
2019-03-22 06:27:33 -04:00
vishalpowar 62ba0b89b1
Merge pull request #18425 from vishalpowar/xds_ads_upb_generate
Add generated upb code for endpoints information.
2019-03-21 22:46:51 -07:00
Vishal Powar fb15daf8b9 Add generated upb code for endpoints information.
Also,
  - Update upb submodule for new code generator and update generated
  files.
2019-03-21 17:24:57 -07:00
Yihua Zhang a176a07c02 revert the SSL TSI changes 2019-03-21 16:38:16 -07:00
Yihua Zhang f022233c4d fix sanity check 2019-03-21 16:01:57 -07:00
Yihua Zhang 0a51130936 revert the changes in ssl_security_connector 2019-03-21 15:35:29 -07:00
Nicolas Noble 0045a22101
Merge pull request #18443 from guzt/fuchsia_gn
Add Fuchsia support.
2019-03-21 13:00:27 -07:00
Mark D. Roth 4222ba53d7
Merge pull request #17987 from markdroth/resolver_api
Add ResultHandler to Resolver API
2019-03-21 10:26:04 -07:00
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
Yash Tibrewal 3954b3ef5d Remove unnecessary else condition 2019-03-20 17:37:36 -07:00
Soheil Hassas Yeganeh f2529fee0a
Merge pull request #18451 from soheilhy/atomic-fix
Fix a typo in CompareExchangeStrong()
2019-03-20 18:10:46 -04:00
Yash Tibrewal 668fc0cf32
Merge pull request #18440 from yashykt/err_recv
Add the actual peer in the error message
2019-03-20 13:53:50 -07:00
Nicolas "Pixel" Noble 4a8b39e7ab Merge branch 'master' of https://github.com/grpc/grpc into last-memset-for-real-this-time 2019-03-20 21:48:34 +01:00
yihuaz b245ad4ae8
Merge pull request #18438 from yihuazhang/fix_php_test_failure
Fix php PersistentListTest test
2019-03-20 13:04:27 -07:00
Arjun ca69f911a7 Add initial Fuchsia support.
1. Add a BUILD.gn file
2. Support fuchsia as a platform

This is heavily based on the changes in https://fuchsia.googlesource.com/third_party/grpc/
2019-03-20 10:26:49 -07:00
Soheil Hassas Yeganeh e6cae04e5f Fix a typo in CompareExchangeStrong()
Use compare_exchange_strong() instead of compare_exchange_weak(), which
can be spuriously fail on some platforms.

Thanks to Mark Roth to pointing this out!
2019-03-20 10:44:07 -04:00
Mark D. Roth ba7da20f1d
Merge pull request #18368 from markdroth/lb_policy_api_cleanup
LB policy API cleanup
2019-03-20 07:17:01 -07:00
Nicolas "Pixel" Noble 9c7a0c01ed Taking care of a last few memsets. 2019-03-20 05:15:25 +01:00
Yihua Zhang 235fa49055 fail-fast if no pem root certs are available. 2019-03-19 18:38:08 -07:00
Yash Tibrewal 2c6849af7b s/peer/grpc_call_get_peer 2019-03-19 15:49:17 -07:00
Yash Tibrewal ec82dbae39 Add the actual peer in the error message 2019-03-19 15:05:54 -07:00
Nicolas "Pixel" Noble 26984e2a96 Merge branch 'master' of https://github.com/grpc/grpc into non-trivial-memset 2019-03-19 22:41:28 +01:00
Mark D. Roth a41a381302
Merge pull request #18353 from markdroth/grpclb_fallback_when_balancer_call_fails
grpclb fallback-at-startup improvements
2019-03-19 07:02:52 -07:00
vishalpowar 4d2effa410
Merge pull request #18393 from vishalpowar/xds_discovery_upb_generate
Add BUILD rule and generated upb code for protos required to do Discov…
2019-03-18 15:57:23 -07:00
Mark D. Roth 233d3e27ff grpclb fallback-at-startup improvements 2019-03-18 13:40:23 -07:00
Mark D. Roth 6a4ddc967f
Merge pull request #18344 from markdroth/grpclb_fallback_after_startup
grpclb fallback after startup
2019-03-18 11:42:39 -07:00
Juanli Shen 149eb4046e
Merge pull request #18401 from AspirinSJL/fix_grpclb_rere
Fix reresolution condition in grpclb
2019-03-18 10:49:55 -07:00
Mark D. Roth adc2163038 Go into fallback mode when losing contact with balancer and backends. 2019-03-18 09:08:38 -07:00
apolcyn ee72c63837
Merge pull request #18384 from apolcyn/log_more_query_status
Trace log the status of every c-ares lookup; cleanup error handling
2019-03-15 16:50:47 -07:00
Nicolas "Pixel" Noble 957f674fff Removing a few more non-trivial struct memsets, part 3. 2019-03-15 23:29:00 +01:00
yihuaz 4fef7f4d13
Merge pull request #18400 from yihuazhang/SPIFFE_FIX_CLANG_TIDY_ERROR
Fix clang-tidy errors in SPIFFE security stack
2019-03-15 14:47:48 -07:00
Vishal Powar f569cc1b36 Add BUILD rul and generated upb code for protos required to do DiscoveryRequest to xDS server
Also,
  - cleanup check scripts to look for file extension to exempt upb
  generated code.
2019-03-15 14:16:08 -07:00
Juanli Shen 335ced6b79 Improve logging 2019-03-15 13:30:31 -07:00
Alexander Polcyn c02034eb96 Add more tracing around the status of each c-ares query; refactor error
handling
2019-03-15 13:17:37 -07:00
Juanli Shen 78fc00f0ce Fix reresolution condition in grpclb 2019-03-15 13:16:18 -07:00
Yihua Zhang 64caf4d3df fix clang-tidy errors 2019-03-15 12:57:25 -07:00
Yash Tibrewal cbca7b6b00
Merge pull request #18367 from yashykt/errqueueinit
Use GRPC_LINUX_ERRQUEUE
2019-03-15 12:51:12 -07:00
Michael Lumish afdf67c7b1
Merge pull request #18391 from nicolasnoble/non-trivial-memset
Removing a few more non-trivial struct memsets.
2019-03-15 12:21:52 -07:00
yihuaz a3cc5361e6
Merge pull request #18115 from yihuazhang/SPIFFE_SECURITY_CONNECTOR
Add SPIFFE security stack to gRPC
2019-03-15 10:31:17 -07:00
Nicolas "Pixel" Noble a5e0fe95e8 Removing a few more non-trivial struct memsets.
This structure (tsi_ssl_client_handshaker_options) has an explicit constructor that sets everything to zeroes.
2019-03-15 17:31:46 +01:00