understanding milestone and locks - why is stage terminated?

25 views
Skip to first unread message

Torsten Reinhard

unread,
Sep 15, 2017, 5:21:31 AM9/15/17
to Jenkins Users
Hi,

I have a large development pipeline doing the Build, Deploy & Test of some MicroServices. Reduced to the essential parts it looks like:

node() {
    stage
("CI: Build, unit test") {
        milestone label
: 'Building...'
        ciBuildTest
( ... )
   
}

   
// Lock running SonarQube - the newest build waiting for this lock will get it, first
   
// => old builds should be skipped to save time
   
lock( resource:"${myProject}-SonarQube", inversePrecedence: true) {
        stageCiAnalysis
( ... )
        milestone label
: 'SonarQube analyzed'
   
}
   
   
// Lock using the environment - the newest build waiting for this lock will get it, first
   
// => old builds should be skipped to save time
   
lock(resource:"${myProject}-${ENVIRONMENT}", inversePrecedence: true) {
        migrateDatabase
(...)
        deployToServer
(...)
        smokeTest
(...)
       
        milestone label
: "${config.environment} deployed and tested"
   
}
}


The intention is that parallel buils are created even when an older build is being analyzed by SonarQube or if it will is being deployed and tested - and if the (deployment) lock is released, the newest build (LIFO) should be used for the next deployment.

When running that pipeline, I detected the "deployToServer" stage being interrupted - although it´s part of a lock that hasn´t been released:

2017-09-12 16:38:27,208 [main] INFO  LogOutputHandler deploying.......

Superseded by DEV/MRPCLASSIC/DEV_MRPCLASSIC_DEVELOPMENT#548 Sending interrupt signal to process [Pipeline] } [Pipeline] // stage [Pipeline] } Lock released on resource [DEV-MRP-EMEA-TEST]

Why does Build #548 send an interrupt signal to #547 that is being executed - and inside a lock?

Whats´missing here?

thanx for any advice,

best regards, Torsten
Reply all
Reply to author
Forward
0 new messages