-
Notifications
You must be signed in to change notification settings - Fork 77
make sure to set timeout before read from the connection #49
base: v2
Are you sure you want to change the base?
Conversation
I wonder if this could cause This is the current order those functions are in currently in my copy...I'm thinking the if d.SSL {
conn = tlsClient(conn, d.tlsConfig())
}
c, err := smtpNewClient(conn, d.Host)
if err != nil {
return nil, err
}
if d.Timeout > 0 {
conn.SetDeadline(time.Now().Add(d.Timeout))
} |
ya, the current code can have the connection hanging forever without a deadline. the tls handshake does send/receive some network traffic. |
@aaabbbccc-123 Thanks...this is likely my problem then...I'm waiting for at least one more hang occurrence before I shift the placement of the When it hangs again...hopefully shifting that deadline up will fix it. |
@aaabbbccc-123 Question...in the event it hangs due to this deadline not being called...is the error that it should have generated if it timeout'd out correctly the gomail error that ends |
I've finally experienced another hang in relation to what I think this pull request fixes. I've got a log of where the code hangs in the repo call. The Log excerpt for the send cycle it hung on is below and the bottom call was the last time it responded. I have since moved the
|
This pull request fixes my problem in #56. I've implemented it locally if someone can merge this. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also tested this with local fork and this simple trick is efficient! Please merge
Hey folks - Apologies, I haven't had much time to give this PR attention. If I follow correctly, this is a bug brought on by I'll get a test written and have this merged in over the weekend. |
@ivy Hello, we are seeing similar hang issues -- mind getting this fix merged? |
Hey, this looks like it solves my issue, and I can see new issues about this as well. Can we merge this please? Also might be worth backporting to older versions people might still be using |
@ivy I apologize for pinging, can this be merged? |
I meet the same problem again. So it merge this pr to my fork project: https://github.com/goself/mail,I will keep maintaining this project。 I help this would help someone. |
No description provided.