Fix TR NullPointerException in LetsEncryptDnsChallengeWatcher#5342
Fix TR NullPointerException in LetsEncryptDnsChallengeWatcher#5342mattjackson220 merged 1 commit intoapache:masterfrom
Conversation
Because databasesDirectory is already a property of the extended class AbstractServiceUpdater, it should not be redeclared in LetsEncryptDnsChallengeWatcher. Also, log exceptions when catching them in order to capture the full stacktraces in the log.
zrhoffman
left a comment
There was a problem hiding this comment.
The Traffic Router external tests never complete after this PR.
In a normal run, the integration and external tests complete within 9 minutes and 40 seconds of starting CDN in a Box: https://github.com/zrhoffman/trafficcontrol/runs/1495788949
When the commit from this PR is applied, the job times out after CDN in a Box has been running for 30 minutes (the TR integration and external tests have been running for about 27 minutes at this point): https://github.com/zrhoffman/trafficcontrol/runs/1495797296
I haven't PRed the GitHub action that runs the TR integration tests because it already comments out RouterTest in order for the external tests to complete until I can work out some SSL cert issues, but it should still be useful to test this PR.
|
So, if I understand correctly, #5280 "fixed" the external integration test timeout by causing a What's strange is that seems to be a CIAB issue, because when I run the integration/external tests locally (excluding that one failing RouterTest), they pass. |
mattjackson220
left a comment
There was a problem hiding this comment.
tests pass, code looks good, fixes NPE as expected!
Because databasesDirectory is already a property of the extended class AbstractServiceUpdater, it should not be redeclared in LetsEncryptDnsChallengeWatcher. Also, log exceptions when catching them in order to capture the full stacktraces in the log. (cherry picked from commit d4780c3)
What does this PR (Pull Request) do?
Fixes a
NullPointerExceptioninLetsEncryptDnsChallengeWatcherwhich I believe is breaking the Let's Encrypt functionality.Because
databasesDirectoryis already a property of the extended classAbstractServiceUpdater, it should not be redeclared inLetsEncryptDnsChallengeWatcher. The Spring framework was setting the value inLetsEncryptDnsChallengeWatcher, but theAbstractServiceUpdateruses its own value which was null becausesetDatabasesDirectorywas overridden byLetsEncryptDnsChallengeWatcher.Also, log exceptions when catching them in order to capture the full stacktraces in the log.
Which Traffic Control components are affected by this PR?
What is the best way to verify this PR?
Run TR, view the logs to ensure that the following NPE does not occur periodically:
and instead see logs like this:
Verify the TR unit and integration tests pass.
If this is a bug fix, what versions of Traffic Control are affected?
The following criteria are ALL met by this PR