question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[JENKINS-62815] Traversal doesn't work on parallel pipelines

See original GitHub issue

Steps to reproduce

Have a pipeline with at least one parallel section. Try to gather stage duration data.

Expected behavior

Stage duration data should be recorded

Actual behavior

No stage duration data is recorded. (traverseTree(flownodes) returns [])

Server configuration

Operating system:

Jenkins Version:

Plugin Version: 2.0.7

Suggested fix:

In this file. Switch from a return False to a continue. The same node can be run into twice if a parallel pipeline is uses. If it is encountered, it should be skipped instead of exiting early, but I have not tested this. https://github.com/jenkinsci/prometheus-plugin/blob/9a473b0b14ebe5167ef58d8316eb3a2712d5289e/src/main/java/org/jenkinsci/plugins/prometheus/util/FlowNodes.java#L102-L107

            for (final FlowNode next : parents) {
                if (visited.contains(getNodeId(next))) {
                    continue;
                }
                queue.add(next);
            }

Notify

@markyjackson-taulia

~P.S. I’m unable to open a jira at the moment because of the issues with accounts on jenkins.io~ Jira issue is JENKINS-62815

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5

github_iconTop GitHub Comments

2reactions
victorlopezsalazarcommented, Aug 25, 2020

@nigelarmstrong-bc @markyjackson-taulia, could we contribute with a PR to fix the node vs current bug? It seems a straightforward fix for the bug.

1reaction
nigelarmstrong-bccommented, Jun 24, 2020

Actually, there is another bug, should be current instead of node

https://github.com/jenkinsci/prometheus-plugin/blob/9a473b0b14ebe5167ef58d8316eb3a2712d5289e/src/main/java/org/jenkinsci/plugins/prometheus/util/FlowNodes.java#L98

final List<FlowNode> parents = current.getParents();
Read more comments on GitHub >

github_iconTop Results From Across the Web

Parallel stages with Declarative Pipeline 1.2 - Jenkins
Basically the old parallel step required you to use Scripted Pipeline within a Declarative Pipeline.
Read more >
Jenkins parallel pipeline does not work as expected
I did fix this by copy the full workspace in another workspace for every parallel stage. When runnning the stages in ws(){} blocks...
Read more >
Using parallelization, multiple git repositories and setting ...
Orchestrating parallelization of R jobs with Jenkins. Declarative Jenkins pipelines are one of the ways to orchestrate parallelism with many ...
Read more >
Parallelism and Distributed Builds with Jenkins - CloudBees
In some cases that is triggering jobs and allowing them to run concurrently, other times it is running parts of your pipeline in...
Read more >
Advanced Jenkins Parallel Builds | Incredibuild
How to do Jenkins parallel builds right and what does it have to do ... Jenkins pipeline ended up being an enabler for...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found