File tree Expand file tree Collapse file tree 1 file changed +5
-15
lines changed
server/src/main/java/io/envoyproxy/controlplane/server Expand file tree Collapse file tree 1 file changed +5
-15
lines changed Original file line number Diff line number Diff line change @@ -228,15 +228,10 @@ public void onNext(DiscoveryRequest request) {
228
228
229
229
if (defaultTypeUrl .equals (ANY_TYPE_URL )) {
230
230
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 ());
240
235
241
236
return ;
242
237
}
@@ -297,12 +292,7 @@ public void onError(Throwable t) {
297
292
298
293
try {
299
294
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 ());
306
296
} finally {
307
297
cancel ();
308
298
}
You can’t perform that action at this time.
0 commit comments