History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: QB-2107
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Minor Minor
Assignee: Robin Shen
Reporter: Irina Kotlova
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
QuickBuild

Slow performance while executing batch file on Windows

Created: 02/Jul/14 09:49 PM   Updated: 03/Jul/14 11:28 PM
Component/s: None
Affects Version/s: 5.1.11
Fix Version/s: None

Original Estimate: Unknown Remaining Estimate: Unknown Time Spent: Unknown
File Attachments: 1. File create-poms.bat (1 kb)
2. Text File no_ant_full-log.txt (29 kb)

Environment: Windows 2008 Server R2


 Description  « Hide
We generate multiple pom.xml files from pom-template.xml in the project directory. It comes down to substituting several version properties. The substitution is done in create-poms.bat/create-poms.sh script. SED is used on both platforms. Unix substitution goes well - no problems are encountered. On Windows however there is a problem: if run locally substitution gets done in about 10-15 seconds; if run in QuickBuild, the substitution runs for about 27 minutes.

I cannot get to the cause of this performance issue.
- we use sed.exe from git 1.7.4;
- tried running create-poms.bat directly without Ant - no improvement;
- tried first generating the list of poms to convert, followed by processing the list - no improvement.

Please advise how to approach the issue.
Thanks.


 All   Comments   Work Log   Change History      Sort Order:
Irina Kotlova [02/Jul/14 09:52 PM]
This is the script that gets executed.

Irina Kotlova [02/Jul/14 09:56 PM]
The substitution started at 4:46 PM, ended at 05:04 PM. This is way too long time. (I added additional logging to the script.) In comparison Unix runs for 4 seconds.

Robin Shen [03/Jul/14 12:15 AM]
I guess this might be caused by some environmental issues. Please run the agent (or server) running this step in console mode by stopping it and issuing "bin/agent.bat console" (or "bin/server.bat console" if it is a server) from the same command prompt where the batch file runs fast. Then run the batch in QB again to see what happens.

Irina Kotlova [03/Jul/14 06:00 PM]
Oops - always forget to try console mode. It is because I was not expecting QuickBuild doing something wrong :-) was assuming anti-virus is a player here or something else.
So, in console mode the script got executed in just 6 seconds!

Is there a way to fix this without switching to the console mode? Console mode is less secure and a bit more complex to maintain, because it requires to set up automatic service startup on reboot, it means that the build user password should be put in the registry, anybody unlocking the system immediately gets access to it.

Thanks!

Irina Kotlova [03/Jul/14 07:29 PM]
The problem now is fixed: I switched to SourceForge's sed.exe from UnixUtils. Sorry for the hassle.

Robin Shen [03/Jul/14 11:28 PM]
Normally it is an environmental issue if some things works normally if run from command line but not from QB. So running QB in console mode is to make sure that they use the same environments. In this case, the sed.exe from git might not work normally when calling from a background Windows service.