Giter VIP home page Giter VIP logo

Comments (8)

bdukes avatar bdukes commented on June 3, 2024 2

Could we add some opt-in attributes to the script component to run scripts fail-fast and/or in a transaction?

from dnn.platform.

mitchelsellers avatar mitchelsellers commented on June 3, 2024 1

@bdukes that would be awesome

from dnn.platform.

mitchelsellers avatar mitchelsellers commented on June 3, 2024

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.

DanielBolef avatar DanielBolef commented on June 3, 2024

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.

mitchelsellers avatar mitchelsellers commented on June 3, 2024

@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.

bdukes avatar bdukes commented on June 3, 2024

@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.

mitchelsellers avatar mitchelsellers commented on June 3, 2024

@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.

sleupold avatar sleupold commented on June 3, 2024

@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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.