Comments (8)
Could we add some opt-in attributes to the script component to run scripts fail-fast and/or in a transaction?
from dnn.platform.
@bdukes that would be awesome
from dnn.platform.
Historically the expectation is that SQL Server scripts should be re-runnable, changing this behavior to stop-on-error would be a major breaking change that would impact installation, upgrade, and extension installation/upgrade.
Although I understand the desire here, I'm not sure that the downstream impacts would be worth the change. Just my $0.02 though.
from dnn.platform.
I don't see how this would this prevent a script from being re-runnable. In fact I believe it would make it more so, because instead of running statements out of order this would stop execution and allow whatever problem there was to be resolved before continuing.
I do agree this would be a breaking change, and should probably be held until a major release.
from dnn.platform.
@DanielBolef this wouldn't prevent it from being re-runnable, but it would change the expectation of what is completed or what is not yet completed.
The "rollback" solution for a failure is often to run everything again anyway, so maybe it isn't a big deal, but if we stop abruptly at the first error it could result in many issues with incompatible scripts without manual intervention.
My concern is mostly with upgrade or other issues that right, or wrong, there could be errors. if the scripts stop someone has to manually edit and re-run if we change the behavior, where as the current behavior allows for everything to execute and you can debug. This is a larger issue on upgrades due to possible data issues or otherwise and if certain later scripts don't run the site might not be functional.
from dnn.platform.
@mitchelsellers would your experience tell you that continuing to run dependent scripts after an error is less likely to leave the site in an unrecoverable state than stopping after an unexpected error? I can see scenarios either way.
Personally, I would prefer that the process stop after an error so that it can be investigated, rather than continuing through with the strong possibility that underlying issues are present but not addressed.
from dnn.platform.
@bdukes Yes, I would say the current behavior has a better change of leaving you able to recover, compared to others. A few examples, one third-party module updated some permissions that didn't exist so the script failed, but they also later in the script updated the table structures for all of their data. Since those scripts ran successfully, all of the data was available and the site was not impacted. It was possible to review the failure fix the script and move on. If that script stopped, the site would not have been able to see any content, and in certain circumstances wouldn't even have come online.
We also see this with DNN upgrades, especially on sites with "questionable" pasts where again its 99.9% ok, but that one script messes up. If the site fails to load it is a lot of manual work to re-run via SSMS due to the usage of {objectQualifier} and {databaseOwner}
I normally prefer fail-early as well, it would be ideal if there was a transaction scope that would rollback in the case of a failure.
from dnn.platform.
@bdukes that would be my sugggestion as well, keeping the existing behaviour, if the flag is not set and being able to stop on error, if the flag is set.
in general, it is good practise not to rely on a previous execution but add a check into table modifying commands, e.g by using a WHERE statement or an IF.
from dnn.platform.
Related Issues (20)
- [Enhancement]: Add Limits for search result
- [Enhancement]: Prevent writing invalid module title (such as HTML, CSS, JS) HOT 5
- [Bug]: Cannot use Office365 OAUT2 HOT 1
- [Enhancement]: Set SameSite and Secure property for authentication cookie
- [Enhancement]: Better confirmation for portal deletion
- [Enhancement]: More detailed permissions
- [Bug]: Resource manager permissions not being saved properly HOT 4
- [Enhancement]: Proposal for Edit-only System User Roles for Content Managers HOT 1
- [Bug]: DNN 10 Theme - Potential browsersync timing issue results in files not being distributed in time
- [Bug]: Invalid resource files format HOT 3
- [Bug]: Items selected dont change state when select a file to move and cancel.
- [Bug]: Malformed resource files
- [Bug]: Incorrect file/folder context menu position in Resource Manager when window is scrolled
- [Enhancement]: Redirect management
- [Unable to login or password process in plesk server]: HOT 1
- [Enhancement]: SEO audit HOT 2
- [Bug]: wording minor issue
- [Bug]: JWT login fails with Unknown error "-1073741816" on ComputeHash HOT 1
- [Enhancement]: Add a DNN_Platform.local-sample.build to make setup easier HOT 1
- [Bug]: Can't see or select "Disabled" page in Bulk Page Add
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dnn.platform.