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
* 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
A simple bitset type -- to replace `std::bitset` usage in #26698 and #26254
`std::bitset` uses at least 64 bits even to store two bits, and the usages I'm looking at would benefit from having something smaller in those circumstances
* Remove Python 2.7 binary wheels
* Make sure pip won't pick-up newer versions
* Attempt to fix the distribtest
* Fallback to virtualenv==16.7.9 for 34 and 35
* Remove 34 from binary wheel distribtests
* affinity test
- most basic affinity test
- verify that the received RDS and CDS are correctly configured for affinity
- verify that all RPCs are only sent to the one backend
- verify that only one sub-channel is connected, the other 2 are IDLE
And infra changes:
- add argument to set affinity config when creating backend service
- add a new backend service "affinity" to be shared by all affinity test
- this backend service is configured to do header affinity
- it has 3 endpoints
- replica support copied from PR https://github.com/grpc/grpc/pull/26360
- update backend services from GRPC to HTTP2, to disable validate-for-proxyless
- this will be reverted later
- add channelz function to query subchannels
- add method to configure the initial RPC config (RPC types and RPC metadata) when creating the client
- set env var to enable RING_HASH support
* c1
* REVERT THIS: update strategy to trigger a manual build
* config: suffix to prefix
* Revert "REVERT THIS: update strategy to trigger a manual build"
This reverts commit 830776fef9.
There was a bug in #26722 where we added a whitespace between comment
prefix and each line of the license notice, regardless it's empty or not.
This creates trailing whitespaces if the license note contains blank
lines, which makes most of the formatters and linters unhappy.
This PR resolves this issue.
* fix: If client request iterators raise exceptions, _consume_request_iterator should not dump its stack to stderr
fixes: #25339
* fix: use format_exc
* fix: linter
* fix: lint round 2
The XDS code incurs a significant binary size increase, and isn't
generally relevant/useful to builds of gRPC for mobile platforms.
Note that this makes it impossible to build the XDS for mobile platforms
(as opposed to turning XDS off by default but still allowing it to be
force-enabled via a config flag). We're going this route, because any
approach that turns the feature off by default on some platforms but
that still allows force-enabling it on those platforms ends up hitting
either bazel's limits (bazel doesn't support a select() statement where
multiple branches match), or ends up having to rely on the linker to
strip out unused code (by still including the srcs and deps
unconditionally, and using a preprocessor directive to remove symbol
references, which the linker can then remove), which we don't want to do
because relying on the linker makes it too easy to accidentally
re-introduce symbol references.