Tasks writing to the same directory in aggregate block


#1

We have been experiencing an issue where a subsequent task (resource put) in a job does not find a file that should be placed in a directory by a previous step. The job looks something like this

- aggregate:
    - do:
        - task: a # writes to "trigger/props"
        - put: source-a
          params:
            item_file: "trigger/props"
    - do:
        - task: b # writes to "trigger/props"
        - put: source-b
          params:
            item_file: "trigger/props"

So we have two “branches” in the aggregate statement that however write to the same output dir and file. I did somehow naively expect that concourse would branch the input/output volumes so that the put steps would only see the output volume produced by the preceding steps on their “execution branch”.

Is that how concourse is supposed to behave or am I experiencing some sort of a concurrency issue? I didn’t find anything in the docs about how concourse behaves in regards to input/output volume reuse in multiple steps. Maybe its something that should be forbidden/validated by concourse?


#2

I noticed the same behavior. My workaround was to use different outputs.
I agree with what you mention: if this is not a bug, it should be rejected by Concourse. I think it is worthwhile to open a ticket.