File tree Expand file tree Collapse file tree
server/src/main/java/io/envoyproxy/controlplane/server Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -228,15 +228,10 @@ public void onNext(DiscoveryRequest request) {
228228
229229 if (defaultTypeUrl .equals (ANY_TYPE_URL )) {
230230 if (requestTypeUrl .isEmpty ()) {
231- synchronized (responseObserver ) {
232- if (!isClosing ) {
233- isClosing = true ;
234- responseObserver .onError (
235- Status .UNKNOWN
236- .withDescription (String .format ("[%d] type URL is required for ADS" , streamId ))
237- .asRuntimeException ());
238- }
239- }
231+ closeWithError (
232+ Status .UNKNOWN
233+ .withDescription (String .format ("[%d] type URL is required for ADS" , streamId ))
234+ .asRuntimeException ());
240235
241236 return ;
242237 }
@@ -297,12 +292,7 @@ public void onError(Throwable t) {
297292
298293 try {
299294 callbacks .forEach (cb -> cb .onStreamCloseWithError (streamId , defaultTypeUrl , t ));
300- synchronized (responseObserver ) {
301- if (!isClosing ) {
302- isClosing = true ;
303- responseObserver .onError (Status .fromThrowable (t ).asException ());
304- }
305- }
295+ closeWithError (Status .fromThrowable (t ).asException ());
306296 } finally {
307297 cancel ();
308298 }
You can’t perform that action at this time.
0 commit comments