Commit Graph

1937 Commits

Author SHA1 Message Date
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
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
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
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
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 49b5f9c420
Fix XdsServerSecurityTest (#26817) 2021-07-29 13:28:18 -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
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
Mark D. Roth 34bf26357b
Change StringMatcher to not support case-insensitive regex matching. (#26567)
* Change StringMatcher to not support case-insensitive regex matching.

* clang-format

* clang-tidy
2021-06-29 09:25:33 -07:00
Vijay Pai cf1ebf7387
Remove experimental tag from uses of the C++ callback API (#26495) 2021-06-20 00:47:07 -07:00
Yash Tibrewal bb994526ba
Fix ExistingRpcsOnResourceDeletion flakiness (#26419) 2021-06-02 18:48:44 -07:00
Lidi Zheng a36199b2d5
Tighten the probability requirement from 99.99% to 99.995% (#26408)
* Tighten the probability requirement from 99.99% to 99.995%

* Update comments
2021-06-01 17:14:00 -07:00
Vijay Pai 8aff94558c
De-experimentalize C++ callback API (#25728)
* De-experimentalize callback API

* Make FromServerContext based on ServerContextBase

* Fix lambda

* Fix headers

* De-experimentalize tests

* clang-format

* Fix consistency checks

* wip

* Fix const-ness of callback client read RPC requests

* Fix golden file

* Give full route_guide callback client example with Hold etc

* Complete example route-guide server

* De-experimentalize test services

* Omit unneeded using

* Remove some uses of non-experimental macro from test

* clang-format examples

* De-experimentalize async stub calls

* Remove experimental namespace use in qps, ubms

* De-experimentalize alarms, generic stubs, and context allocator

* De-experimentalize SetContextAllocator

* clang-format

* Fix conflicts

* Leave obsolete API in place until users can be migrated
2021-05-27 14:55:25 -07:00
Vijay Pai 153bc67f45
Revert "Revert "Revert "Revert "Expose trailers-only response status through C++ callback API"" (#26365)" (#26375)" (#26379)
This reverts commit 259a74c0e6.
2021-05-27 09:16:05 -07:00
Yash Tibrewal 259a74c0e6
Revert "Revert "Revert "Expose trailers-only response status through C++ callback API"" (#26365)" (#26375)
This reverts commit 66253c521a.
2021-05-26 22:20:23 -07:00
donnadionne e22fefb39a
Ring hash implementation (#26356)
* Ring hash implementation

* Fixing an error caught during import:
ipv6 addresses need small modifications when creating the ring entry.

* fixing an error

* removing debugs

* Remove unnecssary hashing

* small cleanup
2021-05-26 00:03:42 -07:00
Vijay Pai 66253c521a
Revert "Revert "Expose trailers-only response status through C++ callback API"" (#26365)
* Revert "Revert "Expose trailers-only response status through C++ callback API (#26249)" (#26363)"

This reverts commit 05c3b30ea0.

* Move the trailers_only check from ClientContext to ClientReactor

* Remove unneeded change in client_context.cc
2021-05-25 17:43:21 -07:00
Yash Tibrewal 05c3b30ea0
Revert "Expose trailers-only response status through C++ callback API (#26249)" (#26363)
This reverts commit 393bae7e88.
2021-05-25 13:44:10 -07:00
Mark D. Roth edae7450f5
fix LOGICAL_DNS semantics (#26147)
* WIP: fix LOGICAL_DNS semantics

* fix tests and address FIXME

* clang-format

* add "dns:" prefix before creating resolver
2021-05-24 09:59:20 -07:00
Vijay Pai 393bae7e88
Expose trailers-only response status through C++ callback API (#26249)
* Expose trailers-only response status through callback API

* Fix change-detector test

* Address reviewer comment about trailers_only headers

* Add TODO requested by markdroth

* Move variable in struct to improve space efficiency

* Don't instantiate ExecCtx in channel_args destructor unless needed
2021-05-21 14:42:41 -07:00
donnadionne 2bb20d25a4
Revert "ring_hash LB policy implementation (#26285)" (#26303)
This reverts commit c55c7c065e.
2021-05-19 14:24:52 -07:00
Vijay Pai 0f80378a21
Resolve race between OnReadDone(ok=false) and IsCancelled (#26245)
* Resolve and test race between OnReadDone(ok=false) and IsCancelled

* Fix retry case

* Fix health check case

* Address reviewer comments.

* ADD TODO requested by markdroth
2021-05-19 14:05:46 -07:00
donnadionne c55c7c065e
ring_hash LB policy implementation (#26285)
* ring_hash LB policy (#25697)

* Ring Hash Policy implementation

* Code review comment fixing

* Fixing code review comments.

* Code review comment fixing

* Fixing reconnect logic

* adding helper method for pick

* Holding on to ref to parent

* first attempt at calling AttemptToConnect

* Fixing state change

* Fixing code review comments

* Fixing the reconnect from channel watcher code

* Fixing the BUILD to include new policy

* Fixing major code review suggestion

* Fixing code review comments

* Fixing code review suggestions

* Initial 2 tests.

* Adding channel id case.

* Fixing code review comments.

* Small change to get the spread of backends

* Add header hashing tests

* Added more tests and debugging

* Fixing Header hash

* Added more tests

* cleanup

* removing debugs

* Fixing code review comments.

* code review fixing

* combining code and match design

* fixing code review comments.

* Fixed IDLE case

* Moving tests

* Fixing code review comments

* Adding more tests according to code review comments.

* Added tests with differetn types of weights

* Adding terminal policy case

* Remove hash_func as there is only 1

* Added nack invalid hash function

* Added NACK cases

* fixing build error

* fixing build

* small warning

* adding regex test

* Adding policy tests

* fixing warning

* fixing warning

* fixing code reivew comments.

* fixing IDLE case

* Code review comments.

* fixing code review comments

* Making a helper function

* fixing reattempt case

* Added afew more tests.

* Adding more tests

* Added backward compatible test

* FIxing the reattempt test

* Clean up

* fixing clang error

* fixing clang error

* Fix logic discovered during code review

* code review comments

* code review comments

* code review comment

* clean up tests

* fixing code review comments

* clean up tests

* Separated test

* Fixing test

* fixing test

* fixing clang error

* Addressing code review suggestions

* Fixing last bit of code review comments

* Fixing flaky tests

* Fixing last bit of code review comments

* clean debugs

* Remove a verbose log

* Relaxing deadline exceeded for 1st RPC until ring is optimized.
Making Hash more efficient for random case.
2021-05-18 16:00:06 -07:00
Mark D. Roth 467c0d742c
fix xds resolver to add XdsClient to channel args even on errors (#26282) 2021-05-18 13:55:34 -07:00
donnadionne f36a31b6aa
Revert "ring_hash LB policy (#25697)" (#26238)
This reverts commit 2aefb26f5d.
2021-05-14 08:52:21 -07:00
donnadionne 2aefb26f5d
ring_hash LB policy (#25697)
* Ring Hash Policy implementation

* Code review comment fixing

* Fixing code review comments.

* Code review comment fixing

* Fixing reconnect logic

* adding helper method for pick

* Holding on to ref to parent

* first attempt at calling AttemptToConnect

* Fixing state change

* Fixing code review comments

* Fixing the reconnect from channel watcher code

* Fixing the BUILD to include new policy

* Fixing major code review suggestion

* Fixing code review comments

* Fixing code review suggestions

* Initial 2 tests.

* Adding channel id case.

* Fixing code review comments.

* Small change to get the spread of backends

* Add header hashing tests

* Added more tests and debugging

* Fixing Header hash

* Added more tests

* cleanup

* removing debugs

* Fixing code review comments.

* code review fixing

* combining code and match design

* fixing code review comments.

* Fixed IDLE case

* Moving tests

* Fixing code review comments

* Adding more tests according to code review comments.

* Added tests with differetn types of weights

* Adding terminal policy case

* Remove hash_func as there is only 1

* Added nack invalid hash function

* Added NACK cases

* fixing build error

* fixing build

* small warning

* adding regex test

* Adding policy tests

* fixing warning

* fixing warning

* fixing code reivew comments.

* fixing IDLE case

* Code review comments.

* fixing code review comments

* Making a helper function

* fixing reattempt case

* Added afew more tests.

* Adding more tests

* Added backward compatible test

* FIxing the reattempt test

* Clean up

* fixing clang error

* fixing clang error

* Fix logic discovered during code review

* code review comments

* code review comments

* code review comment

* clean up tests

* fixing code review comments

* clean up tests

* Separated test

* Fixing test

* fixing test

* fixing clang error

* Addressing code review suggestions

* Fixing last bit of code review comments

* Fixing flaky tests

* Fixing last bit of code review comments

* clean debugs

* Remove a verbose log
2021-05-13 12:55:23 -07:00
Mark D. Roth 4c40ee3f78
move parse_address and sockaddr_utils out of iomgr directory (#26077)
* move parse_address and sockaddr_utils out of iomgr directory

* clang-format

* fix python

* fix for import

* fix build file for import
2021-04-30 08:21:58 -07:00
Alisha Nanda 1b26c897c1
Fix build failures in xds_end2end_test (#26127) 2021-04-29 13:55:24 -07:00
donnadionne a994aad0b8
xds_end2end_test test infra: Eds Args refactoring and enhancing WaitForBackend (#26093)
* Refactoring EdsResourceArgs::Locality to have a vector of Endpoints:
port, health_status, and lb_weight.

As well, Adding RpcOption to WaitForBackend()

* Update WaitForBackend

* Modified WaitForBackend default param

* reuse SeenBackend

* Code review comments

* refactor WaitForAllBackend parameter list

* Fixing tests to ensure they are more strict;
Fixing test code according to code review comments.

* Fixing code review suggestions

* Increasing timeout for StressTest
2021-04-29 11:54:58 -07:00
Lidi Zheng 13e04b4b9c
Reduce xds_end2end_test's error tolerance to 0.05 (#25738)
* WIP sync API with 1.6k threads doesn't work

* Please don't fail

* Fix the tests

* Spread to DropTest

* Code clean-up and extend delay RPC timeout

* Address comments

* Address comments

* Deflake MSAN

* Make MSAN more robust && normal runs faster

* Address comments

* Remove the clock change in fault injection filter

* Polish comments && stricten the connection timeout
2021-04-28 17:47:09 -07:00