Oh=) it very easy.
What we have:
- #14345, #14356 - 2 consecutive runs of our jobA - its our build job (build of c++ project)
- #9579 - first failed run of our jobB - its test job (runs some tests on build from jobA)
We have limited resources and our jobA takes much time (for our resources), so to make more builds (for further testing) I setup
- jobA - allow simultaneous builds (on different nodes - with throttle concurrent build option enabled), not waiting for downstream job completion
- jobB - same settings
While reading your comment I feel that issue can be in triggering jobB by 2 jobAs' runs but by the moment it was ok for us - except of issues with emailing in failure cases. Its ok for me to combine commiters of #14356 and #14357 to send them email to notify some broke tests.
I'm not sure I understand the issue here. jobA is run twice and it triggers TWO runs of jobB or just one? Which recipient provider are you using in your jobB? If I assume UpstreamCommitters, then the following code is used: https://github.com/jenkinsci/email-ext-plugin/blob/master/src/main/java/hudson/plugins/emailext/plugins/recipients/UpstreamComitterRecipientProvider.java#L51
This uses the UpstreamCause to determine what triggered the build, this should resolve to the correct upstream instance of jobA if two jobB's are triggered (one for each trigger of jobA). If only one jobB is triggered, then only one jobA will be the upstream cause.