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.
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`.
* 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>
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.
* 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>
* 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>
* 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>
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.
```
* 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>
* 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>
* 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
* 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
* Limit initial window size increases/decreases by flow control windows of active streams
* Limit stream flow control window updates to maximum allowable
* Reviewer comments
* Alternative way
* Clean-up
* Add tests
* Remove unnecessary cq_verifier
* Generate projects
* Initialize recv_message
* Get around compilation issue
* Test size large
Most instances were already explicit through comments, so it's clear
that the author cared about being explicit; use the compiler to ensure
this is always the case.
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.
* 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
* Enable retries by default, but add a separate arg for hedging.
* don't need to explicitly enable retries in xDS config selector
* clang-format
* don't need retry_enabled bit anymore
* fix HTTP client filter to restore the send_message op in the batch
* fix retry cancellation when a batch fails on call attempt
* fix clang-tidy
* fix client channel to pass down batches even after cancellation
* fix retry code to pass transport stats back up to the surface
* add some missing payload propagation
* fix retry handling of callbacks for pending batches
* avoid scheduling the same callback twice
* fix some trace messages
* don't avoid starting recv_initial_metadata or recv_message due to recv_trailing_metadata already being started internally
* avoid restarting recv_trailing_metadata after commit if we've already started it internally
* use fast path when retries are not configured
* fix retry handling of callbacks for pending batches
* avoid scheduling the same callback twice
* fix some trace messages
* don't avoid starting recv_initial_metadata or recv_message due to recv_trailing_metadata already being started internally
* avoid restarting recv_trailing_metadata after commit if we've already started it internally
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.