Commit Graph

400 Commits

Author SHA1 Message Date
Soheil Hassas Yeganeh 18b19105f2 Implement TCP_INQ for gRPC in Linux
TCP_INQ is a socket option we added to Linux to report pending bytes
on the socket as a control message.

Using TCP_INQ we can accurately decide whether to continue read or not.
Add an urgent parameter, when we do not want to wait for EPOLLIN.

This commit improves the latency of 1 RPC unary (minimal benchmark)
significantly:

  Before:
    l_50: 61.3584984733
    l_90: 94.8328711277
    l_99: 126.211351174
    l_999: 158.722406029

  After:
    l_50: 51.3546011488 (-16%)
    l_90: 72.3420731581 (-23%)
    l_99: 103.280218974 (-18%)
    l_999: 130.905689996 (-17%)
2019-03-06 22:15:53 -05:00
yang-g 456f748b2f Revert "Merge pull request #18146 from grpc/revert-17308-shutdown"
This reverts commit 9079e98dfc, reversing
changes made to 76a38bfcc2.
2019-02-25 10:11:06 -08:00
Yang Gao 4bc2ca4de6
Revert "Move grpc_shutdown internals to a detached thread" 2019-02-22 16:34:24 -08:00
yang-g 86b23adc7f Other comments 2019-02-15 16:26:31 -08:00
yang-g bc946d6c6d merge with head and resolve conflicts 2019-02-12 15:00:32 -08:00
Arjun Roy 195a30bb8b Grpc: Change grpc_handshake and grpc_handshake_mgr to use CPP implementations.
grpc_handshake is renamed to GrpcHandshake, using C++ class definitions
instead of C-style vtable classes. Update callers to use new interfaces.
We use RefCountedPtr to simplify reference tracking.
2019-02-11 11:35:08 -08:00
Chris Wilcox df6cf7c741 Add period at end of metadata.google.internal to prevent unnecessary DNS lookups. 2019-01-24 09:37:32 -08:00
yang-g cf806915fc Merge branch 'master' into shutdown 2018-12-21 13:36:30 -08:00
Mark D. Roth b96196f655
Merge pull request #17547 from markdroth/alignment_cleanup
Remove now-unnecessary workarounds for alignment issues.
2018-12-20 10:07:59 -08:00
yang-g 3c8d24ba2c merge with head and resolve conflict 2018-12-19 10:13:41 -08:00
Mark D. Roth 09a173b4b6 Remove now-unnecessary workarounds for alignment issues. 2018-12-18 15:09:48 -08:00
yang-g 038a71d826 Merge remote-tracking branch 'upstream/master' into gpr_test_util_to_grpc_test_util 2018-12-17 08:52:20 -08:00
Soheil Hassas Yeganeh 9decf48632 Move security credentials, connectors, and auth context to C++
This is to use `grpc_core::RefCount` to improve performnace.
This commit also replaces explicit C vtables, with C++ vtable
with its own compile time assertions and performance benefits.
It also makes use of `RefCountedPtr` wherever possible.
2018-12-13 10:38:12 -05:00
yang-g 67742ef63f Fix BUILD files. Manually edit bzl files 2018-12-06 14:37:52 -08:00
yang-g 991963efcc Merge branch 'master' into shutdown 2018-12-05 14:53:06 -08:00
Yihua Zhang 750e80ea1c bring back original network test for metadata server detection 2018-12-05 10:27:01 -08:00
yang-g e75fc243da change tests to use the new class instead of grpc_test_init 2018-11-30 08:57:38 -08:00
yang-g cdd698810b Move grpc_shutdown internals to a detached thread 2018-11-27 14:26:08 -08:00
yang-g a35f55fd70 move helper function into namespace 2018-10-26 14:28:52 -07:00
yang-g 83d74bf6fc Remove the internal cache for google_default_credentials 2018-10-26 14:04:36 -07:00
yihuaz e976f69972
Merge pull request #16963 from yihuazhang/security_connector_refactor_new
security connector refactor
2018-10-24 13:14:28 -07:00
Yihua Zhang 81bc942cd8 security connector refactor 2018-10-22 09:37:48 -07:00
Yihua Zhang bed575c8b1 Do not pass interested_parties during handshake 2018-10-12 16:05:51 -07:00
Yihua Zhang 70a6c790b9 Add changes in #16782 2018-10-05 10:17:09 -07:00
jiangtaoli2016 e361d0f691 Turn loading system root certificate as default 2018-09-04 15:23:20 -07:00
Chris Lamb fba18d8551 Fix a number of spelling errors. 2018-08-22 16:52:46 +01:00
tdbhacks bcd747d42d Added system roots feature to load roots from OS trust store
Added a flag-guarded feature that allows gRPC to load TLS/SSL
roots from the OS trust store. This is the Linux-specific
implementation of such feature.
2018-08-09 11:01:31 -07:00
Dan Rosart 477a1aec5a Don't segfault when product name from BIOS is empty
Somehow some Dell servers we're trying to run a gRPC client on have an empty product name in the BIOS. When gRPC tries to creadte default credentials, it checks whether it's running on GCE by strcmp()ing the contents of /sys/class/dmi/id/product_name to some magic strings. When it reads that file, it gets only a newline; in trim() it skips over the newline in both directions, and since end < start it returns nullptr. This causes a segfault in the strcmp() call. Since a machine without a product name clearly isn't GCE, change it to return false instead.
2018-07-03 13:13:37 -07:00
Dan Rosart f54fc5b53a Include port_platform in gcp_environment tests.
Both the Windows and Linux tests use platform-specific macros to
determine whether they should execute, but they weren't including the
file where those macros were defined, so they were always running the
else case of that check, which meant they weren't testing anything.
2018-06-27 16:57:11 -07:00
adelez 5bdd9a8cb9
Revert "Revert "Add suppressions to sanitizers for bazel builds"" 2018-06-15 16:31:21 -07:00
Nicolas Noble 43557fee0b
Revert "Add suppressions to sanitizers for bazel builds" 2018-06-14 10:49:11 -07:00
Adele Zhou 4cd659505c Add data param to grpc_cc_library 2018-06-13 15:36:28 -07:00
Yihua Zhang e145c52286 use a new gcp env check mechansim 2018-05-18 10:03:05 -07:00
Yihua Zhang cc93663910 Add ALTS fuzzer 2018-05-08 10:15:03 -07:00
Yihua Zhang 392dad7134 incorporate alts to google default creds 2018-05-03 20:12:20 -07:00
jiangtaoli2016 310d87d509 fix namespace of security_connector test functions 2018-04-27 08:49:02 -07:00
David Cowden 116fd29a36
gRPC core: strip zone-id from IPv6 hosts before TLS verification
When initiating a connection to an IPv6 peer using an address that is
not globally scoped, there may be ambiguity regarding which zone the
destination address applies to when multiple links of the same scope
are present. The scoped address architecture and zone-id syntax are
described in rfc4007 and rfc 6874, respectively:

  * https://tools.ietf.org/html/rfc4007#section-6
  * https://tools.ietf.org/html/rfc6874

This patch allows host name verification performed during TLS session
establishment, and on a per-call basis, to work correctly when the peer
presents a certificate with a non-global IPv6 address listed as one of
its alternate names. Whether arbitrary certificate authorities choose
issue certificates of this nature, or not, is outside the scope of gRPC.

The zone-id is separated from the address using a percent (%) character.
It is considered a system implementation detail and guidance suggests it
be stripped from any paths or addresses egressing a host because it is
irrelevant and meaningless otherwise. It would not make sense for a
server to present a certificate containing non-global IPv6 addresses
with zone-ids present nor would it work unless two hosts happened to
be using the same zone-id.

ssl_host_matches_name is prefixed with grpc_ because it has been
promoted to the global namespace for testing.

Resolves #14371
2018-04-26 12:25:38 -07:00
Yihua Zhang fe2fa0c1c8 Add C++ experimental API extensions for ALTS C stack 2018-04-16 15:11:32 -07:00
jiangtaoli2016 144f5559da cache default SSL root cert store 2018-03-23 11:28:48 -07:00
Yihua Zhang 04fb58efbd Add ALTS code to grpc/core 2018-03-08 06:49:24 -08:00
Sree Kuchibhotla ae277dd000
Revert "Add ALTS C stack to gRPC core" 2018-03-07 14:35:36 -08:00
Yihua Zhang eaf6486677 Add ALTS code to grpc/core 2018-03-06 21:40:45 -08:00
adelez 5d0480a88c
Merge pull request #14469 from adelez/foundry_integration
Add more bazel tests
2018-02-22 13:39:39 -08:00
Mark D. Roth 9b32d9c4f3
Merge pull request #14437 from yihuazhang/security_connector_replacement
Security connector replacement
2018-02-21 07:59:04 -08:00
Adele Zhou 1c805ec901 Add more bazel tests 2018-02-20 17:46:39 -08:00
Yihua Zhang 75f0a9fbd2 place security_connector in its own subdirectory 2018-02-20 10:09:47 -08:00
Adele Zhou a2013f86a0 Fix the fuzzer corpus path. 2018-02-16 22:16:38 -08:00
Noah Eisen 4d20a66685 Run clang fmt 2018-02-09 09:34:04 -08:00
Noah Eisen be82e64b3d Autofix c casts to c++ casts 2018-02-09 09:16:55 -08:00
Vijay Pai 18b9133f31 Merge branch 'master' into gpr_review 2018-02-08 12:18:09 -08:00