Repository navigation
Closed
Labels
Description
Hi. Report a bug in ConnectionBalancer
When pickTargetHandler is called, Count 1 increases as shown below.
BalancedConnectionHandler&
ExactConnectionBalancerImpl::pickTargetHandler(BalancedConnectionHandler&) {
--- skip ---
min_connection_handler->incNumConnections(); ///< increment connection count
}
return *min_connection_handler;
}
However, the connection count is always 0, and the connection balancer is not processed as expected. (See log below)
[DEBUG] WORKER[0] CONNECTION COUNT[0]
[DEBUG] WORKER[1] CONNECTION COUNT[0]
[DEBUG] incNumConnections!!!!!! ///< increment count 1
[DEBUG] decNumConnections!!!!!! ///< decrement ??
[DEBUG] incNumConnections!!!!!! ///< increment count 1 ???
///< next connection receive
[DEBUG] WORKER[0] CONNECTION COUNT[0] //< why 0???
[DEBUG] WORKER[1] CONNECTION COUNT[0]
[DEBUG] incNumConnections!!!!!!
[DEBUG] decNumConnections!!!!!!
[DEBUG] incNumConnections!!!!!!
Temporarily modified as follows and it resolved.
BalancedConnectionHandler&
ExactConnectionBalancerImpl::pickTargetHandler(BalancedConnectionHandler&) {
--- skip ---
min_connection_handler->incNumConnections();
#ifdef _BUG_CONN_BALANCER_
min_connection_handler->incNumConnections(); ///< add
#endif
}
return *min_connection_handler;
}
Please review.
Thanks.
Reference information
Envoy Binary Version
./envoy version: 430fb4cd4004831170885184066045a3902acc4b/1.17.0/Modified/RELEASE/BoringSSL
Configuration
apiVersion: networking.istio.io/v1alpha3
kind: EnvoyFilter
metadata:
name: test-filter
namespace: istio-system
spec:
configPatches:
- applyTo: LISTENER
match:
context: SIDECAR_OUTBOUND
listener: {}
patch:
operation: MERGE
value:
connection_balance_config:
exact_balance: {}
Activity
mattklein123 commentedon Apr 22, 2021
cc @lambdai I think this is the bug you are currently fixing?
dmsqls commentedon Apr 26, 2021
No, I'm not currently fixing it.
lambdai commentedon Apr 26, 2021
@dmsqls Thanks for the analysis.
Will be fixed by #15842
Before the fix, only the balance depends on the connections owned by the virtualoutbound listener. The number of connections is usually 0 there.
With my fix and the envoy filer crd, the connection will be balanced as your expectation
dmsqls commentedon Apr 27, 2021
Thank you. It works as expected. 👍
Listener: respect the connection balancer of the redirected listener (#…