Commit Graph

11793 Commits

Author SHA1 Message Date
Ashitha Santhosh 74d554a4f0
Check for unsupported connection headers. (#27072)
* Check for unsupported condition headers.
2021-08-30 22:34:45 -07:00
Tamir Duberstein 76e95f6afd
Generalize pthread TLS to any trivial type (#27009)
* Avoid copy constructor

```
src/core/lib/gpr/log_linux.cc:78:33: error: copying variable of type 'grpc_core::PthreadTlsImpl<long>' invokes deleted constructor
  static GPR_THREAD_LOCAL(long) tid = 0;
                                ^     ~
./src/core/lib/gpr/tls.h:64:3: note: 'PthreadTlsImpl' has been explicitly marked deleted here
  PthreadTlsImpl(const PthreadTlsImpl&) = delete;
  ^
1 error generated.
```

* Generalize pthread TLS to any trivial type

Use multiple pthread keys for types larger than a machine word.

Implement generic timer TLS optimization on all platforms.
2021-08-30 11:32:47 -07:00
yihuaz c66d2cc084
Allow access to Google API regional endpoints via Google Default Credentials (#27155)
* fix Google API regional endpoint access issues

* address 1st round of comments

* fix minor nits
2021-08-30 10:57:48 -07:00
Esun Kim 71a9410fc7
Another workaround to fix windows SymInitialize error (#27169) 2021-08-30 10:15:55 -07:00
Craig Tiller 1ce8bd7067
Observable primitive for promises (#27082)
* promise sequences

* Activities for promises

* Observable primitive - single writer/multiple reader

* Automated change: Fix sanity tests

* dedup some code

* Automated change: Fix sanity tests

Co-authored-by: ctiller <ctiller@users.noreply.github.com>
2021-08-27 14:56:48 -07:00
Craig Tiller 12cd59426b
Latch synchronization primitive (#27080)
* promise sequences

* Activities for promises

* Latch synchronization primitive

* Wakeups between actors in the same activity

* Automated change: Fix sanity tests

* Automated change: Fix sanity tests

* Automated change: Fix sanity tests

Co-authored-by: ctiller <ctiller@users.noreply.github.com>
2021-08-27 12:43:28 -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
Craig Tiller 764232fa13
Fixes for map (#27079)
* fixes for map

* fix bad merge

* Automated change: Fix sanity tests

* Automated change: Fix sanity tests

Co-authored-by: ctiller <ctiller@users.noreply.github.com>
2021-08-26 14:34:00 -07:00
Craig Tiller f2f60f7716
Revert "Implement TraceFlag::Log (#26954)" (#27145)
This reverts commit 4d2b979b75.
2021-08-26 09:18:45 -07:00
Ta-Wei Tu ab57f03b30
Reland: Import binder transport tests (#27138)
* Import binder transport tests

* Fix copybara import errors

* Add testonly labels
2021-08-26 15:33:37 +08:00
Ashitha Santhosh 1ff1f8fd83
SDK authorization filter. (#26468)
* SDK authorization filter.
2021-08-25 21:00:35 -07:00
Craig Tiller 90c4a2a5eb
Revert "Import binder transport tests (#26970)" (#27126)
This reverts commit 006464c57d.
2021-08-25 09:56:22 -07:00
Ta-Wei Tu 006464c57d
Import binder transport tests (#26970)
This PR imports unit tests and end-to-end tests of binder transport from the internal repository. No further changes will be made to internal repository.
2021-08-25 17:56:35 +08:00
Craig Tiller 5cdaec9a4f
Promise Activities (#26921)
* promise sequences

* Activities for promises

* Automated change: Fix sanity tests

* review feedback

* review feedback

* review feedback

* review feedback

* review feedback

Co-authored-by: ctiller <ctiller@users.noreply.github.com>
2021-08-24 22:21:58 -07:00
donnadionne 59fc02a94b
Enabling Ring Hash by default. (#27111) 2021-08-24 19:59:19 -07:00
Chuan Ren e2ba0d9c0b
[3PI] Validate external account credentials token urls (#26966)
* Validate token urls

* Update external_account_credentials.cc

* Update external_account_credentials.cc

* Remove regex

* Validate implicit flow

* Update credentials_test.cc

* Update google_default_credentials.cc

* Revert "Update credentials_test.cc"

This reverts commit c43e00de2b.

* Revert "Validate token urls"

* Add tests for grpc_google_default_credentials_create

* Update google_default_credentials.cc
2021-08-24 14:37:03 -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 4d2b979b75
Implement TraceFlag::Log (#26954)
Motivation: In debug builds, `DebugOnlyTraceFlag`s are hard-coded to be
disabled. This results in unreachable code paths that the compiler can
detect, which prevent us from enabling `-Wunreachable-code-aggressive`
on the builds.

This work aims to reduce the number of places that switch on
`trace_flag.enabled`.
2021-08-24 09:42:09 -07:00
Craig Tiller 6a06f0cd4a
promise sequences (#27058) 2021-08-23 17:39:12 -07:00
Craig Tiller 46afdf9989
Add test and mitigation for clang 11 compiler bug (#27073)
* Add test and mitigation for clang 11 compiler bug

* document

* document

* Automated change: Fix sanity tests

Co-authored-by: ctiller <ctiller@users.noreply.github.com>
2021-08-22 22:35:51 -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
Craig Tiller f292f001ee
Promise join combinator (#26918)
* Add construct/destruct helper functions

Will be used in upcoming promise implementation

* Poll type for promises library

* Library to talk about things that look like promises if you squint

* Helper code for promises to deal with status types generically

* Library to talk about things that make promises

* build

* Join combinator for promise library

* Changes to sync required for promise activities

* sanitized

* Automated change: Fix sanity tests

* Automated change: Fix sanity tests

* Update basic_join.h

* Automated change: Fix sanity tests

Co-authored-by: ctiller <ctiller@users.noreply.github.com>
2021-08-19 21:06:38 -07:00
Craig Tiller 59da7bc42a
Eliminate grpc_core::Atomic (#27025)
* Eliminate grpc_core::Atomic

* Automated change: Fix sanity tests

* Automated change: Fix sanity tests

* initialize things

* fix include order

* fix

Co-authored-by: ctiller <ctiller@users.noreply.github.com>
Co-authored-by: Mark D. Roth <roth@google.com>
2021-08-19 20:54:55 -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 46547d5690
Fix incorrect loop variable type (#27055)
The iterator returns a newly-constructed `std::pair<absl::string_view, absl::string_view>`.
Compiled with `-Wrange-loop-bind-reference` on iOS due to new dependencies for
iOS tests.
2021-08-18 14:33:28 -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
Craig Tiller 724ad871d4
Promise loop (#26913)
* Poll type for promises library

* Library to talk about things that look like promises if you squint

* Library to talk about things that make promises

* Promises loop construct

* build

* Changes to sync required for promise activities

* sanitized

* add comments

* Automated change: Fix sanity tests

Co-authored-by: ctiller <ctiller@users.noreply.github.com>
2021-08-18 10:36:14 -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 aacd32c721
Promise library context management helpers (#26912)
* Promise library context management helpers

* Automated change: Fix sanity tests

* Automated change: Fix sanity tests

* fixes

* Automated change: Fix sanity tests

* missing file

* Automated change: Fix sanity tests

* compatibility

* build

* Automated change: Fix sanity tests

* propagate

* Automated change: Fix sanity tests

* merge with head

* Automated change: Fix sanity tests

Co-authored-by: ctiller <ctiller@users.noreply.github.com>
2021-08-17 09:48:06 -07:00
Craig Tiller 4744aceb68
Promises race (#26915)
* Poll type for promises library

* Promises race construct

* Changes to sync required for promise activities

* Automated change: Fix sanity tests

* fix

Co-authored-by: ctiller <ctiller@users.noreply.github.com>
2021-08-17 09:27:40 -07:00
Craig Tiller cad2255d8c
First stab at config framework (#27014)
* First stab at config framework

* Automated change: Fix sanity tests

* add test for threaded initialization

* better test

* clang format

* better filenames

* Automated change: Fix sanity tests

Co-authored-by: ctiller <ctiller@users.noreply.github.com>
2021-08-16 19:46:59 -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 7ea742f3d5
Promise if construct (#26914)
* Poll type for promises library

* Library to talk about things that look like promises if you squint

* Library to talk about things that make promises

* Promises if construct

* build

* Automated change: Fix sanity tests

Co-authored-by: ctiller <ctiller@users.noreply.github.com>
2021-08-16 12:08:38 -07:00
Craig Tiller 5dc93179eb
modernize % encoding routines (#27018)
* modernize % encoding routines

* Automated change: Fix sanity tests

* use bitset

* Automated change: Fix sanity tests

Co-authored-by: ctiller <ctiller@users.noreply.github.com>
2021-08-16 11:16:18 -07:00
Craig Tiller 8ed20ae479
Promise map operator (#26917)
* Poll type for promises library

* Library to talk about things that look like promises if you squint

* Promise helpers, and basic type erasure

* Promise map operator - change return type via a function

* build

* Changes to sync required for promise activities

* sanitized

* Automated change: Fix sanity tests

* fixes

* fixes

* Automated change: Fix sanity tests

* fix build

* review feedback

* Automated change: Fix sanity tests

* comment

Co-authored-by: ctiller <ctiller@users.noreply.github.com>
2021-08-13 17:15:43 -07:00
Craig Tiller 152b79144c
Extract HPACK Encoder Hash Map to a separate file (#26973)
* comments

* Extract hash map from hpack encoder

* Automated change: Fix sanity tests

* x

* x

* Automated change: Fix sanity tests

Co-authored-by: ctiller <ctiller@users.noreply.github.com>
2021-08-13 13:08:24 -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 71b2042c56
Promise factories (#26990)
* Poll type for promises library

* Library to talk about things that look like promises if you squint

* Library to talk about things that make promises

* build

* Changes to sync required for promise activities

* sanitized

* remove bad comment

* possible windows fix?

* fix

* ugh

* comment fix

* fix build

* Automated change: Fix sanity tests

Co-authored-by: ctiller <ctiller@users.noreply.github.com>
2021-08-12 16:10:57 -07:00
Craig Tiller 840bcce9c4
Revert "HPACK Table --> C++ (#26851)" (#26995)
This reverts commit 83bcb0cf2e.
2021-08-12 11:20:19 -07:00
Craig Tiller 2e56b42ada
Generic promise facilities (#26916)
* Poll type for promises library

* Library to talk about things that look like promises if you squint

* Promise helpers, and basic type erasure

* build

* Changes to sync required for promise activities

* sanitized

* Automated change: Fix sanity tests

* suppressions

* try to fix windows failure

* Automated change: Fix sanity tests

Co-authored-by: ctiller <ctiller@users.noreply.github.com>
2021-08-11 16:17:50 -07:00
Craig Tiller bb4311baed
Add a utility to capture arguments by move even in C++11 (#26923)
* Add a utility to capture arguments by move even in C++11

* add test

* Automated change: Fix sanity tests

* missing file

* Automated change: Fix sanity tests

* better test

* Automated change: Fix sanity tests

* fmt

Co-authored-by: ctiller <ctiller@users.noreply.github.com>
2021-08-11 15:31:22 -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