Abort Package after specified timeout project parameter

  • Hi

    I have a sequence container which contains an execute package task which loads a large number of JSON files and require the package to exit after a certain/specified time limit.

    Added in a script task into the sequence container to run in parallel and added a wait delay in there, not sure how to then force the other task in the sequence container to abort once the script task has completed. Have tried raising an event in the script task as per below which does run the event handler i have created but the other task keeps on executing. The event handler runs a stored proc which tidies up the database control tables form the load.

    Hoping one of you folks have a clue as I feel like i'm going round in circles on this

    Public Sub Main()

    Dim min As Double = Convert.ToDouble(Dts.Variables("$Project::LargeTimeOutMinutes").Value)

    Dim ms As Int64 = Convert.ToInt64(min * 60000)

    System.Threading.Thread.Sleep(ms)

    Dts.Events.FireError(0, "Timed Out", "Timeout parameter exceeded", String.Empty, 0)

    Dts.TaskResult = ScriptResults.Success

    End Sub

     

    Thanks

    • This topic was modified 6 months, 3 weeks ago by  Dave.
  • Thanks for posting your issue and hopefully someone will answer soon.

    This is an automated bump to increase visibility of your question.

  • Have you tried putting the script task outside of the sequence container?

    The absence of evidence is not evidence of absence.
    Martin Rees

    You can lead a horse to water, but a pencil must be lead.
    Stan Laurel

  • Hi Phil

    Thanks for getting back on this.

    Simplified version for testing in the screenshot, so basically the small scheme needs to always execute to completion and then the large scheme will be the one that is dependent on the timeout parameter. Large scheme just keeps executing even once the timeout script has run, fail package on failure etc are all set to true so nothing to do with that.

    IHP screenshot

  • All working, my event handler hadn't saved or rather i hadn't saved it. All working fine now

    Again thanks for the reply

     

  • Dave wrote:

    All working, my event handler hadn't saved or rather i hadn't saved it. All working fine now

    Again thanks for the reply

    The best type of solution 🙂

    The absence of evidence is not evidence of absence.
    Martin Rees

    You can lead a horse to water, but a pencil must be lead.
    Stan Laurel

Viewing 6 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic. Login to reply