Description
When a serial workflow contains two identical steps with the same name, the second occurrence is not executed, and its status is incorrectly set to "stopped." However, the overall workflow still succeeds, which is unintuitive.
Expected Behavior
- Each step in the workflow should execute as expected, even if there are identical steps.
- If a step is skipped due to caching or another mechanism, its status should accurately reflect the reason.
Observed Behavior
- The second instance of an identical step is not executed.
- Its status is incorrectly marked as "stopped."
- The workflow completes successfully despite the skipped step.
Possible Cause
This issue may be related to workflow caching. When the same step reappears later in the workflow, it might be skipped due to caching, but its status is not correctly updated. Alternatively, a preprocessing or postprocessing mechanism might be handling it incorrectly.
Suggested Solution
A simple solution could be to disallow steps from having the same name, which would:
- Prevent this issue and ensure correct execution behavior.
- Reduce the likelihood of future bugs caused by identical step names leading to unexpected behavior.
How to reproduce
cd reana-demo-root6-roofit
- Update
reana.yaml
version: 0.6.0
inputs:
files:
- code/gendata.C
- code/fitdata.C
parameters:
events: 20000
data: results/data.root
plot: results/plot.png
workflow:
type: serial
specification:
steps:
- name: gendata
environment: 'docker.io/reanahub/reana-env-root6:6.18.04'
kubernetes_memory_limit: '256Mi'
commands:
- mkdir -p results && root -b -q 'code/gendata.C(${events},"${data}")'
- name: gendata
environment: 'docker.io/reanahub/reana-env-root6:6.18.04'
kubernetes_memory_limit: '256Mi'
commands:
- mkdir -p results && root -b -q 'code/gendata.C(${events},"${data}")'
outputs:
files:
- results/plot.png
tests:
files:
- tests/serial/log-messages.feature
- tests/serial/run-duration.feature
- tests/serial/workspace-files.feature
$ reana-client status -w roofit
NAME RUN_NUMBER CREATED STARTED ENDED STATUS PROGRESS
roofit 1 2025-03-04T09:03:41 2025-03-04T09:03:53 2025-03-04T09:03:59 finished 1/2
- Run
reana-client logs -w roofit
$ reana-client logs -w roofit
==> Workflow engine logs
2025-03-04 09:03:44,527 | werkzeug | MainThread | WARNING | * Debugger is active!
2025-03-04 09:03:53,473 | root | MainThread | INFO | Publishing step:0, cmd: mkdir -p results && root -b -q 'code/gendata.C(20000,"results/data.root")', total steps 2 to MQ
2025-03-04 09:03:59,560 | root | MainThread | INFO | Publishing step:1, cmd: mkdir -p results && root -b -q 'code/gendata.C(20000,"results/data.root")', total steps 2 to MQ
2025-03-04 09:03:59,626 | root | MainThread | WARNING | Termination signal 15 received. Workflow interrupted ...
2025-03-04 09:03:59,654 | root | Thread-10 (process_request_thread) | WARNING | Container job failed, error: None
==> Job logs
==> Step: gendata
==> Workflow ID: c367828d-5b9e-4473-b548-9b343089d802
==> Compute backend: Kubernetes
==> Job ID: reana-run-job-7b89f396-f5dc-4b30-9eb0-3cb587599c15
==> Docker image: docker.io/reanahub/reana-env-root6:6.18.04
==> Command: mkdir -p results && root -b -q 'code/gendata.C(20000,"results/data.root")'
==> Status: finished
==> Started: 2025-03-04T09:03:53
==> Finished: 2025-03-04T09:03:55
==> Logs:
------------------------------------------------------------
| Welcome to ROOT 6.18/04 https://root.cern |
| (c) 1995-2019, The ROOT Team |
| Built for linuxx8664gcc on Jan 08 2020, 14:10:00 |
| From tags/v6-18-04@v6-18-04 |
| Try '.help', '.demo', '.license', '.credits', '.quit'/'.q' |
------------------------------------------------------------
Processing code/gendata.C(20000,"results/data.root")...
RooFit v3.60 -- Developed by Wouter Verkerke and David Kirkby
Copyright (C) 2000-2013 NIKHEF, University of California & Stanford University
All rights reserved, please read http://roofit.sourceforge.net/license.txt
[#1] INFO:ObjectHandling -- RooWorkspace::import(w) importing RooAddPdf::model
[#1] INFO:ObjectHandling -- RooWorkspace::import(w) importing RooChebychev::bkg
[#1] INFO:ObjectHandling -- RooWorkspace::import(w) importing RooRealVar::x
[#1] INFO:ObjectHandling -- RooWorkspace::import(w) importing RooRealVar::a0
[#1] INFO:ObjectHandling -- RooWorkspace::import(w) importing RooRealVar::a1
[#1] INFO:ObjectHandling -- RooWorkspace::import(w) importing RooRealVar::nbkg
[#1] INFO:ObjectHandling -- RooWorkspace::import(w) importing RooAddPdf::sig
[#1] INFO:ObjectHandling -- RooWorkspace::import(w) importing RooGaussian::sig1
[#1] INFO:ObjectHandling -- RooWorkspace::import(w) importing RooRealVar::mean
[#1] INFO:ObjectHandling -- RooWorkspace::import(w) importing RooRealVar::sigma1
[#1] INFO:ObjectHandling -- RooWorkspace::import(w) importing RooRealVar::sig1frac
[#1] INFO:ObjectHandling -- RooWorkspace::import(w) importing RooRealVar::nsig
[#1] INFO:ObjectHandling -- RooWorkspace::import(w) importing dataset modelData
RooWorkspace(w) workspace contents
variables
---------
(a0,a1,mean,nbkg,nsig,sig1frac,sigma1,x)
p.d.f.s
-------
RooChebychev::bkg[ x=x coefList=(a0,a1) ] = 1
RooAddPdf::model[ nbkg * bkg + nsig * sig ] = 1
RooAddPdf::sig[ sig1frac * sig1 ] = 1
RooGaussian::sig1[ x=x mean=mean sigma=sigma1 ] = 1
datasets
--------
RooDataSet::modelData(x)
==> Step: gendata
==> Workflow ID: c367828d-5b9e-4473-b548-9b343089d802
==> Compute backend: Kubernetes
==> Job ID: reana-run-job-3d08a336-f103-4c86-9137-0701b9ca7ebc
==> Docker image: docker.io/reanahub/reana-env-root6:6.18.04
==> Command: mkdir -p results && root -b -q 'code/gendata.C(20000,"results/data.root")'
==> Status: stopped
==> Started: 2025-03-04T09:03:59
==> Logs:
Container job failed, error: None
Description
When a serial workflow contains two identical steps with the same name, the second occurrence is not executed, and its status is incorrectly set to "stopped." However, the overall workflow still succeeds, which is unintuitive.
Expected Behavior
Observed Behavior
Possible Cause
This issue may be related to workflow caching. When the same step reappears later in the workflow, it might be skipped due to caching, but its status is not correctly updated. Alternatively, a preprocessing or postprocessing mechanism might be handling it incorrectly.
Suggested Solution
A simple solution could be to disallow steps from having the same name, which would:
How to reproduce
cd reana-demo-root6-roofitreana.yamlRun
reana-client run -w roofitand wait a minute for workflow to finish.Run
reana-client status -w roofitreana-client logs -w roofit