-
Couldn't load subscription status.
- Fork 54
Description
We observed that requeuing mails using the suggested unit from the docs does never work.
While tracing continuous coredumps in the most recent gromox 2.43 we found out that it will never work by design. We observed a continuous trashing of readdir on /var/lib/gromox/queue/mess/ with failed openat of gromox-delivery. After some gdb based analysis we found what the process does and the origin of the issue:
- the
messdirectory is scanned inmdq_thrworkand for each file which should be processedmessage_dequeue_load_from_messis called in L432 - the filename is not passed as a parameter - instead the string is converted to a long integer using strtol
- the base parameter is set to
0- so that the numeric base is derived from the string (so it is interpreted as octal notation, but it is already bricked because of the leading zero) - inside of the
message_dequeue_load_from_messfunction the integer value is converted back (!) to a string using std::to_string => decimal representation
This loops over again and again - what a MESS!
Please consider not to convert filename strings to integer just to convert them back to strings some CPU clocks later (mind the 🌳). IMHO a good approach would be to pass always a filename (string) on message_dequeue_load_from_mess and move the to_string to the msgrcv handling, only.