It's all about the answers!

Ask a question

BuildForge, how to set different values in each thread?


Jirong Hu (1.5k9295258) | asked Jun 30 '15, 3:44 p.m.
My purpose is like this: based on a variable, I want to run an Inline library (has two steps) on the target servers. If the variable is "y,y,n,n", I want the library runs on server1 and server2.

I created the project as follows, each "Run on * Server" includes the inline library. I tried to run the .bset selector both in the thread step or inside the inline, seems the server value is overwritten each other in threads. How can I make sure each thread is running on the right server?

P.S. the .bset env "APP_BANNER=n,y,n,n" is to reset the value to enable K only. The original value is "y,y,h,h", means need to run the library on H and K server.

Accepted answer


permanent link
Spencer Murata (2.3k115971) | answered Jun 30 '15, 4:41 p.m.
FORUM MODERATOR / JAZZ DEVELOPER
The .bset selector will affect the entire build.  So the current configuration will create a race condition between the steps.  If you want to set it differently you would need to chain the project to make sure each thread project then gets its own stack.

But I would still say that a broadcast step with a selector tailored to the pool of servers you want to run the steps on would be the easier cleaner solution.

~Spencer
Jirong Hu selected this answer as the correct answer

Comments
Jirong Hu commented Jun 30 '15, 4:54 p.m.

Will change to .tset resolve the problem? The doc says the inline project steps will all be run inside the same command property of the calling project.



Jirong Hu commented Jun 30 '15, 4:55 p.m.

The doc says the following for inline project:


When the step runs, the following happens:
  1. The step runs the command or commands in the Command property.
  2. The step runs the steps of the project or library that is specified in the Inline property.


Jirong Hu commented Jun 30 '15, 4:56 p.m.

 How to chain the projects in my case?


Jirong Hu commented Jul 01 '15, 6:55 p.m.

 The chained project works. Now I am going to try the broadcast solution you've told me in another post. Thanks a lot!

Your answer


Register or to post your answer.


Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.