New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Race condition while upgrading the agent #20

ypujante opened this Issue Jan 18, 2011 · 1 comment


None yet
1 participant

ypujante commented Jan 18, 2011

While trying to upgrade the agent using the console (Admin/upgrade agent), I ran into what seems to be a race condition. On the agent side I see:

2011/01/18 07:37:05.451 INFO [0-SNAPSHOT] executeAction([action:prepare, mountPoint:/upgrade/1.7.0-SNAPSHOT, actionArgs:[:]]): 46f74878-f963-44d2-aaeb-a816b76058af
2011/01/18 07:37:05.534 INFO [0-SNAPSHOT] Preparing...
2011/01/18 07:37:05.750 INFO [0-SNAPSHOT] Prepare complete... restarting agent...
2011/01/18 07:37:05.774 INFO [AgentMain] Shutting down...
2011/01/18 07:37:05.779 INFO [AgentMain] Stopping REST service...
2011/01/18 07:37:05.782 INFO [AgentMain] REST service stopped.
2011/01/18 07:37:05.782 INFO [AgentMain] Shutting down the agent...
2011/01/18 07:37:05.810 INFO [AgentMain] Agent shut down...

and when the agent restarts I see:

2011/01/18 07:37:09.991 INFO [StateKeeperScriptManager] Restoring state: [scriptDefinition:[mountPoint: /upgrade/1.7.0-SNAPSHOT, parent: /, scriptFactory: FromClassNameScriptFactory[org.linkedin.glu.agent.impl.script.AutoUpgradeScript], initParameters: [agentTar:file:///export/content/repositories/release/org/linkedin/org.linkedin.glu.agent-server-upgrade/1.7.0-SNAPSHOT/org.linkedin.glu.agent-server-upgrade-1.7.0-SNAPSHOT.tgz, newVersion:1.7.0-SNAPSHOT]], scriptState:[script:[agentRootDir:/export/content/glu/devsetup/agent-2, currentVersion:1.7.0, untarredAgent:file:/export/content/glu/devsetup/agent-2/data/tmp/upgrade/1.7.0-SNAPSHOT/__tmp74776346Dir], stateMachine:[currentState:installed, transitionState:installed->prepared, transitionAction:prepare]]]
2011/01/18 07:37:10.097 INFO [0-SNAPSHOT] installed

The race condition comes from the fact that the agent shutdown prior to completing the transition => when it comes back up, it discards the transition (which is normal behavior). So the agent remains in state 'installed'. The agent needs to wait for any pending transition in order to shutdown.


This comment has been minimized.


ypujante commented Jan 21, 2011

fixed with 1.7.1

This issue was closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment