-
Notifications
You must be signed in to change notification settings - Fork 3.9k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
core: Added changes to DelayedStream.setStream() should cancel the provided stream if not using it #11969
base: master
Are you sure you want to change the base?
Conversation
…ovided stream if not using it
@@ -271,14 +272,41 @@ public void uncaughtException(Thread t, Throwable e) { | |||
verifyNoMoreInteractions(mockRealStream); | |||
} | |||
|
|||
@Test | |||
public void newStreamThenShutDownNow() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
append test with UT method name -> testNewStreamThenShutDownNow()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed.
ClientStream stream = delayedTransport.newStream( | ||
method, new Metadata(), CallOptions.DEFAULT, tracers); | ||
stream.start(streamListener); | ||
assertEquals(1,delayedTransport.getPendingStreamsCount()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add an empty line above asserts statements in all applicable places.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added some minor comments, please check.
…ovided stream if not using it
return null; | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove an empty line here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes LGTM
synchronized (this) { | ||
// If realStream != null, then either setStream() or cancel() has been called. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Has this changed ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, added back the removed comment, it was accidentally missed while updating the code, but the logic still holds. if realStream() != null, it means setStream() was called, and if listener !=null, the old stream may have been cancelled.
ClientStream stream = delayedTransport.newStream( | ||
method, new Metadata(), CallOptions.DEFAULT, tracers); | ||
stream.start(streamListener); | ||
assertEquals(1,delayedTransport.getPendingStreamsCount()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add a space after the comma...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed.
verify(streamListener).closed( | ||
statusCaptor.capture(), any(RpcProgress.class), any(Metadata.class)); | ||
|
||
assertEquals(0,delayedTransport.getPendingStreamsCount()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add a space after the comma...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed.
This allows Filters to access the xds configuration for their own processing. From gRFC A83: > This data is available via the XdsConfig attribute introduced in A74. > If the xDS ConfigSelector is not already passing that attribute to the > filters, it will need to be changed to do so.
It is much harder to debug refcounting problems when we ignore impossible situations. So make such impossible cases complain loudly so the bug is obvious.
This is to support gRFC A83 xDS GCP Authentication Filter: > Otherwise, the filter will look in the CDS resource's metadata for a > key corresponding to the filter's instance name.
panic() calls a good amount of code, so it could get another exception. The SynchronizationContext is running on an arbitrary thread and we don't want to propagate this secondary exception up its stack (to be handled by its UncaughtExceptionHandler); it we wanted that we'd propagate the original exception. This second exception will only be seen in the logs; the first exception was logged and will be used to fail RPCs. Also related to http://yaqs/8493785598685872128 and b692b9d
…already have their connections cancelled (grpc#11934) Some clients watching health status can cancel their watch and `HealthService` when trying to notify these watchers were getting CANCELLED exception because there was no cancellation handler set on the `StreamObserver`. This change sets the cancellation handler that removes the watcher from the set of watcher clients to be notified of the health status.
Previously it would wait for the new LB to enter READY. However, that prevents there being an upper-bound on how long the old policy will continue to be used. The point of graceful switch is to avoid RPCs seeing increased latency when we swap config. We don't want it to prevent the system from becoming eventually consistent.
I think at some point there were more usages in the tests. But now it is pretty easy. PriorityLb.ChildLbState.picker is initialized to FixedResultPicker(NoResult). So now that GracefulSwitchLb is using the same picker, equals() is able to de-dup an update.
…CING_CONFIG (grpc#11982) ATTR_LOAD_BALANCING_CONFIG was deleted in bf7a42d.
"EXP" stood for experimental and all documentation that referenced it made it clear it was experimental. It's been some years since we started logging a message when it was used to say it will be deleted. There's no time like the present to delete it.
…ovided stream if not using it
…ovided stream if not using it
This reverts commit 67b2f3a.
…ed_1537 # Conflicts: # core/src/test/java/io/grpc/internal/DelayedClientTransportTest.java
@AgraVator Gentle reminder on review.. |
core: Added changes to DelayedStream.setStream() should cancel the provided stream if not using it
Fixes: #1537