Inedo Community Forums Forums
    • Recent
    • Tags
    • Popular
    • Login

    Welcome to the Inedo Forums! Check out the Forums Guide for help getting started.

    If you are experiencing any issues with the forum software, please visit the Contact Form on our website and let us know!

    Why does a recurring job trigger when the last execution is still running?

    Scheduled Pinned Locked Moved Support
    buildmaster
    8 Posts 2 Posters 10 Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • D Offline
      dwynn_6489
      last edited by

      We have jobs scheduled on a recurring basis. If a job runs long, the next scheduled job will still trigger, and will interfere with the currently running job. In our setup, it is not desirable for a job to trigger if the last execution is still running. Is this the expected behavior and if so, is there a way to prevent it?

      Product: BuildMaster
      Version: 5.6.8

      1 Reply Last reply Reply Quote 0
      • ? This user is from outside of this forum
        Guest
        last edited by

        The triggers are "fire and forget" so they wouldn't know if an execution was in progress.

        Depending on what the underlying issue is, you could use locks (i.e. with lock = !tokenName, note when tokenName is prefixed with ! then it is held system-wide) and Resource Pools.

        As an extreme measure, you could always write a quick custom extension or PowerShell script that queries the BuildMaster DB for current executions (besides the 1 that's querying for them of course) and halts when the others complete or something like that.

        1 Reply Last reply Reply Quote 0
        • D Offline
          dwynn_6489
          last edited by

          Thanks Tod, but shouldn't the release itself know that it has a current execution that hasn't finished? For example, what should happen if a release is currently executing and I try to create a new package via the web interface for that release? I would expect the new package to be prevented from executing since there is a currently executing instance. (Anecdotally, I believe that was the behavior prior to 5.x release)

          1 Reply Last reply Reply Quote 0
          • ? This user is from outside of this forum
            Guest
            last edited by

            It was always possible to create a build/package and deploy to a step/stage regardless if there was an execution going or not. In fact, prior to v5, working directories were application-specific instead of execution-specific... which caused some odd behavior if deploying to different stages at the same time as you can imagine.

            There's no good reason to prevent multiple executions for many reasons, but the main reason is that deploying to multiple targets in a pipeline stage is actually implemented using simultaneous executions.

            1 Reply Last reply Reply Quote 0
            • D Offline
              dwynn_6489
              last edited by

              We are talking about different situations. I understand that multiple targets could execute simultaneously (and that can be desirable), but those are for a single "run" of a job. I'm talking about a scenario where a second "run" is started before the first "run" is finished.

              Say I click "Create Package" for a release. The release enters the Build stage (which is the first stage in this scenario). The Build stage takes 15 minutes. While it is building, I accidentally click "Create Package" again for the same release. I don't want this second click to start the build process again.

              This gets even worse if the release is deploying to an environment. A second instance of the same release trying to run at the same time as a prior instance could have all sorts of negative consequences.

              1 Reply Last reply Reply Quote 0
              • ? This user is from outside of this forum
                Guest
                last edited by

                The "Create Package" option was never blocked because of a deployment already happening to the Build environment/step/stage in any version that I can recall back to v2. If anything, there was a time where it cancelled the one that was already happening, but it never prevented anyone from clicking the button in the UI.

                I understand that it could have negative consequences, I'm just saying that it doesn't always, so we shouldn't disallow it.

                1 Reply Last reply Reply Quote 0
                • D Offline
                  dwynn_6489
                  last edited by

                  Would you consider adding an option to prevent the second execution, since it could have negative consequences?

                  1 Reply Last reply Reply Quote 0
                  • ? This user is from outside of this forum
                    Guest
                    last edited by

                    Definitely; this feature is certainly slated for redesign, to bring it more in the line of a "scheduled job" concept, and unifying implementation across our products (ProGet, Otter, Hedgehog as well).

                    This concept of "don't run this job if an execution associated with this job is currently running" is how it could be implemented/described I suppose

                    1 Reply Last reply Reply Quote 0

                    Hello! It looks like you're interested in this conversation, but you don't have an account yet.

                    Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

                    With your input, this post could be even better 💗

                    Register Login
                    • 1 / 1
                    • First post
                      Last post
                    Inedo Website Home • Support Home • Code of Conduct • Forums Guide • Documentation