SqlMainDomLock will stop listening if Sql Server connection terminates #9543
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.
NOTE: This PR is targeting the 8.6 branch
Related to #8398 which ensured that if any Azure Sql transient errors occurred that SqlMainDomLock would not stop listening. This didn't take into account exception that occur when trying to create a transaction which can occur if the Sql server cannot be connected to at all - for example if the service is stopped or paused or if the sql user can no longer connect.
If this unhandled exception occurs, MainDom stops listening and shuts itself down which is not what we want to happen. This extends the work from #8398 to prevent MainDom from shutting down if Sql server can no longer be reached. This in theory shouldn't happen but it is in some installs which is impacting sites.
Testing
Prior to this fix, do this:
<add key="Umbraco.Core.MainDom.Lock" value="SqlMainDomLock"/>
With this fix applied
ClientDependency.config
and add some whitespace and save the file - this will restart the site since it's a .net config file - MainDom.OnSignal will be hit - this is expected behaviorYou will see a huge amount of errors in the logs, one every 2 seconds while the SQL server is unreachable. This is expected.
This item has been added to our backlog AB#9730