When posting messages that will result in email sends, noticeable delays are evident. I suspect these are even leading to missing emails.
Steps to reproduce
Using mattermost 3.5 with email send configured with an smtp server, no authentication. Approx 250 users in the team.
- post message to an online user
- post message to an offline user
- post @all message in Town Square
I would expect the interface to respond immediately in all three cases showing the message as posted. I would also expect all the emails to be sent of course.
Posts to online users appear immediately.
Posts to offline users show a noticeable delay, during which the text is grey and there is a wait icon displayed.
Posts that will result in a lot of emails, like @all in Town Square, can take tens of seconds to appear confirmed.
This effect has become much more noticeable since we moved our mattermost server to a different host, which I suspect is because the communication between the new host and the smtp server is slower.
I suspect (unconfirmed) that we are also getting missing emails when the posting user does not wait for the post to complete. If they instead go to another channel, close their session etc, then I think the emails are not sent. We have had various reports of users failing to get email notifications in situations that they would expect to get them, and the evidence so far would be consistent with this theory although it’s difficult to know. There is one known example of an @all post being “abandoned” in this way while still showing the wait icon, and it seems that some users were notified by email while others were not. There are no errors in the log related to email sends.
I am not sure if this only affects users with their email send set to Immediate, but almost all of our users do have that set.
If I’m right about the underlying cause of the slow post and missing emails, I’d suggest that the email sending needs to be pushed to a background thread to resolve these issues.
Any help in further diagnosis would be great - as would any views on whether I am on the right track here!