-
Bug
-
Resolution: Not A Defect
-
Major
-
None
-
Jenkins: 2.337
OS: Windows 10 - 10.0
---
ace-editor:1.1
apache-httpcomponents-client-4-api:4.5.13-1.0
authentication-tokens:1.4
blueocean:1.25.3
blueocean-autofavorite:1.2.5
blueocean-bitbucket-pipeline:1.25.3
blueocean-commons:1.25.3
blueocean-config:1.25.3
blueocean-core-js:1.25.3
blueocean-dashboard:1.25.3
blueocean-display-url:2.4.1
blueocean-events:1.25.3
blueocean-git-pipeline:1.25.3
blueocean-github-pipeline:1.25.3
blueocean-i18n:1.25.3
blueocean-jwt:1.25.3
blueocean-personalization:1.25.3
blueocean-pipeline-api-impl:1.25.3
blueocean-pipeline-editor:1.25.3
blueocean-pipeline-scm-api:1.25.3
blueocean-rest:1.25.3
blueocean-rest-impl:1.25.3
blueocean-web:1.25.3
bootstrap4-api:4.6.0-3
bootstrap5-api:5.1.3-6
bouncycastle-api:2.25
branch-api:2.1044.v2c007e51b_87f
caffeine-api:2.9.2-29.v717aac953ff3
checks-api:1.7.2
cloudbees-bitbucket-branch-source:765.v5a_2d6a_23c01d
cloudbees-folder:6.714.v79e858ef76a_2
command-launcher:1.6
credentials:1087.1089.v2f1b_9a_b_040e4
credentials-binding:1.27.1
display-url-api:2.3.6
durable-task:495.v29cd95ec10f2
echarts-api:5.3.2-1
favorite:2.4.1
font-awesome-api:6.0.0-1
generic-webhook-trigger:1.84
git:4.11.0
git-client:3.11.0
git-server:1.10
github:1.34.3
github-api:1.303-400.v35c2d8258028
github-branch-source:1598.v91207e9f9b_4a_
handy-uri-templates-2-api:2.1.8-22.v77d5b_75e6953
htmlpublisher:1.29
http_request:1.14
jackson2-api:2.13.2.20220328-273.v11d70a_b_a_1a_52
javax-activation-api:1.2.0-2
javax-mail-api:1.6.2-5
jaxb:2.3.0.1
jdk-tool:1.5
jenkins-design-language:1.25.3
jjwt-api:0.11.2-9.c8b45b8bb173
jquery3-api:3.6.0-2
jsch:0.1.55.2
junit:1.59
lockable-resources:2.14
mailer:408.vd726a_1130320
matrix-project:758.v7a_ea_491852f3
okhttp-api:4.9.3-105.vb96869f8ac3a
pipeline-build-step:2.17
pipeline-graph-analysis:188.v3a01e7973f2c
pipeline-input-step:447.v95e5a_6e3502a_
pipeline-milestone-step:100.v60a_03cd446e1
pipeline-model-api:2.2075.vce74e77b_ce40
pipeline-model-definition:2.2075.vce74e77b_ce40
pipeline-model-extensions:2.2075.vce74e77b_ce40
pipeline-stage-step:291.vf0a8a7aeeb50
pipeline-stage-tags-metadata:2.2075.vce74e77b_ce40
pipeline-utility-steps:2.12.0
plain-credentials:1.8
plugin-util-api:2.16.0
popper-api:1.16.1-2
popper2-api:2.11.5-1
pubsub-light:1.16
scm-api:602.v6a_81757a_31d2
script-security:1145.vb_cf6cf6ed960
snakeyaml-api:1.30.1
sse-gateway:1.25
ssh-credentials:1.19
sshd:3.228.v4c9f9e652c86
structs:308.v852b473a2b8c
token-macro:285.vff7645a_56ff0
trilead-api:1.57.v6e90e07157e1
variant:1.4
workflow-aggregator:2.7
workflow-api:1143.v2d42f1e9dea_5
workflow-basic-steps:941.vdfe1b_a_132c64
workflow-cps:2686.v7c37e0578401
workflow-cps-global-lib:570.v21311f4951f8
workflow-durable-task-step:1128.v8c259d125340
workflow-job:1174.vdcb_d054cf74a_
workflow-multibranch:711.vdfef37cda_816
workflow-scm-step:2.13
workflow-step-api:622.vb_8e7c15b_c95a_
workflow-support:818.v4eb_969241b_c7Jenkins: 2.337 OS: Windows 10 - 10.0 --- ace-editor:1.1 apache-httpcomponents-client-4-api:4.5.13-1.0 authentication-tokens:1.4 blueocean:1.25.3 blueocean-autofavorite:1.2.5 blueocean-bitbucket-pipeline:1.25.3 blueocean-commons:1.25.3 blueocean-config:1.25.3 blueocean-core-js:1.25.3 blueocean-dashboard:1.25.3 blueocean-display-url:2.4.1 blueocean-events:1.25.3 blueocean-git-pipeline:1.25.3 blueocean-github-pipeline:1.25.3 blueocean-i18n:1.25.3 blueocean-jwt:1.25.3 blueocean-personalization:1.25.3 blueocean-pipeline-api-impl:1.25.3 blueocean-pipeline-editor:1.25.3 blueocean-pipeline-scm-api:1.25.3 blueocean-rest:1.25.3 blueocean-rest-impl:1.25.3 blueocean-web:1.25.3 bootstrap4-api:4.6.0-3 bootstrap5-api:5.1.3-6 bouncycastle-api:2.25 branch-api:2.1044.v2c007e51b_87f caffeine-api:2.9.2-29.v717aac953ff3 checks-api:1.7.2 cloudbees-bitbucket-branch-source:765.v5a_2d6a_23c01d cloudbees-folder:6.714.v79e858ef76a_2 command-launcher:1.6 credentials:1087.1089.v2f1b_9a_b_040e4 credentials-binding:1.27.1 display-url-api:2.3.6 durable-task:495.v29cd95ec10f2 echarts-api:5.3.2-1 favorite:2.4.1 font-awesome-api:6.0.0-1 generic-webhook-trigger:1.84 git:4.11.0 git-client:3.11.0 git-server:1.10 github:1.34.3 github-api:1.303-400.v35c2d8258028 github-branch-source:1598.v91207e9f9b_4a_ handy-uri-templates-2-api:2.1.8-22.v77d5b_75e6953 htmlpublisher:1.29 http_request:1.14 jackson2-api:2.13.2.20220328-273.v11d70a_b_a_1a_52 javax-activation-api:1.2.0-2 javax-mail-api:1.6.2-5 jaxb:2.3.0.1 jdk-tool:1.5 jenkins-design-language:1.25.3 jjwt-api:0.11.2-9.c8b45b8bb173 jquery3-api:3.6.0-2 jsch:0.1.55.2 junit:1.59 lockable-resources:2.14 mailer:408.vd726a_1130320 matrix-project:758.v7a_ea_491852f3 okhttp-api:4.9.3-105.vb96869f8ac3a pipeline-build-step:2.17 pipeline-graph-analysis:188.v3a01e7973f2c pipeline-input-step:447.v95e5a_6e3502a_ pipeline-milestone-step:100.v60a_03cd446e1 pipeline-model-api:2.2075.vce74e77b_ce40 pipeline-model-definition:2.2075.vce74e77b_ce40 pipeline-model-extensions:2.2075.vce74e77b_ce40 pipeline-stage-step:291.vf0a8a7aeeb50 pipeline-stage-tags-metadata:2.2075.vce74e77b_ce40 pipeline-utility-steps:2.12.0 plain-credentials:1.8 plugin-util-api:2.16.0 popper-api:1.16.1-2 popper2-api:2.11.5-1 pubsub-light:1.16 scm-api:602.v6a_81757a_31d2 script-security:1145.vb_cf6cf6ed960 snakeyaml-api:1.30.1 sse-gateway:1.25 ssh-credentials:1.19 sshd:3.228.v4c9f9e652c86 structs:308.v852b473a2b8c token-macro:285.vff7645a_56ff0 trilead-api:1.57.v6e90e07157e1 variant:1.4 workflow-aggregator:2.7 workflow-api:1143.v2d42f1e9dea_5 workflow-basic-steps:941.vdfe1b_a_132c64 workflow-cps:2686.v7c37e0578401 workflow-cps-global-lib:570.v21311f4951f8 workflow-durable-task-step:1128.v8c259d125340 workflow-job:1174.vdcb_d054cf74a_ workflow-multibranch:711.vdfef37cda_816 workflow-scm-step:2.13 workflow-step-api:622.vb_8e7c15b_c95a_ workflow-support:818.v4eb_969241b_c7
We have a pipeline in which we are running parallel steps. One of the things that we do in the parallel steps is send a POST request to an API. We have found that when multiple calls occur simultaneously, although each call should have a unique payload, they all use the same payload. This was tested by adding in a random sleep before they make the API call and saw the calls work as we expect.
A minimal Jenkinsfile to test the issue can be found below, note that the API we are calling is internal and so I cannot provide the URL to it in my sample. It is simply a POST endpoint that takes in a string as the body.
def randomNumber (int lowerLimit, int upperLimit) { Random rand = new Random() random_number = rand.nextInt(upperLimit+lowerLimit) return random_number } def getAllTerraformsExecutionParallelSteps(Map PipelineResourcesV2, Boolean ValidateOnly=false) { def steps = [:] for (int x=0; x < PipelineResourcesV2.terraforms.size(); x++) { def currentTerraform = PipelineResourcesV2.terraforms[x] if (currentTerraform.name != 'EnvironmentDefaults') { steps[currentTerraform.name] = { currentTerraform["outputs"] = invokeJob(PipelineResourcesV2, currentTerraform, ValidateOnly, 0, true) } } } return steps } def invokeJob(Map pipelineResources, Map terraformMap, Boolean validateOnly=false, Integer quietPeriod=0, Boolean wait=true) { //terraformMap required values: name, provider, configuration.path, configuration.region echo "Invoking for name: ${terraformMap.name} provider: ${terraformMap.provider} path: ${terraformMap.configuration.path} validateOnly: ${validateOnly}" def logVerb='Applying' if (validateOnly) { logVerb='Validating' } try{ // uncomment the line below to test with random sleep //sleep randomNumber(1,20) addLogMessage("INFO", "${logVerb} Terraform for ${terraformMap.name}") return null }catch(e){ error "Failed to execute: ${e}" } } def callAPI(String method, String uriStem, String validResponseCodes = '200', String requestBody = null) { httpRequestParameters = [ 'url': '{baseURL}' + uriStem, 'httpMode': method, 'validResponseCodes': validResponseCodes, 'authentication': {credentials}, 'consoleLogResponseBody': true ] if(requestBody){ httpRequestParameters['requestBody'] = requestBody httpRequestParameters['contentType'] = 'APPLICATION_JSON' } try { retry(5){ httpRequest(httpRequestParameters) } } catch(Exception e) { throw e } } def addLogMessage(String level = 'Info', String message){ callAPI('POST', "{path}", '200', "\"${message}\"") } node { stage('Test') { def PipelineResourcesV2 = readJSON(text: '{"terraforms":[{"name":"EnvironmentDefaults","provider":"AwsTerragruntV2","configuration":{"region":"","path":""},"outputs":{}},{"provider":"AwsTerragruntV2","name":"IISV1","configuration":{"region":"","path":"","terragruntJsonConfig":{"terraform":{},"inputs":{"infrastructure_name":"WINDOWS-DOTNET","domain_name":"","application_name":"IISV1","instances":[""]}}}},{"provider":"AwsTerragruntV2","name":"DOTNETWEBV1","configuration":{"region":"","path":"","terragruntJsonConfig":{"terraform":{},"inputs":{"infrastructure_name":"LINUX-DOTNET","domain_name":"","application_name":"DOTNETWEBV1","instances":[""]}}}},{"provider":"AwsTerragruntV2","name":"TOMCATV1","configuration":{"region":"","path":"","terragruntJsonConfig":{"terraform":{},"inputs":{"infrastructure_name":"WINDOWS-JAVA","domain_name":"","application_name":"TOMCATV1","instances":[""]}}}},{"provider":"AwsTerragruntV2","name":"TOMCATV2","configuration":{"region":"","path":"","terragruntJsonConfig":{"terraform":{},"inputs":{"infrastructure_name":"LINUX-JAVA","domain_name":"","application_name":"TOMCATV2","instances":[""]}}}}]}') def stepsForTerraformValidation = getAllTerraformsExecutionParallelSteps(PipelineResourcesV2, true) parallel stepsForTerraformValidation } }