Calling lscm.bat from a build script causes a hang
Accepted answer
When calling lscm.bat from Hudson, Ant script, or other build tool is causing a hang where the build never terminates. However if I change the build tool to use scm.exe the hang disappears. Why does this happen?
Comments
Even after I issue scm daemon start /share/root and background the process, subsequent lscm requests start another daemon, which I cannot control (running on Linux).
Why does lscm not use the scm that is already running?
Two instances that this could happen...
a) Certain commands such as help, version or remote commands such as "list workspace" does not use the sandbox. In those cases, if you ran lscm from a non-sandbox directory it will launch a new daemon. But if you run the commands from within the sandbox directory it will reuse the daemon that tracks that sandbox.
b) lscm uses one daemon to track per sandbox. So if you now loaded or operated in a second sandbox then you would see two daemon processes.
Spencer,
Is that using the SCM binary to run the command or the API?
We are using the scm binary, the API wasn't as straight forward. Here is a code snippet:
It would be safer to start and stop it in the script, but if you don't mind the daemon hanging around after the script runs and whatever build tool you are using to execute doesn't consider the daemon to be part of the build, i.e. it will allow the script to be marked complete, then you run without the start/stop calls.
~Spencer