Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The process that fails to listen does not exit? #58

Open
Fiekers opened this issue Apr 28, 2024 · 10 comments
Open

The process that fails to listen does not exit? #58

Fiekers opened this issue Apr 28, 2024 · 10 comments

Comments

@Fiekers
Copy link

Fiekers commented Apr 28, 2024

Listen "external/0.0.0.0:1883" failed on 0.0.0.0:1883, IoError(Os { code: 98, kind: AddrInUse, message: "Address already in use" })

@Fiekers Fiekers changed the title listen failed process not exist? listen failed process not esxit? Apr 28, 2024
@Fiekers Fiekers changed the title listen failed process not esxit? The process that fails to listen does not exit? Apr 28, 2024
@rmqtt
Copy link
Owner

rmqtt commented Apr 28, 2024 via email

@Fiekers
Copy link
Author

Fiekers commented Apr 29, 2024

企业微信截图_1714360987652

@rmqtt
Copy link
Owner

rmqtt commented Apr 29, 2024 via email

@Fiekers
Copy link
Author

Fiekers commented Apr 29, 2024

How to exit the program when the port is occupied

@rmqtt
Copy link
Owner

rmqtt commented Apr 29, 2024 via email

@timzaak
Copy link

timzaak commented May 22, 2024

This would always happen when exec docker restart mqtt after client has connected.
may add signal::ctrl_c() broadcast queue, and close all resources after receive the message.
just like rathole project does.

@rmqtt
Copy link
Owner

rmqtt commented May 22, 2024 via email

@timzaak
Copy link

timzaak commented May 22, 2024

All config and run bash here: https://github.com/ForNetCode/mqtt-exec/tree/master/shell/prod

$ uname -a
Linux 10-23-70-251 5.15.0-43-generic #46-Ubuntu SMP Tue Jul 12 10:30:17 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
$ docker restart rmqtt 
rmqtt
$ docker logs --tail 10 rmqtt
024-05-22 03:40:30.968 ERRO rmqttd.189 | Listen "external/0.0.0.0:1883" failed on 0.0.0.0:1883, IoError(Os { code: 98, kind: AddrInUse, message: "Address in use" })
2024-05-22 03:40:30.968 INFO rmqtt_http_api::api.98 | HTTP API Listening on 0.0.0.0:6060, reuseaddr: true, reuseport: false
2024-05-22 03:40:30.969 INFO rmqtt::grpc::server.29 | gRPC server is listening on tcp://0.0.0.0:5363, reuseaddr: true, reuseport: false

After about 5 mins, docker restart would be ok.

@rmqtt
Copy link
Owner

rmqtt commented May 22, 2024 via email

@timzaak
Copy link

timzaak commented May 22, 2024

2024-05-22 06:01:21.803 INFO rmqtt_http_api::api.98 | HTTP API Listening on 0.0.0.0:6060, reuseaddr: true, reuseport: false
2024-05-22 06:01:21.804 INFO rmqtt::grpc::server.29 | gRPC server is listening on tcp://0.0.0.0:5363, reuseaddr: true, reuseport: false
2024-05-22 06:02:19.618 INFO rmqtt::settings.114 | node_id is 1
2024-05-22 06:02:19.618 INFO rmqtt::settings.115 | exec_workers is 200
2024-05-22 06:02:19.618 INFO rmqtt::settings.116 | exec_queue_max is 3000
2024-05-22 06:02:19.618 INFO rmqtt::settings.117 | local_exec_workers is 5
2024-05-22 06:02:19.618 INFO rmqtt::settings.118 | local_exec_queue_max is 1000
2024-05-22 06:02:19.618 INFO rmqtt::settings.119 | local_exec_rate_limit is (100, 1s)
2024-05-22 06:02:19.619 INFO rmqtt::settings.120 | node.busy config is: Busy { check_enable: true, update_interval: 2s, loadavg: 80.0, cpuloadavg: 90.0, handshaking: 0 }
2024-05-22 06:02:19.620 INFO rmqtt_acl.50 | rmqtt-acl init
2024-05-22 06:02:19.620 INFO rmqtt_acl.79 | rmqtt-acl start
2024-05-22 06:02:19.620 INFO rmqtt_counter.34 | rmqtt-counter init
2024-05-22 06:02:19.620 INFO rmqtt::grpc::server.29 | gRPC server is listening on tcp://0.0.0.0:5363, reuseaddr: true, reuseport: false
2024-05-22 06:02:19.620 INFO rmqtt_counter.97 | rmqtt-counter start
2024-05-22 06:02:19.620 INFO rmqtt_http_api.85 | rmqtt-http-api init
2024-05-22 06:02:19.620 INFO rmqtt_http_api.122 | rmqtt-http-api start
2024-05-22 06:02:19.620 INFO rmqtt_http_api::api.98 | HTTP API Listening on 0.0.0.0:6060, reuseaddr: true, reuseport: false
2024-05-22 06:02:19.620 ERRO rmqttd.189 | Listen "external/0.0.0.0:1883" failed on 0.0.0.0:1883, IoError(Os { code: 98, kind: AddrInUse, message: "Address in use" })

same error with listener.tcp.external.reuseport = true

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants