-
-
Notifications
You must be signed in to change notification settings - Fork 64
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
Clean disconnect when buffer done? #55
Comments
the reason is due performance, you don't want to keep reopenning the SMTP connection, doing it's slow handshake everytime you need to send an email. The other side usually drops the connection, but for heavy traffic it won't close. |
In our use case there might be 10~100 emails once every few hours at most, but the key issue is a burst followed by none. While it seems harmless to let it time out, is this practice considered 'bad form' to wait until the other end drops it? I have little experience with only a few SMTP servers in this regard. I can of course just do a close on the socket when the buffer reaches zero, probably a good solution for this case. |
AFAIK no, specially since you are usually using your own/paid mail server to send out emails I guess it would be ok for the server to be ready to send mails right away. |
Like to reopen this and ask how (code fragment please) and where to best close the socket once the pending work que reaches zero. We seem to have an periodic issue where a new message is being created and enqueued to be sent at just the moment in time the server connection timeout / disconnect occurs- resulting in lost mail. It only seems to occur during heavy loading, but just at about 60 or 90 second mark (the timeout point for the two machines we use). |
do you happen to get an error due it being closed? |
I have to dig a bit into the logs to find out. On the surface, it simply does not send, losing that posting. The next posting works fine. [I must say the lambda aspect of this code, while both clever and the future, blocks our normal error logging, this old dog has some learning to do] I believe below here is a relevant fragment of the debug log we keep. And to repeat, I think if we were to shut down the connection rather than let the other side time out, we would be okay.
|
If there a design reason the socket to the remote SMTP node is not closed when the buffer is emptied?
It appear to just leaves it open and after a bit of time the other side drops it.
readyRead unknown state "421 4.4.2 xxxhiddenxxx.com Error: timeout exceeded\r\n"
The text was updated successfully, but these errors were encountered: