oceanbase / obproxy

A proxy server for OceanBase Database.
https://open.oceanbase.com
Other
114 stars 79 forks source link

obproxy didn't bind to listen_port #9

Closed stutiredboy closed 3 years ago

stutiredboy commented 3 years ago

for example:

bin/obproxy -o enable_strict_kernel_release=False,enable_cluster_checkout=False,syslog_level=DEBUG --listen_port 3306 --prometheus_listen_port 22884 --rs_list "192.168.1.243:3306;192.168.1.244:3306;192.168.1.245:3306"

obproxy.log showed obproxy init succ with port 3306:

[2021-06-21 17:38:05.419882] INFO  [PROXY] ob_proxy_config.cpp:46 [7932][Y0-0] [lt=3] [dc=0] | listen_port                          = 3306
[2021-06-21 17:38:05.422586] INFO  [PROXY] ob_mysql_proxy_server_main.cpp:232 [7932][Y0-0] [lt=6] [dc=0] succ init mysql proxy port by config(proxy_port={10.90.71.13:0}, port=3306})

but actually, it didn't bind to the listen_port, instead it used a random port(after reboot obproxy, the port will change)

image

This bug may caused by these commits:

image

commits before de1c5e3 is ok.

stutiredboy commented 3 years ago

https://github.com/oceanbase/obproxy/commit/5d57e2ad94750fafb3dc9852bc390b6e86d28f67

commit in src/obproxy/iocore/net/ob_inet.h may be the root cause of this sistuation.

wgs13579 commented 3 years ago

fixed