This is the import of part of our binder transport implementation from
internal repository.
This "Wire Format" part implements the protocol described at
https://github.com/grpc/proposal/blob/master/L73-java-binderchannel/wireformat.md
This part of the code does not interact with gRPC transport layer. We
will import other components in the next few pull requests.
The code is well-tested in the repository we are importing from. Due to
the difficulty of setting up the tests properly (cannot automatically
import them by script), we will import them after we have finished
importing other codes.
For now we confirm that the code builds via
`bazel build //src/core/ext/transport/binder/wire_format:all`
and some local testing with actual Android tool chain.
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.
* wip: port non-security tests to k8s
* port forwarding offset
* combine and log health status changes
* split tests
* add remove_neg method
* implement assertRpcsEventuallyGoToGivenServers
* remove neg and change backend
* make maxRatePerEndpoint configurable
* _test suffix
* "rebase" onto master
* yapf and isort
* add to grpc_xds_k8s.sh
* undo change to run_test_server.py
* fix (avoid?) cleanup error with reuse_namespace=True when run with force_cleanup flag
otherwise cleaning up the secondary KubernetesServerRunner tries to
delete the namespace as well (since force overrides the reuse_namespace
flag in
https://github.com/grpc/grpc/blob/master/tools/run_tests/xds_k8s_test_driver/framework/test_app/base_runner.py#L76)
I'm not sure of the intended semantics of reuse_namespace and force, so
unclear if that conditional in base_runner.py should be changed to allow
the calls to cleanup the secondary KubernetesServerRunners continue to
forward the values of the cleanup/force_cleanup flags
* fix dates
* Add support for secondary kube context for failover test
* Revert "Add support for secondary kube context for failover test"
This reverts commit b7455f2a92.
* Revert "add to grpc_xds_k8s.sh"
This reverts commit 737f13fdc8.
* Fix potential_service_ports uninitialized variable error
When args.use_existing_gcp_resources is true(some of our testing environments set this), potential_service_ports is never set, which breaks some tests like test_api_listener
* Fix potentiel undefined variable error
* 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
* Bump Envoy and related submodules to latest
* Update googleapis
* Update scripts for newer submodules
* Update udpa
* Add opentelemetry
* Python changes for opentelemetry
* Update udpa in check_submodules
* Add opentelemetry to check submodules
* Regenerate upb files
* Add new proto dependency to upb-gen and Bazel
* Regenerate project
* 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
* 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
The alignment of `grpc_core::tcp_info` is 8-bytes and `socketlen_t` is
4-bytes. So, there is one 4-byte padding at the end of `tcp_info`:
```
grpc_core::tcp_info {
...
uint64_t tcpi_pacing_rate;
...
socklen_t len;
// There is a 4-byte hole here.
}
```
So, the length we calculate here is actually including len (we are
giving kernel 4 bytes more than we should):
info->length = sizeof(*info) - sizeof(socklen_t);
Kernel copies the length first, then copies the content. Hence it
overwrites the field by `tcpi_rcv_ooopack`. In cases, where the
`tcpi_rcv_ooopack` is less than the size of `grpc_core::tcp_info` we
won't get an asan error but otherwise we will correctly get an
asan complaint.
AFAICT, there is no real bufferoverflow though.
* 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
Otherwise, unless force_cleanup is set to true, the HTTP target proxy
deletion fails but still unsets the target_proxy field, resulting in the
gRPC target proxy deletion being skipped (and preventing all subsequent
cleanup operations)
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.
This commit adds an app that will be served as BinderTransport example
later.
Currently the app simply calls C++ function when button is pressed. In
the future the C++ function will run BinderTransport gRPC example
instead.
Tests not included in this commit, later we will add a build test to
CI to make sure this apk is always build-able. (This app will also be
used to make sure our BinderTransport implementation is compile-able
with Android toolchain, on GitHub) For now we exclude this target in
bazel build test.
Changes are made to WORKSPACE file in order to support android builds.
Build instructions are documented at
examples/android/binder/java/io/grpc/binder/cpp/example/README.md
* Add xds retry interop test to GKE test framework
* s/Affinity/Retry/
* more informative test name
* enable retry
* update java test server
* add missing import