Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Overview
Adding a timeout to skprmail avoidingfor unnecessarily long wait times with no errors or closures
Implementation
There was a context created and passed to both the ses and the default method. The ses method automatically handles the timeout via the context whereas we've implemented a goroutine to check for context timeout and close the application.
How to Test
Setup a mail server using
smtp-go
(https://github.com/emersion/go-smtp/blob/master/cmd/smtp-debug-server/main.go) package and add sleep at/server.go:211
This will ensure that the smtp server is available but will not respond to a connection dial leading our skprmail to be hung until the timeout is hit.What is the rollout plan?
Merge and rollout
Does this change need a blog post?
Maybe a blog pose around contexts and timeouts
Link to Tickets