Commit Graph

11847 Commits

Author SHA1 Message Date
yang-g c639da7a1d Merge branch 'master' of https://github.com/grpc/grpc into port_sharing 2019-05-16 09:07:55 -07:00
Mark D. Roth 34b00a243c
Merge pull request #19028 from markdroth/service_config_cleanup
Clean up some names in the service config code.
2019-05-15 14:31:39 -07:00
Mark D. Roth 356e7c2107 Clean up some names in the service config code. 2019-05-15 07:57:03 -07:00
murgatroid99 70e850a023 Merge branch 'master' into cares_windows_platform_detection 2019-05-14 17:41:25 -07:00
murgatroid99 5f0e68636e Move ifdefs around 2019-05-14 15:45:02 -07:00
Karthik Ravi Shankar 172bb1b30f Whitelist internal code path to use ApplicationExecCtx 2019-05-14 15:29:46 -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
Vijay Pai 0df4cb1bdc
Merge pull request #18959 from SataQiu/fix-20190506
Fix some spelling mistakes
2019-05-14 13:51:51 -07:00
Mark D. Roth f9a5243fef
Merge pull request #19025 from markdroth/health_check_client_refcount_fix
Fix bug from #19002.
2019-05-14 13:49:57 -07:00
Karthik Ravi Shankar 091c12ad79 Fix clang errors 2019-05-14 12:55:20 -07:00
Karthik Ravi Shankar a73f22bd73 Make the executor SHORT instead of LONG. 2019-05-14 12:10:17 -07:00
Karthik Ravi Shankar e68316dda5 Fix errors from clang format script 2019-05-14 12:07:05 -07:00
Karthik Ravi Shankar e3028a2836 Merge branch 'master' into callback-rpc-lock 2019-05-14 12:05:38 -07:00
Mark D. Roth 2ba3209b33 Fix bug from #19002. 2019-05-14 11:57:08 -07:00
Soheil Hassas Yeganeh 801eed8387
Merge pull request #18926 from soheilhy/slicebuffer-first
Introduce slice_buffer helper methods to avoid copies.
2019-05-14 13:39:17 -04:00
Esun Kim 987cd3d5ce
Merge pull request #19017 from veblush/fork-tsan
Made Fork.support_enabled_ atomic
2019-05-13 13:24:23 -07:00
Esun Kim 86febe4121 Made Fork.support_enabled_ atomic 2019-05-13 11:34:34 -07:00
yang-g de57783beb Merge with head and resolve conflict 2019-05-13 08:56:02 -07:00
murgatroid99 85b9520a90 Fix sanity 2019-05-10 15:43:04 -07:00
murgatroid99 90e52f00a1 Moved code back into one file with a #ifdef 2019-05-10 14:47:26 -07:00
Yash Tibrewal 1ff5791e47 Add tests for setting a channel to lame on an invalid default service config 2019-05-10 14:33:22 -07:00
Arjun Roy 50e16f6d3a
Merge pull request #18910 from arjunroy/slice_eq_static
Added slice equality when static fastpath.
2019-05-10 13:45:57 -07:00
Srini Polavarapu d961a54661
Merge pull request #19008 from srini100/master
Bump master version to 1.22.0-dev
2019-05-10 12:23:51 -07:00
Arjun Roy f65208af02 Added slice equality when static fastpath. 2019-05-10 11:35:27 -07:00
Mark D. Roth e802932a5b
Merge pull request #18839 from markdroth/subchannel_watcher
Revamp subchannel connectivity state monitoring APIs.
2019-05-10 11:21:56 -07:00
murgatroid99 4b4006f833 libuv cares: scope manual localhost resolution to only Windows 2019-05-10 11:15:12 -07:00
murgatroid99 d29804f611 Fix Windows vs libuv platform detection in cares code 2019-05-10 10:40:01 -07:00
Srini Polavarapu 6bc2ff1b5f Regenerate projects 2019-05-10 10:38:59 -07:00
Mark D. Roth 9f57c32b1b
Merge pull request #19002 from markdroth/health_check_client_refcount_fix
Fix ref-counting bug in health check client.
2019-05-10 08:29:56 -07:00
Mark D. Roth a4d4bb82c9 Revamp subchannel connectivity state monitoring APIs. 2019-05-10 07:57:11 -07:00
Soheil Hassas Yeganeh 04da62cc52
Merge pull request #18981 from soheilhy/call-unref
Use grpc_core::RefCount for grpc_call and mark Unref path unlikely.
2019-05-10 09:50:09 -04:00
Yash Tibrewal aa89a97531
Merge pull request #18946 from yashykt/svccfgerrortransient
Service Config Changes to set channel in transient failure on invalid service config
2019-05-10 06:14:44 -07:00
apolcyn d84b76c2c0
Merge pull request #18999 from apolcyn/more_logs
Add two more trace logs to the c-ares resolver
2019-05-09 20:55:13 -07:00
Yash Tibrewal d56bbf19d2 Reviewer comments 2019-05-09 15:50:52 -07:00
Mark D. Roth 12fbdaa6a8 Fix ref-counting bug in health check client. 2019-05-09 14:17:30 -07:00
Esun Kim 87905ae5ea Config migration 2019-05-09 12:29:38 -07:00
Yash Tibrewal 611bcbb988 Merge branch 'master' into svccfgerrortransient 2019-05-09 11:03:03 -07:00
Yash Tibrewal 98d8f85d4e Reviewer comments 2019-05-09 10:58:00 -07:00
Soheil Hassas Yeganeh cb9b43b9f7
Merge pull request #18986 from soheilhy/trace-macro
Introduce GRPC_TRACE_FLAG_ENABLED macro to mark trace branches unlikely.
2019-05-08 23:18:12 -04:00
Alexander Polcyn 569d33f49b Add two more trace logs to the c-ares resolver 2019-05-08 17:49:52 -07:00
Yash Tibrewal dfa45cb7ac Merge branch 'master' into svccfgerrortransient 2019-05-08 16:44:33 -07:00
apolcyn 9278411207
Merge pull request #17688 from apolcyn/ares_timeouts
Add a backup poller to c-ares resolver to take better advantage of c-ares query timeout/retry logic
2019-05-08 16:16:12 -07:00
Yash Tibrewal 3c4e8a9be2 Fix test failure 2019-05-08 15:46:32 -07:00
Yash Tibrewal b53465c106 Add test for not special casing grpclb if loadbalancingconfig is used 2019-05-08 14:27:58 -07:00
Soheil Hassas Yeganeh cc75d93818
Merge pull request #18963 from soheilhy/sb-len
Check count instead of length in maybe_embiggen() to reset the slice pointer.
2019-05-08 17:27:50 -04:00
Yash Tibrewal 40b6123d14 Fix TODOs 2019-05-08 10:53:26 -07:00
Yash Tibrewal abfe14e3ed Reviewer comments 2019-05-08 10:44:56 -07:00
Alexander Polcyn 2a4d62819b Revise c-ares timeouts to use c-ares's internal timeout/retry logic 2019-05-08 09:57:39 -07:00
Soheil Hassas Yeganeh 983f678cb8 Mark it unlikely for Unref() to return true.
In the hot path, specially when the dtor of a class is inlined,
we will have to skip quite a few instructions (for Delete and dtor)
before returning.

Mark Unref() as unlikely so that compiler moves the
decrement-refcnt-and-return code instructions to the front.
2019-05-08 12:49:38 -04:00
Soheil Hassas Yeganeh 3bcae1e368 Apply do {...} while(0) to the remaining macros. 2019-05-08 12:26:44 -04:00
Yash Tibrewal 6cba63eb47 reviewer comments and tests 2019-05-08 03:36:37 -07:00
yang-g 218e290074 Merge with head and resolve conflict 2019-05-07 22:46:45 -07:00
Soheil Hassas Yeganeh 2ade64a685 Use grpc_core::RefCount for grpc_call and mark Unref path unlikely.
Unfortunately, we cannot use RefCount for `batch`, unless we support
reset API. So, for now, let's mark its unref path as unlikely.
2019-05-07 22:21:52 -04:00
Soheil Hassas Yeganeh 70d5e5af17 Introduce GRPC_TRACE_FLAG_ENABLED macro to mark trace branches unlikely.
This is a trivial change and results in better code generation,
because it marks the trace path unlikely.

The changes are all mechanical, except I did some minor edits in
two macros in call_stack.h and http to apply best practices.
2019-05-07 22:08:44 -04:00
Yash Tibrewal fb8973722b Reviewer comments 2019-05-07 16:42:00 -07:00
yang-g 08e251a23a resolve comments 2019-05-07 15:21:16 -07:00
yang-g 0958ed32a5 Resolve review comments 2019-05-07 15:21:16 -07:00
yang-g 7cab9c7811 Remove fd from pollset when releasing the fd 2019-05-07 15:21:16 -07:00
yang-g 68b5260b74 Resolve comments 2019-05-07 14:33:51 -07:00
Yash Tibrewal 8030e12624 Add more tests for service config state transitions 2019-05-07 03:57:56 -07:00
Yash Tibrewal aa0a26cdbc Do not save service config in DNS resolver 2019-05-07 00:03:43 -07:00
Soheil Hassas Yeganeh 1b23280277
Merge pull request #18925 from soheilhy/http2-compression
Use compress and decompress slice_buffers only when they are needed.
2019-05-06 22:48:24 -04:00
yang-g 152a7cc122 Resolve comments 2019-05-06 15:42:18 -07:00
Alexander Polcyn d5fb6da369 Revert "Use aligned_alloc directly for grpc_core::Arena"
This reverts commit 333ba8feae.
2019-05-06 15:24:21 -07:00
Alexander Polcyn cb966a4e5e Revert "Renamed macros for memory alignment"
This reverts commit a3fe7c0c90.
2019-05-06 15:24:09 -07:00
Alexander Polcyn 0562b51f8e Revert "Fixed non-debug build warning"
This reverts commit e1a96b8347.
2019-05-06 15:23:54 -07:00
Alexander Polcyn b7c6ef0225 Revert "Use platform align_malloc function when setting custom allocators and no override provided"
This reverts commit 22c6e166c4.
2019-05-06 15:23:41 -07:00
Soheil Hassas Yeganeh 29aa8a9e59 Check count instead of length in maybe_embiggen() to reset the slice pointer.
add_tiny overrides the length before calling maybe_embiggen(). Generally
using count as a signal for emptiness is more reliable.
2019-05-06 16:36:10 -04:00
Soheil Hassas Yeganeh b3436d76d9 Remove unnecessary new lines. 2019-05-06 15:37:22 -04:00
SataQiu 09be62f8b2 fix some spelling mistakes 2019-05-06 16:07:36 +08:00
Soheil Hassas Yeganeh 1ef80f46bd
Merge pull request #18953 from soheilhy/ref-fix
Avoid copy on slice_ref.
2019-05-03 19:31:26 -04:00
Yash Tibrewal 587ae4a2d9 Fix existing tests 2019-05-03 15:40:39 -07:00
Soheil Hassas Yeganeh 93dc228a8a Avoid copy on slice_ref.
This was accidentially added in PR #18407
2019-05-03 16:47:16 -04:00
Esun Kim 0217450e2c Sanitized some sources 2019-05-03 10:05:32 -07:00
Yash Tibrewal 71085f3e3b Changes 2019-05-02 18:21:52 -07:00
Yash Tibrewal db1ccad039 Service Config Changes to set channel in transient failure on invalid service config 2019-05-02 18:03:02 -07:00
Soheil Hassas Yeganeh d37a1ba57d
Merge pull request #18932 from soheilhy/slicebuffer-reset
Reset slices pointer to base_slices when slice_bufer length is 0.
2019-05-02 17:10:52 -04: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
Soheil Hassas Yeganeh 1f0476267b Add a better comment and rename consume_first to remove_first. 2019-05-02 14:07:06 -04:00
Soheil Hassas Yeganeh e26af33726
Merge pull request #18927 from soheilhy/transport-error
Add a fast path in grpc_error_get_status() for GRPC_ERROR_NONE.
2019-05-02 13:34:03 -04:00
Soheil Hassas Yeganeh 926bbe3a2e Add a fast path in grpc_error_get_status() for GRPC_ERROR_NONE.
In most of the cases, as we hope, RPCs shouldn't have errors.
But, in grpc_error_get_status() we treat GRPC_ERROR_NONE
similar to other errors, and waste quite a few cycles.

This patch is part of a larger performance improvements.
On client side, this particular code path accounts for 0.5%+.
2019-05-01 16:51:07 -04:00
Soheil Hassas Yeganeh b3fb277da6 Reset slices pointer to base_slices when slice_bufer length is 0.
Currently, we keep increasing the slice pointer, and
can run out of the inline space or try to realloc the
non-inline space unncessarily.

Simply set slices back to the start of the base_slices,
when we know the length of the slice_buffer is 0.

Note: This will change the behavior of undo_take_first(),
      if user tries to grow the slie_buffer, between take_first()
      and undo_take_first() calls. That said, it's not legal
      to add something to the buffer in between take_first()
      and undo_take_first(). So, we shouldn't have any issue.
2019-05-01 13:52:58 -04:00
Soheil Hassas Yeganeh f5f030e675 Use end - begin instead of GRPC_SLICE_LENGTH(). 2019-05-01 13:42:16 -04:00
Lidi Zheng 929ca006ea
Merge pull request #18920 from lidizheng/fix-doc
Tiny fix for combiner comment
2019-05-01 10:10:36 -07:00
Esun Kim ccf4734907
Merge pull request #18799 from veblush/config
New config system & migration sample
2019-05-01 09:01:35 -07:00
yang-g abd97b9170 Merge with head and resolve conflict 2019-04-30 23:01:01 -07:00
yang-g 1775faa595 Fix epoll1 for release fd 2019-04-30 22:51:09 -07:00
Soheil Hassas Yeganeh 4c0c2965fe Use peek_first instead of mutable_first.
Use DEBUG_ASSERT instead of ASSERT.
2019-04-30 22:20:06 -04:00
Arjun Roy 238fef6571
Merge pull request #18875 from arjunroy/arena_aligned_alloc_direct
Use aligned_alloc directly for grpc_core::Arena
2019-04-30 16:59:38 -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
Soheil Hassas Yeganeh 5538bb8143 Use compress and decompress slice_buffers only when they are needed.
Compression is not used for performance senstiive RPCs, yet
chttp2 always moves buffers in/out of the compressed/decmpressed
buffers. Even initilizing them is costly.

Use the (de)compression buffer and state only when we are using
non-identity compression.

This is part of a larger performance change, and this one buys us 1%-2%
depending on the benchmark.
2019-04-30 18:39:29 -04:00
Soheil Hassas Yeganeh fd5f787080 Introduce slice_buffer helper methods to avoid copies.
take_first(), grpc_undo_first(), ... are very clostly
methods that unnecessarily copy grpc_slice with extra
ref counting requirements.

Introduce alternatives to avoid copies and refs wherever
possible.

This results in 1% improvements in the benchmarks.
2019-04-30 18:38:29 -04:00
Soheil Hassas Yeganeh 01d58cde23
Merge pull request #18921 from soheilhy/tcp-closure-init
Initialize TCP write and error closures only once.
2019-04-30 17:07:09 -04:00
yang-g ac3a91edf8 Support accepting external connections. 2019-04-30 12:31:34 -07:00
Arjun Roy 22c6e166c4 Use platform align_malloc function when setting custom allocators and no override provided 2019-04-30 11:52:29 -07:00
Arjun Roy dc148b6a30 Fix regression where we do not properly account for freed interned metadata. 2019-04-30 11:47:08 -07:00
Lidi Zheng 058e90ef16 Tiny fix for combiner comment 2019-04-30 11:34:44 -07:00
Soheil Hassas Yeganeh 714a13c193 Initialize TCP write and error closures only once.
We are initializing the closures in the hot path on every event.
2019-04-30 14:18:09 -04:00
Arjun Roy e1a96b8347 Fixed non-debug build warning 2019-04-29 15:40:11 -07:00
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