Skip to content

Pipeline updates should wait until the current pipeline has finished executing #285

Closed

Description

@timmow

Currently pipelines are updated in-place, which means that if a pipeline is updated while it's executing behaviour may change from what the previous version of the pipeline expected.

Example:

Deploying the following pipeline, starting it, then deploying the second pipeline will result in the final step of the pipeline never executing in the build, which may result in unexpected inconsistencies if the jobs are affecting external resources. Jobs that are removed while executing will also finish execution, but are invisible in the UI.

Pipeline 1


---
jobs:
  - name: foo
    plan:
    - get: state
    - task: foo
      config:
        inputs: 
          - name: state
        run:
          path: sh
          args:
          - -c
          - |
            date >> updating-while-running
            sleep 30
            echo 30
    - put: state
      params:
        file: foo/updating-while-running
  - name: bar
    plan:
    - get: state
      passed: [foo]
      trigger: true
    - task: bar
      config:
        run:
          path: sh
          args:
          - -c
          - |
            sleep 30
            echo 30
resources:
  - name: state
    type: s3
    source:
      bucket: {{state_bucket}}
      versioned_file: updating-while-running
      region_name: {{aws_region}}
      access_key_id: ACCESS-KEY
      secret_access_key: SECRET

Pipeline 2


---
jobs:
  - name: foo
    plan:
    - get: state
    - task: foo
      config:
        inputs: 
          - name: state
        run:
          path: sh
          args:
          - -c
          - |
            date >> updating-while-running
            sleep 30
            echo 30
    - put: state
      params:
        file: foo/updating-while-running
resources:
  - name: state
    type: s3
    source:
      bucket: {{state_bucket}}
      versioned_file: updating-while-running
      region_name: {{aws_region}}
      access_key_id: ACCESS-KEY
      secret_access_key: SECRET

In addition, deploying the second pipeline, then starting the foo job, and then applying the first pipeline while the foo job is running will add the bar job and trigger new build of the bar job, despite the fact the
job started running under an older version of the pipeline.

Ideally when new pipelines are uploaded using fly they should not be applied until the current pipeline has finished executing. There are situations where this is desired behaviour, so the current behaviour could be placed behind a --force flag.

It would also be nice to have a --wait option that causes fly not to return until the pipelines have been updated, for use when scripting pipeline updates.

Activity

  1. concourse-bot commented on Feb 16, 2016

    @concourse-bot

    Hi there!

    We use Pivotal Tracker to provide visibility into what our team is working on. A story for this issue has been automatically created.

    The current status is as follows:

    • #113839175 Pipeline updates should wait until the current pipeline has finished executing

    This comment, as well as the labels on the issue, will be automatically updated as the status in Tracker changes.

  2. vito commented on Oct 6, 2016

    @vito
    Contributor

    This is a little odd to think about as there's no such thing as a "pipeline finishing". In-flight jobs can finish but I'd be hesitant to try to have Concourse figure out anything beyond that.

  3. jama22 commented on Jul 25, 2017

    @jama22

    Hey there!

    We're automatically closing this issue since the original poster (or another commenter) hasn't been active in the past six months. We therefore assume that this issue has been lost or resolved on its own. Close issues that remain inactive for a long period may get automatically locked.

    Don't worry though; if this is in error, let us know with a comment and we'll be happy to reopen the issue.
    Thanks!

  4. added a commit that references this issue on Jul 4, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions