Skip to content
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

DialAndSend() occasionally not returning...? // Ultimately Dial() #56

Open
steviesama opened this issue May 21, 2019 · 3 comments
Open

Comments

@steviesama
Copy link

steviesama commented May 21, 2019

So I have this web app that has email campaigns with emails customized to individual recipients...and the average campaign per auction/claim...etc...is 35-50 recipients...I have this throttled at 6 sends per minute.

Sometimes it behaves well...other times I'll catch an email hung in 'sending'...which I set just before DialAndSend() and set it to 'sent' right after. I added some code on my outer layers of code and the last logging output before that go routine stops responding is the log just before the DialAndSend() as you can see in the cross-section of a log below. There's a lot of output below that point where the ==> sendMail(): No Error or ==> sendMail(): Error: '%s' would normally be...but it continues to hang.

It throws my Emailer service out of tilt because it doesn't respond...I'm getting ready to lay logging code into the source code I pulled so I can find exactly where it's hanging in the source code...but does anyone have any idea what might cause it to hang? Log excerpt below...at the bottom it stops and hangs.

incoming filterBy: comment_subjectguid = UNHEX('37e8015f2f594885b2b1bdf8416319f0')
incoming filterBy: comment_subjectguid = UNHEX('37e8015f2f594885b2b1bdf8416319f0')
===>
===> BEFORE CALL sendMail('76016 (2018 / Freightliner / Cascadia) West Blocton, Alabama')
===> START CALL sendmail('[email protected]')
m := gomail.NewMessage()
==> sendMail(): m.SetHeader("From", from.Username)
==> sendMail(): m.SetHeader("To", to)
==> sendMail(): m.SetHeader("Subject", subj)
==> BEFORE sendMail(): attachments
==> AFTER sendMail(): attachments
==> sendMail(): m.SetBody("text/html", body)
==> sendMail(): d := gomail.NewDialer(
==> sendMail(): err := d.DialAndSend(m)
incoming filterBy: comment_subjectguid = UNHEX('37e8015f2f594885b2b1bdf8416319f0')
incoming filterBy: comment_subjectguid = UNHEX('37e8015f2f594885b2b1bdf8416319f0')
incoming filterBy: comment_subjectguid = UNHEX('37e8015f2f594885b2b1bdf8416319f0')
==> sendMail(): No Error
===> END CALL sendmail('[email protected]')
===> AFTER CALL sendMail('76016 (2018 / Freightliner / Cascadia) West Blocton, Alabama')
===>
incoming filterBy: comment_subjectguid = UNHEX('37e8015f2f594885b2b1bdf8416319f0')
incoming filterBy: comment_subjectguid = UNHEX('37e8015f2f594885b2b1bdf8416319f0')
incoming filterBy: comment_subjectguid = UNHEX('37e8015f2f594885b2b1bdf8416319f0')
incoming filterBy: comment_subjectguid = UNHEX('37e8015f2f594885b2b1bdf8416319f0')
incoming filterBy: comment_subjectguid = UNHEX('37e8015f2f594885b2b1bdf8416319f0')
incoming filterBy: comment_subjectguid = UNHEX('37e8015f2f594885b2b1bdf8416319f0')
incoming filterBy: comment_subjectguid = UNHEX('37e8015f2f594885b2b1bdf8416319f0')
incoming filterBy: auction_isopen='YES'
===>
===> BEFORE CALL sendMail('76016 (2018 / Freightliner / Cascadia) West Blocton, Alabama')
===> START CALL sendmail('[email protected]')
m := gomail.NewMessage()
==> sendMail(): m.SetHeader("From", from.Username)
==> sendMail(): m.SetHeader("To", to)
==> sendMail(): m.SetHeader("Subject", subj)
==> BEFORE sendMail(): attachments
==> AFTER sendMail(): attachments
==> sendMail(): m.SetBody("text/html", body)
==> sendMail(): d := gomail.NewDialer(
==> sendMail(): err := d.DialAndSend(m)
incoming filterBy: comment_subjectguid = UNHEX('37e8015f2f594885b2b1bdf8416319f0')
incoming filterBy: comment_subjectguid = UNHEX('37e8015f2f594885b2b1bdf8416319f0')
incoming filterBy: none
incoming filterBy: auction_guid = UNHEX('d45a01b309d54223b238c59caccbdc58')
incoming filterBy: auction_guid=UNHEX('d45a01b309d54223b238c59caccbdc58')
incoming filterBy: payment_guid=UNHEX('38141d2beae046fc8d57f2eb513eb94a')
@steviesama steviesama changed the title dialAndSend() not returning...? dialAndSend() not returning occasionally...? May 21, 2019
@steviesama
Copy link
Author

I'm wondering if #49 could be related to this? I'm in the middle of mapping the logging for this.

@steviesama steviesama changed the title dialAndSend() not returning occasionally...? DialAndSend() not returning occasionally...? May 22, 2019
@steviesama
Copy link
Author

So I had another hang...and have an excerpt of the send mail cycle where the repo code stopped responding. I have since implemented the fix in the pull request in #49. I'll check back in a couple of weeks...in that time it would have normally hung 4-5 times...the excerpt for the hang is below...the start of the cycle and the last line is the last time it responded before I had to restart the service.

===> BEFORE CALL sendMail('76036 (2014 / Freightliner / Cascadia) Memphis, Tennessee')
===> START CALL sendMail('[email protected]')
==> sendMail(): m := gomail.NewMessage()
==> sendMail(): m.SetHeader("From", from.Username)
==> sendMail(): m.SetHeader("To", to)
==> sendMail(): m.SetHeader("Subject", subj)
==> BEFORE sendMail(): attachments
==> AFTER sendMail(): attachments
==> sendMail(): m.SetBody("text/html", body)
==> sendMail(): d := gomail.NewDialer(
==> sendMail(): d.StartTLSPolicy = gomail.MandatoryStartTLS
==> sendMail(): err := d.DialAndSend(m)
===> DialAndSend(): s, err := d.Dial()
===> Dial(): conn, err := NetDialTimeout("tcp", addr(d.Host, d.Port), d.Timeout)
===> Dial(): if d.SSL {
===> Dial(): c, err := smtpNewClient(conn, d.Host)

@steviesama steviesama changed the title DialAndSend() not returning occasionally...? DialAndSend() not returning occasionally...? // Ultimately Dial() May 31, 2019
@steviesama steviesama changed the title DialAndSend() not returning occasionally...? // Ultimately Dial() DialAndSend() occasionally not returning...? // Ultimately Dial() May 31, 2019
@steviesama
Copy link
Author

steviesama commented Aug 19, 2019

The pull request associated with #49 fixes this problem if someone can merge it. I implemented it locally for the time being.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant