You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This approach is not valid because it will lead to sending XDS responses out-of-order for given DiscoveryRequestStreamObserver.
We should switch our parallel ExecutorGroup implementation to multiple, single-threaded ThreadPoolExecutors. This way we will ensure that single DiscoveryRequestStreamObserver is running sequentially, but many DiscoveryRequestStreamObservers may run in parallel.
Implementation of such ExecutorGroup may look like this (not tested):
classSequentialExecutorGroup(
threads:Int,
singleThreadedExecutorFactory: (Int) ->ExecutorService
) : ExecutorGroup {
privateval executors = (0 until threads).map(singleThreadedExecutorFactory)
privateval counter =AtomicInteger(0)
overridefunnext(): Executor {
val index = counter.getAndUpdate { c ->val next = c+1if (next >= executors.size) {
0
} else {
next
}
}
return executors[index]
}
}
The text was updated successfully, but these errors were encountered:
Currently we use one
ThreadPoolExecutor
shared for allDiscoveryRequestStreamObserver
s as anExecutorGroup
: https://github.com/allegro/envoy-control/blob/master/envoy-control-core/src/main/kotlin/pl/allegro/tech/servicemesh/envoycontrol/ControlPlane.kt#L105(only when corresponding property is set to
PARALLEL
, which is not the default)This approach is not valid because it will lead to sending XDS responses out-of-order for given
DiscoveryRequestStreamObserver
.We should switch our parallel
ExecutorGroup
implementation to multiple, single-threadedThreadPoolExecutor
s. This way we will ensure that singleDiscoveryRequestStreamObserver
is running sequentially, but manyDiscoveryRequestStreamObserver
s may run in parallel.Implementation of such ExecutorGroup may look like this (not tested):
The text was updated successfully, but these errors were encountered: