-
This doesn't actually fix a real bug, just makes assumptions clear.
-
This fixes not handling the last packet(s) of a client that disconnects.
-
This is an (insignificant) amount slower, but otherwise existing sessions won't get the new limits when reloading the config.
-
Because that's what's it is now. A lot of code can be refactored to get the settings from this now, but I'm not going to do that yet.
-
This entails making copies of the original packet when necessary, because QoS 0 doesn't have a packet id. I tried to keep it to an absolute minimum and do some precarious optmizations for it. There are tests though.
-
It caused really funky behavior. When a destructed client closed fd 0, eventfd() would give 0 back as fd. This would then later give errors.
-
This makes more sense, logically, and also helps in tests I'm about to write.
-
There was not really a benefit to the old method, and this prevents packet pile up and keeps the code cleaner.
-
It caused typical global variable issues, showing in the retained messages recursive alghorithm breaking, because the referenced subtopics changed half way (see previous commit of the test for it). I need to perform some benchmarks to see if I need to devise an alternative.
-
Committing separately, because I want to be able to revert the fix I'm about to commit.
-
I don't know what is a good value. I'm upping it, together with (the possibility of increasing) net.core.somaxconn and net.ipv4.tcp_max_syn_backlog. The listen backlog is truncated to somaxconn, to having a high value makes sense. It seems to fix the kernel TCP SYN flooding warnings, if also disabling SYN cookies.
-
Functionally, this doesn't change anything.
-
When clients connect, they get the retained messages. There is no need to do that while holding the subscriptions lock.
-
This mutes all INFO and NOTICE. Also fixed the parsing of the log_subscriptions.
-
The file IO is blocking, so we don't want that in our thread loops.
-
One fix is client destruction happening on the correct thread (when kicking another one off with existing client ID). This caused deadlocks on the subscriptions lock during a race condition when doKeepAliveCheck() also ran. A related deadlock was that the queued functions were executed while holding the lock taskQueueMutex. Together with the subscriptions lock, that was executed in the $SYS topic function, this also caused deadlocks.
-
The initial concept of iterating over a vector being fast didn't help, and made having many subscribers to one topic very slow.