Users relying on internal upb functions may be broken as these are meant to be *internal*. In the interim, users may need to update their code by using the new Map iteration API.
PiperOrigin-RevId: 730929091
[PH2][Test][Transport] Adding missing test to party_test.cc
This test asserts that the on_complete function of the Spawn should be called even if the first promise returns failing status.
Closes#38818
COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/38818 from tanvi-jagtap:missing_unit_test 789f19a964
PiperOrigin-RevId: 730883583
Since our tests change behavior if this experiment is toggled but not all our tracer implementations support this experiment we need to not fuzz across it.
Closes#38834
COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/38834 from ctiller:ctracer b337304d5c
PiperOrigin-RevId: 730712459
[PH2][Test][Transport] New flags for new transport
And we will make it such that passing "http2*" will still cause our new logs to printed in debug mode (our new trace is a debug only trace)
Closes#38817
COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/38817 from tanvi-jagtap:new_tracer 2ea9e787ec
PiperOrigin-RevId: 730326066
[PH2][Trivial][BUILD] Adding log
Adding logs were I debug frequently. It is annoying to add it manually each time I need to debug in a new workspace.
Eventually debugging and debuggability code will be added to all these critical files. Better to reduce time waste of adding log to dependencies each time I am just trying to see a LOG statement.
Closes#38800
COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/38800 from tanvi-jagtap:add_log_where_i_need 5b70f81d1f
PiperOrigin-RevId: 730301757
Fix#38728 heap-use-after-free. Details in the issue.
Also, fix a bug in chttp2 where we are using the parent call tracer instead of the call attempt tracer to record annotations for a stream.
Test is being added in https://github.com/grpc/grpc/pull/38437Closes#38729
COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/38729 from yashykt:FixCallAttemptTracer cb09add0b2
PiperOrigin-RevId: 729307540
Includes support for OnFinalize, OnClientToServerHalfClose, OnServerTrailingMetadata, StartTransportOp and GetChannelInfo.
Closes#38784
COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/38784 from Vignesh2208:fusion-update-next 8619e193ef
PiperOrigin-RevId: 729252149
WithResult acts as a type checker to assert that the promise passed to the function returns the expected type (i.e. Poll\<T\>). The name WithResult does not imply that the function is an assertion.
Closes#38743
COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/38743 from ac-patel:fix_typo 4fa77b7573
PiperOrigin-RevId: 728914326
adding a legacy version of chaotic good, used when a new experiment is disabled.
Aim will be to merge this, then land #38286 atop it, putting that change under the control of this experiment.
Closes#38786
COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/38786 from ctiller:legacy-again e2b0c59817
PiperOrigin-RevId: 728822723
I just happened to notice this while working on something else. Now that the WorkSerializer always runs callback asynchronously, there's no need for the extra hop through ExecCtx here.
Closes#38782
COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/38782 from markdroth:rls_work_serializer_cleanup 5487a8bf95
PiperOrigin-RevId: 728762272
The fuzzer found an edge case introduced in https://github.com/grpc/grpc/pull/38698.
If the last watch for a given xDS channel is stopped while the ADS stream is in retry backoff, then we didn't wind up unreffing the xDS channel, so we incorrectly started a new ADS stream once the backoff timer fired. In that new ADS stream, if we receive a message (which admittedly shouldn't happen in practice, since we haven't yet sent any subscription requests on the stream, but it's not impossible if there's a misbehaving xDS server), then we will [call `SendMessageLocked()` to send an ACK or NACK](822f9b1519/src/core/xds/xds_client/xds_client.cc (L1366)). `SendMessageLocked()` would then finally [do a pass to remove unsubscribed cached resources](822f9b1519/src/core/xds/xds_client/xds_client.cc (L894)), which would unref the xDS channel and the ADS stream. That would cause [the underlying stream to be orphaned](822f9b1519/src/core/xds/xds_client/xds_client.cc (L760)), but then [`SendMessageLocked()` would try accessing it](822f9b1519/src/core/xds/xds_client/xds_client.cc (L908)) after that, leading to a use-after-free crash.
The fix is that if we unsubscribe to a resource while we are in backoff, we immediately do the pass to remove unsubscribed cached resources, which will immediately unref the xDS channel and stop the backoff timer if it was the last resource subscribed to on that stream.
b/396323510
b/396313839
Closes#38736
COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/38736 from markdroth:xds_client_deferred_cache_deletion_fix 6f529665da
PiperOrigin-RevId: 728256422
See https://github.com/grpc/proposal/pull/475 for details.
While I was at it, I greatly simplified the logic, avoiding an unnecessary duplicate loop over all endpoints that we didn't need to be doing.
I removed an unnecessary end2end test that was broken by this change. That test actually should have broken when I first changed ring_hash to delegate to pick_first back in #34244, and I'm not sure why it didn't. But it definitely broke here when I changed the logic to not choose endpoints in any specific order when triggering connection attempts, and since the test was really intended to test a behavior that we no longer guarantee, I removed it.
In its place, I added a unit test that shows the new behavior in a much clearer way. (Originally, we didn't have a good way to write unit tests for LB policies, so all of our tests were written as e2e tests. Now that we do have a good framework for unit tests, we've been slowly finding e2e tests that really should be unit tests instead, and moving them over when we find them.)
Closes#38741
COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/38741 from markdroth:ring_hash_tf_and_connecting_fix 6c4c773381
PiperOrigin-RevId: 728255272
Builds on #38745
When we have a promise factory of the form:
`[]() { blah(); return 7; };`
We currently rewrite it to a promise factory of
```
[]() {
return []() -> Poll<int> { blah(); return 7; }
}
```
which is correct, but unintuitive -- the delayed execution of blah() after the factory execution is surprising, because if we make the small change to rewrite the original to:
`[]() { blah(); return Immediate(7); }`
then the promise factory is instead:
```
[]() {
blah();
return []() { return 7; };
}
```
and at least my intuition says that this should be the form of the original rewrite too. This change makes that so.
Closes#38756
COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/38756 from ctiller:noup2 751843ae62
PiperOrigin-RevId: 728243208
There's a case to be made that this could be legal, but in practice it almost always leads to the wrong thing.
Closes#38745
COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/38745 from ctiller:noup fe44ce0bbe
PiperOrigin-RevId: 728018238
This reverts commit a7a650a74e.
Original PR breaks #38286 and I think the breakage is in the PR -- in a construct like:
```
TrySeq(
/*a*/ []() -> Promise<absl::Status>,
/*b*/ []() -> Promise<StatusFlag>,
/*c*/ []() -> Promise<absl::Status>)
```
the original seq_state code would try to promote the intermediate `StatusFlag` to an `absl::Status` which is great - however with the optimization, if `b` is instantaneous we try to demote the result of `a` to `StatusFlag`, losing information.
I'll need to consider how to change this optimization to preserve the final output type before rolling forward.
Closes#38748
COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/38748 from ctiller:rb1 743eb33bdf
PiperOrigin-RevId: 727109120
I made seqs/joins copyable a while ago in anticipation of a nice optimization -- that didn't pan out.
Having them copyable makes it more likely that `Loop` will accept them and try to turn them from promises into the promise factory that it expects, copying the insides... *which is usually wrong* and incredibly frustrating to debug.
Closes#38744
COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/38744 from ctiller:promising e7a0e8d0bb
PiperOrigin-RevId: 727006243
<!--
If you know who should review your pull request, please assign it to that
person, otherwise the pull request would get assigned randomly.
If your pull request is for a specific language, please add the appropriate
lang label.
-->
Closes#38739
PiperOrigin-RevId: 726671784
We can't put a uint32 into a C-style enum, so clamp the input from the fuzzer to an acceptable range.
Closes#38738
COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/38738 from ctiller:api1 47b5c15238
PiperOrigin-RevId: 726668594
Increasingly as we write sequences, we find ourselves writing some asynchronous parts interleaved with some synchronous parts. This PR seeks to provide a basic optimizer for sequences - it detects immediate returning promises (by the lack of a `Poll<T>` return type), and eliminates the state machinery required to evaluate them at compile time.
Closes#38445
COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/38445 from ctiller:optseq 81c5025d76
PiperOrigin-RevId: 726641700
Fix several bugs that all contributed to this test failing:
1. a set of overflow/underflow conditions in fuzzing event engine if no timers were set
2. gigabytes of payload being presented to a fuzzer causing it to time out
3. the server fuzzer not cancelling calls, leading to some calls being stuck during an invalid shutdown sequence
4. a bug in chaotic good whereby a call could get stuck writing a payload forever
Additionally, I took the time to improve the debug-ability of stuck reads in fuzzing event engine somewhat - since that was a frustrating experience in looking at this.
Closes#38712
COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/38712 from ctiller:f1 c818031d1c
PiperOrigin-RevId: 726634838
If we enable the tracer `promise_primitives` during this test we end up dereferencing a nullptr.
Closes#38735
COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/38735 from ctiller:bugz 3e39895b57
PiperOrigin-RevId: 726611040
The bug was triggered in a fairly rare sequence of events: the subchannel needed to report TRANSIENT_FAILURE as its initial state but then be in IDLE state by the time that Happy Eyeballs got to it. Because we had recorded that the subchannel already saw TRANSIENT_FAILURE state before Happy Eyeballs got to it, it was not considered a new failure, which broke the logic we use to trigger exiting from the initial Happy Eyeballs pass and continue connecting. The fix is to not record that the subchannel saw TRANSIENT_FAILURE state until we get to it in the Happy Eyeballs pass.
b/394267714
Closes#38714
COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/38714 from markdroth:pick_first_happy_eyeballs_bugfix 97eb11f9ef
PiperOrigin-RevId: 726236599
It turned out that gRPC doesn't need to include `google/protobuf/compiler/php/php_generator.h`. Rather including `google/protobuf/compiler/php/names.h` (which is a smaller one) should be sufficient.
Closes#38718
COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/38718 from veblush:php-gen 671aa573e2
PiperOrigin-RevId: 725818983
This library would be a huge improvement for gRPC tests that deal with absl::Status and absl::StatusOr objects.
Closes#38709
COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/38709 from eugeneo:build/status_matchers 2a5bd89612
PiperOrigin-RevId: 725775867