Possibility to Restart an Agent

Hello,

I think it would be nice to be able to restart an Agent from the TC Web GUI.

The restart should do the same than I would do on the machine itself.
The process that should be behind this functionality is:

- agent.[sh|bat] stop
- wait for the build to finish (if there is any running on that server)
- agent.[sh|bat] start

This feature would help us in case the environment on a machine has changed and all agents on that server need to be restarted.
Imagine you have a bunch of machines with a bunch of agents that need to be restarted. Such a feature would save
quite some time.
Also a restart of a list of agents / a pool of agents would be very handy.


Thanks,
detlef

4 comments
Comment actions Permalink

if you click on the agents tab, you can reboot them remotely, is this not what your talking about? I havent tested to see if it waits for the builds to finish yet.

0
Comment actions Permalink

Reboot the agent machine does a reboot of the entire machine. (Thats what I think)
And I only want to reboot the agent process.
Maybe Im wrong with my statement and somebody can tell me what Reboot Agent does ?

0
Comment actions Permalink

Hi

The agent launches exеernal processes to execute build scripts. Could you explain more, what kind of resources do you want to cleanup by restarting the agent process?

Services can be restarted from command line by NET or SC tools, but if you put them as additional build step within the build, it will cause all the builds to fail - the agents are stopped earlier than artifacts are uploaded and successfull build state is reported to the server.
I could only suggeast to put this restart logic into separate build configuration, and it to your build by snapshot dependency.
Another option would be to develop new TeamCity plugin that performs restart after builds are completed.

0
Comment actions Permalink

Hi Michael,

in our build script (Gradle) we are depending on envorinment variables. If such an environment variable changes - and this can happen if the relevant package
gets updated or upgraded, the agent needs to be restarted. This is how we designed it currently. Maybe this approach is wrong and we should always setup
our environment at the beginning of a build.
However - I think it would be nice if a selected set of agents can be restarted from within the TC Web UI.

You agree ?

Thanks,
detlef

1

Please sign in to leave a comment.