Jenkins workspace with @2

5,827 views
Skip to first unread message

Lalchand Rajak

unread,
Sep 17, 2021, 6:19:07 AM9/17/21
to Jenkins Users
Hello,
I  have a job running in Jenkins and It's creating a workspace with a job name@2 or sometimes with @3. Can any one help why this is happening?.

Thanks, Lalchand
workspace.PNG

Dirk Heinrichs

unread,
Sep 17, 2021, 9:44:27 AM9/17/21
to jenkins...@googlegroups.com
Am Freitag, dem 17.09.2021 um 01:14 -0700 schrieb Lalchand Rajak:

I  have a job running in Jenkins and It's creating a workspace with a job name@2 or sometimes with @3. Can any one help why this is happening?.

Because you have multiple builds of that job running at the same time. You don't want them to build in the same workspace, do you?

Bye...

Dirk
-- 
Dirk Heinrichs
Senior Systems Engineer, Delivery Pipeline
OpenText ™ Discovery | Recommind
Recommind GmbH, Von-Liebig-Straße 1, 53359 Rheinbach
Vertretungsberechtigte Geschäftsführer Gordon Davies, Madhu Ranganathan, Christian Waida, Registergericht Amtsgericht Bonn, Registernummer HRB 10646
This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error) please notify the sender immediately and destroy this e-mail. Any unauthorized copying, disclosure or distribution of the material in this e-mail is strictly forbidden
Diese E-Mail enthält vertrauliche und/oder rechtlich geschützte Informationen. Wenn Sie nicht der richtige Adressat sind oder diese E-Mail irrtümlich erhalten haben, informieren Sie bitte sofort den Absender und vernichten Sie diese Mail. Das unerlaubte Kopieren sowie die unbefugte Weitergabe dieser Mail sind nicht gestattet.
signature.asc

Lalchand Rajak

unread,
Sep 17, 2021, 12:35:02 PM9/17/21
to jenkins...@googlegroups.com
I want default workspace should be working instead of @2. How can I achieve that.

Thanks,
Lalchand

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/d1148e47a9d8cdde0f9366bbbb7657b5a509e99e.camel%40opentext.com.

geoffroy...@gmail.com

unread,
Sep 18, 2021, 1:08:06 PM9/18/21
to Jenkins Users
Have you tried https://www.jenkins.io/doc/book/pipeline/syntax/#options

options { disableConcurrentBuilds() }

Lalchand Rajak

unread,
Sep 18, 2021, 1:18:28 PM9/18/21
to jenkins...@googlegroups.com
Yes now  I have added this but still I am noticing workspace getting created with @2 




Björn Pedersen

unread,
Sep 20, 2021, 8:35:29 AM9/20/21
to Jenkins Users
Hi,

generally you should always consider these workspaces as temporary and managed by jenkins. If you need to put files (persistent) in defined places you should do this by explicitly copying  the files (or e.g. use one of the artifact publisher plugins).


And check  the ws step docs:
 <quote> 
A workspace is automatically allocated for you with the node step, or you can get an alternate workspace with this ws step, but by default the location is chosen automatically. (Something like AGENT_ROOT/workspace/JOB_NAME@2.)

You can instead specify a path here and that workspace will be locked instead. (The path may be relative to the build agent root, or absolute.)

If concurrent builds ask for the same workspace, a directory with a suffix such as @2 may be locked instead. Currently there is no option to wait to lock the exact directory requested; if you need to enforce that behavior, you can either fail (error) when pwd indicates that you got a different directory, or you may enforce serial execution of this part of the build by some other means such as stage name: '…', concurrency: 1.

If you do not care about locking, just use the dir step to change current directory.
</quote>
Reply all
Reply to author
Forward
0 new messages