File tree Expand file tree Collapse file tree
rsocket-core/src/main/java/io/rsocket/loadbalance Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11/*
2- * Copyright 2015-2020 the original author or authors.
2+ * Copyright 2015-2021 the original author or authors.
33 *
44 * Licensed under the Apache License, Version 2.0 (the "License");
55 * you may not use this file except in compliance with the License.
@@ -85,8 +85,8 @@ public void onError(Throwable t) {
8585 }
8686
8787 this .doFinally ();
88- // terminate upstream which means retryBackoff has exhausted
89- this .terminate (t );
88+ // terminate upstream ( retryBackoff has exhausted) and remove from the parent target list
89+ this .doCleanup (t );
9090 }
9191
9292 @ Override
@@ -108,15 +108,15 @@ protected void doSubscribe() {
108108
109109 @ Override
110110 protected void doOnValueResolved (RSocket value ) {
111- value .onClose ().subscribe (null , t -> this . doCleanup (), this :: doCleanup );
111+ value .onClose ().subscribe (null , this :: doCleanup , () -> doCleanup (ON_DISPOSE ) );
112112 }
113113
114- void doCleanup () {
114+ void doCleanup (Throwable t ) {
115115 if (isDisposed ()) {
116116 return ;
117117 }
118118
119- this .dispose ( );
119+ this .terminate ( t );
120120
121121 final RSocketPool parent = this .parent ;
122122 for (; ; ) {
You can’t perform that action at this time.
0 commit comments