bug: In proxy UDP, roundrobin is unbalanced
Issue description
When I used UDP proxy, I find roundrobin unbalanced. Once the connection is established, it will always send a message to only one of the nodes!
Environment
- apisix version (cmd:
apisix version): 2.0 - OS:centos7
Minimal test code / Steps to reproduce the issue
-
config stream_routes: { "server_addr": "10.3.174.125",
"server_port": 9200,
"upstream": { "nodes": { "10.3.174.127:29090": 1, "10.3.174.126:29090": 1 }, "type": "roundrobin" } } -
test send message,I sent several pieces of data to ApisiX 9200 port with the nc command,commplete command: nc -p 6336 -u 10.3.174.125 9200

3.Apisix would forward the UDP message sent, but it was forwarded to only one node without load balancing effect, which made me very confused:

What's the actual result? (including assertion message & call stack if applicable)
You can see that the message is only forwarded to node 126!
What's the expected result?
I expect to achieve responsible and balanced results.
Hi, @zhuchengxing, have you check the error log?
And you can try to send UDP package to node 127 directly. Like this
nc -p 6336 -u 10.3.174.127 290290
Is that ok?
@zhuchengxing any update? my environment ( master branch ) is reproduce the problem according to your steps
Hi, @zhuchengxing, have you check the error log?
And you can try to send UDP package to node 127 directly. Like this
nc -p 6336 -u 10.3.174.127 290290Is that ok?
yes ! nc -p 6336 -u 10.3.174.127 29090
@zhuchengxing any update? my environment ( master branch ) cannot reproduce the problem according to your steps,
!!!!! I just tried it again, but it still doesn't load balance, is that because the master branch has changed? i used 2.0
@zhuchengxing I reproduce your problem now, i am not familiar with this feature, cc @membphis
@idbeta ok, thanks .
welcome to submit PR to fix this issue
Can't reproduce on master
@shuaijinchao Could you reproduce it?
I can’t reproduce this problem using nc and client in a local debug environment

Consider solved. Feel free to reopen it if need.