Commit Graph

5437 Commits

Author SHA1 Message Date
Esun Kim 71a9410fc7
Another workaround to fix windows SymInitialize error (#27169) 2021-08-30 10:15:55 -07:00
Yash Tibrewal cb2e7554a3
xds_end2end_test: Fix UnsupportedHttpFilter test on aws (#27147) 2021-08-27 09:10:46 -07:00
Ta-Wei Tu 7dd1da9e1d
Break after WriteLast() (#27165)
If we continue to call `Write()` after `WriteLast()` (because client is still sending us data and thus `Read()` returns `true`), the buffer might become invalid and results in assertion failures.
2021-08-27 23:19:12 +08:00
Ashitha Santhosh 1ff1f8fd83
SDK authorization filter. (#26468)
* SDK authorization filter.
2021-08-25 21:00:35 -07:00
donnadionne 59fc02a94b
Enabling Ring Hash by default. (#27111) 2021-08-24 19:59:19 -07:00
Yash Tibrewal 6da9eb9f3f
xDS PSM Server Security: Nack unsupported require_sni and ocsp_staple_policy values (#26878)
* Nack unsupported require_sni and ocsp_staple_policy values

* Reviewer comments
2021-08-24 10:50:08 -07:00
AJ Heller 6ba4a92af7
Reorder gtest/gmock headers (#27070)
Per the style guide (or spirit thereof), these should be placed with the other external/third_party headers.
2021-08-20 14:36:08 -07:00
Yash Tibrewal 0ab13090e7
Nack certain unsupported fields in CertificateValidationContext (#26880)
* Nack certain unsupported fields in CertificateValidationContext

* Regenerate projects

* Reviewer comments
2021-08-20 11:03:20 -07:00
AJ Heller d10617edb5
Move resource_user ownership into chttp2 transport/server/connector v2 (#27032)
Reintroducing PR #26643, which was reverted in #27029

Fixed a memory leak and added a test that would have caught it (ASAN build): ca0c8c4
2021-08-18 17:04:00 -07:00
AJ Heller 4ba3fa52b9
Clean up some instances of -Wunreachable-code-aggressive (#27054)
See https://github.com/grpc/grpc/pull/26951 for why this is not enforced
at the moment.
2021-08-18 11:43:46 -07:00
AJ Heller 58f8f5ced3
Add macro to define gtest death_test_style using an older syntax (#27042)
This temporarily unblocks a related gtest upgrade. The ultimate goal is
to upgraade our gtest dependencies, but I don't have the cycles to
manage a potentially messy migration until at least next week. This PR
is coordinated with an internal change.
2021-08-17 17:12:28 -07:00
Yash Tibrewal 533f02642d
Disable xds_credentials_test on iOS (#27043) 2021-08-17 13:33:05 -07:00
Mark D. Roth 9f782faa34
xds: remove env var protection for retries (#27039) 2021-08-17 13:23:25 -07:00
Craig Tiller f5d3ed2db1
Revert "Move resource_user ownership into chttp2 transport/server/connector (#26643)" (#27029)
This reverts commit d1935a65a1. Will be rolled forward with a fix.
2021-08-16 19:07:39 -07:00
AJ Heller d1935a65a1
Move resource_user ownership into chttp2 transport/server/connector (#26643) 2021-08-16 13:50:56 -07:00
Craig Tiller bbea27de46
Reland HPACK parsing changes (#26997)
* Revert "Revert "HPACK Table --> C++ (#26851)" (#26995)"

This reverts commit 840bcce9c4.

* fix bad parsing of trailing === in binary metadata
2021-08-13 10:57:42 -07:00
Tamir Duberstein 34338e5798
Avoid undefined behavior in pthread TLS (#26999)
See code commentary for an explanation.

Add an additional constructor to allow `log_linux.cc` to compile with
GPR_PTHREAD_TLS. Without it:

```
../../third_party/grpc/src/core/lib/gpr/log_linux.cc:78:33: error: no viable conversion from 'int' to 'grpc_core::PthreadTlsImpl<long>'
  static GPR_THREAD_LOCAL(long) tid = 0;
                                ^     ~
../../third_party/grpc/src/core/lib/gpr/tls.h:64:3: note: candidate constructor not viable: no known conversion from 'int' to 'const grpc_core::PthreadTlsImpl<long> &' for 1st argument
  PthreadTlsImpl(const PthreadTlsImpl&) = delete;
  ^
1 error generated.
```
2021-08-12 19:25:38 -07:00
Craig Tiller 840bcce9c4
Revert "HPACK Table --> C++ (#26851)" (#26995)
This reverts commit 83bcb0cf2e.
2021-08-12 11:20:19 -07:00
Tamir Duberstein 00c03c55ff
Implement type safety for TLS (#26942)
* Implement type safety for TLS

This is mostly free when compiler support is available, but requires
careful templating when implemented using pthread.

Significantly slimmed the tls.h interface; it now only defines the "TLS
keyword" for each supported compiler, delegating enforcement of correct
usage (i.e. must be static) to the compiler itself.

Implemented implicit conversion for the pthread wrapper so it can be
used (mostly) the same as native support. Notable exception to this is
that static_cast<void*> is needed when printing a pointer stored in TLS
as %p.

* Use GPR_THREAD_LOCAL macros consistently
2021-08-11 13:24:26 -07:00
Yash Tibrewal 404e56b2d9
Fix XdsEnabledServerTest (#26956) 2021-08-10 10:47:12 -07:00
apolcyn d742153b32
Include the peer address in interop soak test high-latency error messages (#26932) 2021-08-10 09:47:16 -07:00
Craig Tiller 83bcb0cf2e
HPACK Table --> C++ (#26851)
* Buffer HPACK parsing until the end of a header boundary

HTTP2 headers are sent in (potentially) many frames, but all must be
sent sequentially with no traffic intervening.

This was not clear when I wrote the HPACK parser, and still indeed quite
contentious on the HTTP2 mailing lists.

Now that matter is well settled (years ago!) take advantage of the fact
by delaying parsing until all bytes are available.

A future change will leverage this to avoid having to store and verify
partial parse state, completely eliminating indirect calls within the
parser.

* maybe fixes

* xx

* fix boundary detection

* clang-format

* Revert "xx"

This reverts commit 258d712ed3.

* fix tests

* add missed check

* fixes

* fix

* update tests

* fix benchmark

* properly unref

* optimize final slice refcounting

* cleanup bm_chttp2_hpack

* start

* new parser progress

* refinement

* get it compiling

* bug-fix

* build files

* clang-tidy

* fixes

* fixes

* fixes

* fix-leaks

* clang-tidy

* comments

* fix merge error

* Revert "Buffer HPACK parsing until the end of a header boundary (#26700)"

This reverts commit 8bab3e4bf4.

* streaming hpack parser start

* streaming parser

* clang-format

* Rework HPackTable into C++

* clang-tidy

* fix merge

* actually set the size of the entries array

* better
2021-08-09 16:07:41 -07:00
Tamir Duberstein 3fd01fabae
Add thread safety annotations (#26871)
This exposes a bug in clang, reported upstream as
https://bugs.llvm.org/show_bug.cgi?id=51368.

The clang bug is mitigated using a fake scoped lock; that allows the
current code to compile while also serving as a change detector to
prevent it from going stale; if the compiler bug is fixed, the compiler
will see an overlapping locking requirement, and reject this code, which
will prompt a human being to remove this workaround.
2021-08-06 15:44:22 -07:00
Yash Tibrewal 29d220a0ef
Re-experimentalize XdsServerBuilder (#26892)
* Re-experimentalize XdsServerBuilder

* Fix compiler issue
2021-08-06 10:29:28 -07:00
Alisha Nanda 0307759b9b
Fix OOM issues in qps tests (#26888) 2021-08-05 19:04:06 -07:00
Tamir Duberstein 013e67a029
Deprecate grpc{_core,::internal}::WaitUntil (#26866)
It is not possible for such a function to be implemented in a way that
is understood by annotalysis. Mark it deprecated and replace instances
of its use with direct mutex/condvar usage.

Add a bunch of missing thread safety annotations while I'm here.
2021-08-04 17:03:25 -07:00
Mark D. Roth 639b7acdfa
fix client_lb_end2end_test ClientLbPickArgsTest.Basic flakiness (#26868)
* fix client_lb_end2end_test ClientLbPickArgsTest.Basic flakiness

* clang-format
2021-08-04 09:46:47 -07:00
Tamir Duberstein 86c9de8231
Remove `grpc_core::WaitUntilWith{Deadline,Timeout}` (#26867)
These functions are essentially unused.
2021-08-03 15:46:36 -07:00
Mark D. Roth 6b71ec3704
LB policy API improvements (#26481)
* LB policy API improvements

* clang-format

* fix build

* a bit more cleanup

* use absl::variant<> for pick result

* fix retry_lb_drop test

* clang-format

* fix grpclb_end2end_test

* fix xds_end2end_test

* try to make variant code a bit cleaner

* clang-format

* fix memory leak

* fix build

* clang-format

* fix error refcount bug

* remove PickResult factory functions

* clang-format

* add ctors to structs

* clang-format

* fix clang-tidy

* update comments

* move LB recv_trailing_metadata callback instead of copying it

* use Match() instead of providing PickResult::Handle()

* don't use Match() for now, since it breaks lock annotations

* update retry_lb_fail test
2021-08-03 09:43:07 -07:00
Yash Tibrewal a3d264e8fd
Open census filter stats api (#26739)
* Use new stats API in open census filter

* Fix time and latency calculation

* Fix parent census context

* Add tests

* Reviewer comments

* Reviewer comments

* Reviewer comments

* Reviewer comments

* Fix error unref

* Add a context object for the overall call

* Remove TODO

* Reviewer comments
2021-08-02 14:00:15 -07:00
ZHANG Dapeng ca482bdbc7
Enable xds retry test for cpp (#26828)
* enable retry

* enable cpp

* fix cpp format

* fix indent
2021-07-29 15:39:35 -07:00
Yash Tibrewal 49b5f9c420
Fix XdsServerSecurityTest (#26817) 2021-07-29 13:28:18 -07:00
Craig Tiller 613b90ba93
Revert "Buffer HPACK parsing until the end of a header boundary (#26700)" (#26825)
This reverts commit 8bab3e4bf4.
2021-07-29 11:22:47 -07:00
Craig Tiller 8bab3e4bf4
Buffer HPACK parsing until the end of a header boundary (#26700)
HTTP2 headers are sent in (potentially) many frames, but all must be
sent sequentially with no traffic intervening.

This was not clear when I wrote the HPACK parser, and still indeed quite
contentious on the HTTP2 mailing lists.

Now that matter is well settled (years ago!) take advantage of the fact
by delaying parsing until all bytes are available.

A future change will leverage this to avoid having to store and verify
partial parse state, completely eliminating indirect calls within the
parser.
2021-07-28 15:36:51 -07:00
Lidi Zheng 2231c2ba77
Introduce Python import sorting to our sanity test suite (#26768)
* Add isort_code.sh to sanity tests

* Run tools/distrib/isort_code.sh

* Fine tune the import order for relative imports

* Make pylint and project generation happy

* Fix a few corner cases

* Use --check instead of --diff

* The import order impacts test result somehow

* Make isort print diff and check output at the same time

* Let tools/run_tests/python_utils be firstparty library

* Run isort against latest HEAD
2021-07-26 12:31:21 -07:00
donnadionne 7eaf37bce5
Adding retry policy (#26566) 2021-07-23 12:17:17 -07:00
Mark D. Roth 3104a9964c
xds: validate that terminal filters come at the end of the filter chain (#26742)
* xds: validate that terminal filters come at the end of the filter chain

* clang-format
2021-07-23 08:06:58 -07:00
Craig Tiller 4f9828fe0b
Remove unnecessary include (#26761) 2021-07-22 16:19:34 -07:00
Mark D. Roth 246c57829b
xds: notify watchers when NACKing resource updates (#26757)
* xds: notify watchers when NACKing resource updates

* check status of failed RPC when waiting for NACK
2021-07-22 13:12:19 -07:00
vperus 53701640c6
codegen: Correct indentation (#26702) 2021-07-21 10:52:08 -07:00
Craig Tiller d3e5803cb2
Move HPACK parser to C++ (#26689)
This is a fairly low effort migration of the current codebase into a C++ class, instead of free standing C code.
It builds upon #26657 as a necessary first step.
I've tried to minimize any changes to semantics or logic in this change, except where required to get a minimal amount of encapsulation - which is the major aim of this change.

A future change in this series will buffer slices until all HPACK headers are in memory for a stream prior to decoding -- it's important to have an encapsulated API to the parser before doing so however (hence this CL).

The next change after that will be an almost complete rewrite of the parsing functionality -- since we'll have the total set of header bytes, we'll no longer need to support suspending decoding at arbitrary points. This will allow us to move to a simple recursive descent parser, eliminate a bunch of indirection in this code, and end up in a much more malleable place for when we start doing metadata API changes.

(we likely also end up with some good performance wins!)
2021-07-15 13:51:23 -07:00
Alisha Nanda d73ec07fe7
Fix small typo in xds end2end test (#26685) 2021-07-14 10:53:55 -07:00
Yash Tibrewal c52005c161
NACK xDS updates when certificate provider instace names are unrecognized (#26614)
* NACK xDS updates when certificate provider instace names are unrecognized

* Reviewer comments

* Reviewer comments

* Clang format

* Fix compilation error
2021-07-11 22:10:04 -07:00
Lidi Zheng b97693d572
[Roll Forward] Tighten the error tolerance requirement by 100x (#26626)
* Tighten the error tolerance requirement by 10x

* Make it 5 sigma instead of 4.5

* Rewrap comments

* Loosen the max concurrent requests in certain test cases
2021-07-09 10:33:43 -07:00
Yash Tibrewal 670a26caef
NACK xDS updates where transport_name is not recognized (#26612)
* NACK xDS updates where transport_name is not recognized

* Reviewer comments
2021-07-08 11:14:07 -07:00
Yash Tibrewal 095045b31c
NACK xds updates requiring client certificates when no validation certificate provider instance is mentioned (#26613) 2021-07-07 13:22:13 -07:00
Yash Tibrewal 8b5fbf8900
TLS Security Connector: Add an always-fail-handshaker when certificates are not ready (#26561)
* TLS Security Connector: Add an always-fail-handshaker when certificates are not ready

* Reviewer suggestion

* Add test
2021-07-04 12:39:29 -07:00
Yash Tibrewal 4daedf0233
De-experimentalize XdsServerBuilder (#26543) 2021-07-02 19:33:15 -07:00
Lidi Zheng f198fb5b41
Revert "Tighten the error tolerance requirement by 100x (#26588)" (#26593)
This reverts commit f835f3f97c.
2021-07-01 16:21:12 -07:00
Lidi Zheng f835f3f97c
Tighten the error tolerance requirement by 100x (#26588)
* Tighten the error tolerance requirement by 10x

* Make it 5 sigma instead of 4.5

* Rewrap comments
2021-07-01 09:48:37 -07:00