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
killall -HUP disconnects clients #657
Comments
Could you show the version? I reproduced this issue only on develop branch, while not on master v1.4.14. Maybe it's a bug on develop. Result on develop branch:
|
Found the first bad commit by using git bisect.
|
I roughly checked the sources of the commit, but I'm not sure what is wrong. @ralight could you reconfirm it? |
I have reproduced it in the ppa versio for ubuntu (1.4.14) and the base
version of Ubuntu 16.4 LTS (1.4.8). I seams that is has been disconnecting
client every now an then all the time, but as i have been added more and
more clients and extended the logging it happens every time for some
clients.
/Tomas
Den 23 dec. 2017 14:08 skrev "toast-uz" <[email protected]>:
Could you show the version?
I reproduced this issue only on develop branch, while not on master
v1.4.14. Maybe it's a bug on develop.
Result on develop branch:
$ cat test.conf
log_type all
$ mosquitto -c test.conf &
[1] 3812
$ 1514034102: mosquitto version 1.4.90 (build date 2017-12-23
13:01:13+0000) starting
1514034102: Config loaded from test.conf.
1514034102: Opening ipv4 listen socket on port 1883.
1514034102: Opening ipv6 listen socket on port 1883.
(connected from another window)
$ 1514034117: New connection from ::1 on port 1883.
1514034117: New client connected from ::1 as mosqsub|3815-ip-172-31- (c1, k60).
1514034117: Sending CONNACK to mosqsub|3815-ip-172-31- (0, 0)
1514034117: Received SUBSCRIBE from mosqsub|3815-ip-172-31-
1514034117: # (QoS 0)
1514034117: mosqsub|3815-ip-172-31- 0 #
1514034117: Sending SUBACK to mosqsub|3815-ip-172-31-
$ ps -ef | grep mosquitto
centos 3812 2043 0 13:01 pts/0 00:00:00 mosquitto -c test.conf
centos 3815 2071 0 13:01 pts/1 00:00:00 mosquitto_sub -h localhost -t #
centos 3817 2043 0 13:02 pts/0 00:00:00 grep --color=auto mosquitto
$ sudo kill -s HUP 3812
$ 1514034159: Reloading config.
1514034159: Client mosqsub|3815-ip-172-31- disconnected.
1514034160: New connection from ::1 on port 1883.
1514034160: New client connected from ::1 as mosqsub|3815-ip-172-31- (c1, k60).
1514034160: Sending CONNACK to mosqsub|3815-ip-172-31- (0, 0)
1514034160: Received SUBSCRIBE from mosqsub|3815-ip-172-31-
1514034160: # (QoS 0)
1514034160: mosqsub|3815-ip-172-31- 0 #
1514034160: Sending SUBACK to mosqsub|3815-ip-172-31-
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#657 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ALNLfNpykgBwyH1jsa7PXk1SwTwj2AXcks5tDPtNgaJpZM4RKvd1>
.
|
Thank you for the information. |
I've not reproduced it under 1.4.14, but have done on develop. I haven't tried the actual binary from the 1.4.14 PPA though. @kartom, if you get chance could you try a self compiled version 1.4.14? I doubt I'll be able to look any further for the next few days. |
I'm running mosquitto 1.4.14 from the PPA for Ubuntu xenial, and it shows the same behaviour. I have a sub client running all the time, and I see that it receives old retained messages when the server rotates the logs (mosquitto server gets a HUP signal). |
I've pushed a fix for the develop branch but still haven't reproduced it on 1.4.14. |
I have the same issue with 1.5.3 and 1.5.5. You don't really see it with
You can see the last 'login succeeded' again, and you can see the client ID is the same. This is the mosquitto config:
Started with This is a self-compiled binary. (I don't know why it's saying I don't have |
For some people this could be due to the logrotate script on Debian incorrectly calling "killall mosquitto", which would kill any tasks with mosquitto in the name, not just the mosquitto broker. This is being fixed now. For completely self compiled and installed binaries that won't be the cause. |
I'm confused. Why would this be the cause? I only have Mosquitto running as broker on the server, nothing else by that name. |
That's why I said "for some people". If you had clients running on the same machine as the broker, with "mosquitto" in their name, then they would be unexpectedly sent a HUP. |
I'm getting this too. I just upgraded to 1.6.8 b/c of #1459 and though the error related to that one is gone, a HUP still kills all client connections. I run from the Docker container, as a systemd service:
|
I think this has been fixed. The issue is around files not being accessible after root privileges have been dropped. |
The command killall -HUP which is used by i.e. the logrotate script in Ubuntu causes mosquitto to disconnect all clients, which leads to problems in some situations.
This problem seam to be realted to the reload of the configuration file and the content in the config.
I have not been able to figure out what is causing the problem but here is a mosquitto.con that makes mosquitto disconnect all clients everytime you send a killall -HUP mosquitto:
The text was updated successfully, but these errors were encountered: