Be more careful about checking upstreams were removed
This commit is contained in:
@@ -90,7 +90,8 @@ class Routing(val downstream: String, ownerAddress: InterfaceAddress? = null) {
|
|||||||
|
|
||||||
override fun onLost() = synchronized(this@Routing) {
|
override fun onLost() = synchronized(this@Routing) {
|
||||||
val subrouting = subrouting ?: return
|
val subrouting = subrouting ?: return
|
||||||
check(upstreams.remove(subrouting.upstream))
|
// we could be removing fallback subrouting which no collision could ever happen, check before removing
|
||||||
|
if (subrouting.upstream != null) check(upstreams.remove(subrouting.upstream))
|
||||||
subrouting.close()
|
subrouting.close()
|
||||||
TrafficRecorder.update() // record stats before removing rules to prevent stats losing
|
TrafficRecorder.update() // record stats before removing rules to prevent stats losing
|
||||||
subrouting.revert()
|
subrouting.revert()
|
||||||
|
|||||||
Reference in New Issue
Block a user