Moves e-mail config into luigi.Config classes #1871
Merged
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.
Description
Moves all configuration access in notifications.py to use luigi.Config classes.
Also sets a default 10 second timeout for smtp.
Motivation and Context
Today when I was trying to figure out why my luigi server stopped responding at 5am, my only clue was that the last line in the log had it sending an e-mail. When I went to the notifications code to see if e-mail has a timeout, I found the config fetching code a bit outdated and hard to read. So I decided to move it to a luigi.Config class like we use in worker and scheduler. This ended up cascading until I had moved all the config accesses into Config classes. As part of this, the parameters are no longer under
[core]
but all current settings are still backward-compatible.Since I had started this due to a nasty result of not having an smtp timeout, I gave timeout a 10-second default while I was at it.
Have you tested this? If so, how?
I left the unit tests mostly as-is and they remained passing (except for the ones that don't pass on my machine in master). I only adjusted for changed function signatures in the send_email functions.
I deployed my server with unchanged configuration and triggered a disable e-mail and got it.
I ran the docs test and opened the configuration docs to verify they look right.