Marcel Stör | 3 Apr 15:40
Favicon

Re: Problems using Ant sql task

Varban wrote:
> Hi Marcel,
>
> can you run a build and check the Tomcat logs to see if maybe there
> is some input required at that point of time? Also make sure that you
> are running the Anthill instance with the same user as before.

I did as recommended but the problem is a sticky one :-(
AND it's getting even more confusing - at least to me. When the build seems
to be sleeping at

[echo] Updating codes and MLS on db EAHVWORK_INIT.LPDOMAIN!
[echo] Using JDBC driver at
\\lpsrv06\BuildSystem/eAHV_B/Nightly/../../JaXLionCommonRuntimeLibs/Nightly/
Latest/oracle_jdbc14_9205.jar...
[echo] Using the following parameters: oracle.jdbc.driver.OracleDriver,
jdbc:oracle:thin:@debie.akbnet.be:1521:eahvb, myuser, mypassword

I stopped the Tomcat Windows service (Anthill is running inside Tomcat). All
of a sudden once Tomcat is stopped I'm seeing more output in my build log!!!

[sql] Executing commands
[sql] 21 of 21 SQL statements executed successfully

This is what I was expecting in the first place! With ProcessExplorer I
checked the active Windows processes and threads and I discovered that the
Java process that was dispachted for the build was still running. Hence, the
build that was interrupted for whatever reason was running after Tomcat was
restarted.

(Continue reading)

gnugy | 3 Apr 22:47
Favicon

Re: [Bulk] Re: Scheduled build always say build not required

Jim Hague wrote:
On Monday 27 March 2006 23:27, Eric Minick wrote:
Interesting. The problem we had seen earlier is that the SVN adapter had been deciding it was time to build too frequently. I believe that was addressed in the most recent build. The approach taken, roughly, is to request a list of changes since the date of the most recent build. The svn client will return too many results due to a subtelty in how it handles revisions. The driver will then filter out any results that appear to have been checked in before the previous build. If there are any revisions remaining, the build will execute.
The 'Right Way' to determine whether a build is required with Subversion would simply to be to look at the change number at the base of the repository - if it is bigger than the change number at the previous build, off we go. Anthill OS (I've not seen/used Pro) keeps this decision in generic code, not on the repository driver. It stores the date/time it started the last build, and asks the repository adapter for the date/time of the last change. Unfortunately in the first version of the Subversion adapter I missed a subtlety of Subversion behaviour. If you ask Subversion for changes since a particular date, what it gives you back is a list of the changes comprising the active change at that date and all subsequent changes. This would mean that typically Anthill would build a new change twice, the second being kicked off because the change that caused it was the active change at the time of the first build. This is fixed in the latest Anthill OS by simply filtering out any changes with a date before the last build time.
My first guess would be that the build server and svn server have clocks which are wildly out of sync. Is that possible?
I'm running Anthill OS on Linux, so there may be Windows issues I am unaware of. If it is never running a build, then I think this must be a problem with the last build date. What is the content of the project file? This is under 'projects', and named <project>.anthill. Here's the relevant bit of one of mine: anthill.lastBuildFailDate = 03/15/2006 23:56:06 anthill.lastBuildSucceeded = true anthill.lastGoodBuildDate = 03/27/2006 20:54:54 I'm wondering if either this date is being interpreted as way in the future, or else if something about how dates are handled in the Subversion adapter is causing problems in the Windows world. If you set logging to debug, then each check will produce some chatter from the Subversion adapter which should help pin it down.
Hi Jim, thanks for the help.  I've checked my project file and the pertinent information is as follows:

anthill.lastGoodBuildDate = 04/03/2006 13:22:59
anthill.lastBuildSucceeded = true

And I know for a fact that I have made a revision since this date.  When I turn debug on the relevant chatter is as follows:

<timestamp> [Thread - AnthillBuildDaemon] INFO com.urbancode.anthill.BuildManager - step 2) is project up to date?

<timestamp> [Thread - AnthillBuildDaemon] DEBUG com.urbancode.anthill.BuildManager - last good build date: Mon Apr 03 13:22:59 EDT 2006

<timestamp> [Thread - AnthillBUildDaemon] DEBUG com.urbancode.anthill.adapter.SubversionRepositoryAdapter - Get revisions since command: svn log --non-interactive -v --username "anthill" --password "anthill" -r "{2006-04-03 13:22:59 -0400}:HEAD" svn://localhost/repos/TestApp

<timestamp> [Thread - AnthillBuildDaemon] DEBUG com.urbancode.anthill.adapter.SubversionRepositoryAdapter - returning revisionList

<timestamp> [Thread -AnthillBuildDaemon] INFO com.urbancode.anthill.BuildManager - Build NOT required

<timestamp> [Thread -AnthillBuildDaemon] INFO com.urbancode.anthill.BuildManager - Build NOT required.

The <timestamp>s are all between 15:48:04:140 and 15:48:04:531.

I was looking through the code and noticed that in SubversionRepositoryAdapter.parseLogCommandResult() there are alot of log.debug() messages not showing that would show up if this for loop were to be executed:

for ( String line = br.readLine(); line != null; line = br.readLine() ){
... }

where br is a BufferedReader supposedly containing the results from the svn log command.  So my guess is that this command isn't returning anything or hasn't returned anything when it's results are parsed.  If I manually execute the svn log command I do get results so I'm pretty sure it's not the command itself.  I'm wondering if maybe the command hasn't yet returned anything when this for loop is executed.

The block of code where parseLogCommandResult() is called looks like this:

            p = Runtime.getRuntime().exec(toArray(commandString));

            // pump the error stream.
            errorPumper = new StreamPumper(p.getErrorStream(), "getRevisions",
            System.err, true);
            errorPumper.start();
           
            // get and parse the input stream
            InputStream input = p.getInputStream();
            parseLogCommandResult(input, revisionList, date);
           
            exitcode = p.waitFor();

I'm going to try and see if calling exitcode = p.waitFor(); before calling parseLogCommandResult(input, revisionList, date); will fix this.  But I have never built Anthill before so that might be opening a whole new can of beans.  Anyway, any help would be appreciated, thanks, Philip.
_______________________________________________
Anthill mailing list
Anthill@...
http://lists.urbancode.com/mailman/listinfo/anthill
Jim Hague | 4 Apr 00:04
X-Face
Picon
Favicon
Gravatar

Re: [Bulk] Re: Scheduled build always say build not required

On Monday 03 April 2006 21:47, gnugy wrote:
> And I know for a fact that I have made a revision since this date.  When
> I turn debug on the relevant chatter is as follows:
> [...]
> <timestamp> [Thread - AnthillBUildDaemon] DEBUG
> com.urbancode.anthill.adapter.SubversionRepositoryAdapter - Get
> revisions since command: svn log --non-interactive -v --username
> "anthill" --password "anthill" -r "{2006-04-03 13:22:59 -0400}:HEAD"
> svn://localhost/repos/TestApp

You're quite right. There should be something here, logging the start of a new 
revision.

> <timestamp> [Thread - AnthillBuildDaemon] DEBUG
> com.urbancode.anthill.adapter.SubversionRepositoryAdapter - returning
> revisionList
> [...]
> I was looking through the code and noticed that in
> SubversionRepositoryAdapter.parseLogCommandResult() there are alot of
> log.debug() messages not showing that would show up if this for loop
> were to be executed:
>
> for ( String line = br.readLine(); line != null; line = br.readLine() ){
> ... }
>
> where br is a BufferedReader supposedly containing the results from the
> svn log command.  So my guess is that this command isn't returning
> anything or hasn't returned anything when it's results are parsed.
>
> If I manually execute the svn log command I do get results so I'm pretty
> sure it's not the command itself.  I'm wondering if maybe the command hasn't
> yet returned anything when this for loop is executed.

I'd be little surprised (but only a little, mind) if the problem was the 
BufferedReader not returning anything or returning too early. It is supposed 
to wait until end-of-file.

I think there are two other possibilities. One is that the 'svn log' command 
isn't actually returning anything. The other is that the command is returning 
something, but that something is never matching the headerRE regular 
expression.

If you do manage to recompile, and put

			log.debug("Line: " + line);

immediately after the for(){ but before the switch(), that would at least tell 
us which of the above is the case. It might be an idea to add another 
log.debug() before the for(), so you can tell that you have managed to 
recompile/reinstall Anthill successfully, and aren't just looking at the old 
version.

BTW, what OS are you running Anthill on? And which JVM and which version of 
Subversion? I can tell you it works OK on Linux (Debian testing) with IBM JVM 
1.4.2 and Subversion 1.2.3.

Good luck.
--

-- 
Jim Hague - jim.hague@...        Never trust a computer you can't lift.
Res Pons | 4 Apr 04:26
Picon

Clock Changes did not take effect in my AH-OS

Not sure if this is important or a bug:

My nightly builds on Anthill OS on a WinXP machine are set to for 3 a.m.  
During this past weekend, the PC clock automatically changed to the new time 
but the build didn't start until 4 a.m.  So this part makes sense.  Well 
kinda!

But if most PC clocks or computers are set to change around 1 or 2 a.m.  I'm 
baffled as to what happened?  It doesn't make sense.  Should a clock change 
require a PC reboot?  Or Anthill kept track of time by caching it, based on 
the old time?

_________________________________________________________________
Is your PC infected? Get a FREE online computer virus scan from McAfee® 
Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963
Varban | 4 Apr 06:20

Re: Clock Changes did not take effect in my AH-OS

The thing is that the time changed after Anthill calculated the time to 
the next scheduled build. What happens is that the Anthill scheduler 
will send a build to the queue, calculate the time till the next 
scheduled build and go to sleep for that amount of time. However, time 
changed during that period and your build happened an hour later (or the 
glass is half empty and the build was on time but the clock moved ;)). 
 From then on the builds should happen on the assigned time.
In Pro we used the quartz scheduler that (I think) handles time change 
better...

Regards,
Varban

Res Pons wrote:
> Not sure if this is important or a bug:
> 
> My nightly builds on Anthill OS on a WinXP machine are set to for 3 
> a.m.  During this past weekend, the PC clock automatically changed to 
> the new time but the build didn't start until 4 a.m.  So this part makes 
> sense.  Well kinda!
> 
> But if most PC clocks or computers are set to change around 1 or 2 a.m.  
> I'm baffled as to what happened?  It doesn't make sense.  Should a clock 
> change require a PC reboot?  Or Anthill kept track of time by caching 
> it, based on the old time?
> 
> _________________________________________________________________
> Is your PC infected? Get a FREE online computer virus scan from McAfee® 
> Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963
> 
> _______________________________________________
> Anthill mailing list
> Anthill@...
> http://lists.urbancode.com/mailman/listinfo/anthill
gnugy | 4 Apr 06:32
Favicon

Re: [Bulk] Re: [Bulk] Re: Scheduled build always say build not required

Jim Hague wrote:
On Monday 03 April 2006 21:47, gnugy wrote:
And I know for a fact that I have made a revision since this date. When I turn debug on the relevant chatter is as follows: [...] <timestamp> [Thread - AnthillBUildDaemon] DEBUG com.urbancode.anthill.adapter.SubversionRepositoryAdapter - Get revisions since command: svn log --non-interactive -v --username "anthill" --password "anthill" -r "{2006-04-03 13:22:59 -0400}:HEAD" svn://localhost/repos/TestApp
You're quite right. There should be something here, logging the start of a new revision.
<timestamp> [Thread - AnthillBuildDaemon] DEBUG com.urbancode.anthill.adapter.SubversionRepositoryAdapter - returning revisionList [...] I was looking through the code and noticed that in SubversionRepositoryAdapter.parseLogCommandResult() there are alot of log.debug() messages not showing that would show up if this for loop were to be executed: for ( String line = br.readLine(); line != null; line = br.readLine() ){ ... } where br is a BufferedReader supposedly containing the results from the svn log command. So my guess is that this command isn't returning anything or hasn't returned anything when it's results are parsed. If I manually execute the svn log command I do get results so I'm pretty sure it's not the command itself. I'm wondering if maybe the command hasn't yet returned anything when this for loop is executed.
I'd be little surprised (but only a little, mind) if the problem was the BufferedReader not returning anything or returning too early. It is supposed to wait until end-of-file. I think there are two other possibilities. One is that the 'svn log' command isn't actually returning anything. The other is that the command is returning something, but that something is never matching the headerRE regular expression. If you do manage to recompile, and put log.debug("Line: " + line); immediately after the for(){ but before the switch(), that would at least tell us which of the above is the case. It might be an idea to add another log.debug() before the for(), so you can tell that you have managed to recompile/reinstall Anthill successfully, and aren't just looking at the old version. BTW, what OS are you running Anthill on? And which JVM and which version of Subversion? I can tell you it works OK on Linux (Debian testing) with IBM JVM 1.4.2 and Subversion 1.2.3. Good luck.
When I make those changes I get plenty of DEBUG messages stating the lines that the log command returns but you were right,
none of them are matching the header regular expression.  My Regular Expressions are a little rusty my interpretation of the pattern is
that it will match any line that starts with an r, followed by 1 or more digits.  Then a space followed by a pipe(|).
This is followed by another space then any number of non-whitespace characters.  Followed again by space, pipe, space.  Followed by
1 or more characters that aren't ('s.  If this is the case then I thought the problem was with the fact that my author, I have "(no author)", contains a space.
So the space would break the (\\S+) part of the expression but this isn't followed by a ' | '.  So I tried replacing the  expression with:

"^r(\\d+) \\| ([^\\|]+)\\| ([^\\(]+)"

Running with this expression worked, awesome, thanks for your help.  Cheers, Philip.
_______________________________________________
Anthill mailing list
Anthill@...
http://lists.urbancode.com/mailman/listinfo/anthill
gnugy | 4 Apr 06:41
Favicon

Re: Scheduled build always say build not required

gnugy wrote:
Jim Hague wrote:
On Monday 03 April 2006 21:47, gnugy wrote:
And I know for a fact that I have made a revision since this date. When I turn debug on the relevant chatter is as follows: [...] <timestamp> [Thread - AnthillBUildDaemon] DEBUG com.urbancode.anthill.adapter.SubversionRepositoryAdapter - Get revisions since command: svn log --non-interactive -v --username "anthill" --password "anthill" -r "{2006-04-03 13:22:59 -0400}:HEAD" svn://localhost/repos/TestApp
You're quite right. There should be something here, logging the start of a new revision.
<timestamp> [Thread - AnthillBuildDaemon] DEBUG com.urbancode.anthill.adapter.SubversionRepositoryAdapter - returning revisionList [...] I was looking through the code and noticed that in SubversionRepositoryAdapter.parseLogCommandResult() there are alot of log.debug() messages not showing that would show up if this for loop were to be executed: for ( String line = br.readLine(); line != null; line = br.readLine() ){ ... } where br is a BufferedReader supposedly containing the results from the svn log command. So my guess is that this command isn't returning anything or hasn't returned anything when it's results are parsed. If I manually execute the svn log command I do get results so I'm pretty sure it's not the command itself. I'm wondering if maybe the command hasn't yet returned anything when this for loop is executed.
I'd be little surprised (but only a little, mind) if the problem was the BufferedReader not returning anything or returning too early. It is supposed to wait until end-of-file. I think there are two other possibilities. One is that the 'svn log' command isn't actually returning anything. The other is that the command is returning something, but that something is never matching the headerRE regular expression. If you do manage to recompile, and put log.debug("Line: " + line); immediately after the for(){ but before the switch(), that would at least tell us which of the above is the case. It might be an idea to add another log.debug() before the for(), so you can tell that you have managed to recompile/reinstall Anthill successfully, and aren't just looking at the old version. BTW, what OS are you running Anthill on? And which JVM and which version of Subversion? I can tell you it works OK on Linux (Debian testing) with IBM JVM 1.4.2 and Subversion 1.2.3. Good luck.
When I make those changes I get plenty of DEBUG messages stating the lines that the log command returns but you were right,
none of them are matching the header regular expression.  My Regular Expressions are a little rusty my interpretation of the pattern is
that it will match any line that starts with an r, followed by 1 or more digits.  Then a space followed by a pipe(|).
This is followed by another space then any number of non-whitespace characters.  Followed again by space, pipe, space.  Followed by
1 or more characters that aren't ('s.  If this is the case then I thought the problem was with the fact that my author, I have "(no author)", contains a space.
So the space would break the (\\S+) part of the expression but this isn't followed by a ' | '.  So I tried replacing the  expression with:

"^r(\\d+) \\| ([^\\|]+)\\| ([^\\(]+)"

Running with this expression worked, awesome, thanks for your help.  Cheers, Philip.
_______________________________________________ Anthill mailing list Anthill-IWHQxnLZ/P3rXihlmxnZCEEOCMrvLtNR@public.gmane.org http://lists.urbancode.com/mailman/listinfo/anthill
I should also mention that running with the changed expression I had to account for the extra space at the end of the author.
_______________________________________________
Anthill mailing list
Anthill@...
http://lists.urbancode.com/mailman/listinfo/anthill
Marcel Stör | 4 Apr 09:21
Favicon

Re: Problems using Ant sql task

It continuous to amaze me, how quickly I'm getting replies on this list.
Thanks for that!

Varban wrote:
> The logic comes from the fact that you are using Windows.
> Unfortunately, processes in Windows are handled very poorly and this
> leads to the "results" you are observing. In your case, the sql task
> most likely starts a new process that executes the statements against
> the database. The problem is that this process is started in a new
> console by default and thus if you kill Tomcat this process will not
> be affected. Windows does not actually offer any decent way to
> actually end this new process once it is created (a pathetic attempt
> to create security measures on their side). That is why your process
> continued working after you stopped Tomcat.
> When you upgraded, did you remove the anthill directories from the
> webapps and work directories in the tomcat installation? Is it
> possible that you deployed the new war file via a context xml file
> and thus running two instances of Anthill at the same time?

This is not the case. We started with a clean installation on a new system
and Anthill is the only application running in Tomcat.

> It almost seems that once you stopped Tomcat, whatever was affecting
> the sql process dissapeared and the process completed successfully.

With the help of ProcessExplorer I tried to figure out what that "whatever
was affecting the sql process" could be. No success...

> Is there another application running in Tomcat that could be holding
> locks on the same tables as the sql process you are running? I also
> see that autocommit is off so any select statement would create a
> lock on the table unless you commit, could that be causing a problem?

It is on purpose that autocommit is off to span a transaction for all SQL
statements. The Ant sql task doesn't even get to open a connection to the
db; I did check that.

In the end, I gave up and replaced the sql task with

<exec dir="." executable="cmd.exe" os="Windows 2000" output="${output}">
 <arg line="sqlplus ${userid}/${password}@eahvb.akbnet.be @myscript.sql" />
</exec>

-> well, it works for whatever reason!

--
Marcel Stör
http://www.frightanic.com -> free Sudoku mailing service
Jim Hague | 4 Apr 10:31
X-Face
Picon
Favicon
Gravatar

Re: [Bulk] Re: [Bulk] Re: Scheduled build always say build not required

On Tuesday 4 April 2006 05:32, gnugy wrote:
> My Regular Expressions are a little rusty my interpretation of
> the pattern is that it will match any line that starts with
> an r, followed by 1 or more digits.  Then a space followed by a pipe(|).
> This is followed by another space then any number of non-whitespace
> characters.  Followed again by space, pipe, space.  Followed by
> 1 or more characters that aren't ('s.

That's correct. You're obviously not *that* rusty :-)

> If this is the case then I thought the problem was with the
> fact that my author, I have "(no author)", contains a space.

Ahhhhh! Or, indeed, aaarrgggghhhhh! Yes, that would indeed cause the problem. 
I didn't realise this was possible. Having checked the Subversions FAQ, do I 
assume someone is accessing the repository via anonymous write acces to 
Apache?

> So the space would break the (\\S+) part of the expression but this
> isn't followed by a ' | '.  So I tried replacing the  expression with:
>
> "^r(\\d+) \\| ([^\\|]+)\\| ([^\\(]+)"
>
> Running with this expression worked, awesome, thanks for your help.

Good news, and thank you for your persistence and getting to the bottom of 
this.

I'll redo the regular expression along the lines you outlined and send a patch 
to Urbancode.

(I know that in one sense I should be using the 'svn log' XML output here. But 
frankly, I don't want to haul in an XML parser when parsing the regular 
output via REs is so quick and easy).
--

-- 
Jim Hague - jim.hague@...          Never trust a computer you can't lift.
Eric Minick | 4 Apr 16:42

Re: [Bulk] Re: [Bulk] Re: Scheduled build always say build not required

Shockingly enough, I have been watching the conversation and now that I 
dive into the code, I'm a bit confused. I see this:

            headerRE = new RE("^r(\\d+) \\| ([^\\|]+) \\| ([^\\(]+)");
            //headerRE = new ("^r(\\d+) \\| (\\S+) \\| ([^\\(]+)");

Looks like Varban had corrected this problem back in October when we 
tripped across it in Anthill Pro (we have to apologize for not 
remembering that and putting 2 and 2 together). Is this cropping up in a 
different spot, or are we looking at different code?

-- Eric

Jim Hague wrote:

>On Tuesday 4 April 2006 05:32, gnugy wrote:
>  
>
>>My Regular Expressions are a little rusty my interpretation of
>>the pattern is that it will match any line that starts with
>>an r, followed by 1 or more digits.  Then a space followed by a pipe(|).
>>This is followed by another space then any number of non-whitespace
>>characters.  Followed again by space, pipe, space.  Followed by
>>1 or more characters that aren't ('s.
>>    
>>
>
>That's correct. You're obviously not *that* rusty :-)
>
>  
>
>>If this is the case then I thought the problem was with the
>>fact that my author, I have "(no author)", contains a space.
>>    
>>
>
>Ahhhhh! Or, indeed, aaarrgggghhhhh! Yes, that would indeed cause the problem. 
>I didn't realise this was possible. Having checked the Subversions FAQ, do I 
>assume someone is accessing the repository via anonymous write acces to 
>Apache?
>
>  
>
>>So the space would break the (\\S+) part of the expression but this
>>isn't followed by a ' | '.  So I tried replacing the  expression with:
>>
>>"^r(\\d+) \\| ([^\\|]+)\\| ([^\\(]+)"
>>
>>Running with this expression worked, awesome, thanks for your help.
>>    
>>
>
>Good news, and thank you for your persistence and getting to the bottom of 
>this.
>
>I'll redo the regular expression along the lines you outlined and send a patch 
>to Urbancode.
>
>(I know that in one sense I should be using the 'svn log' XML output here. But 
>frankly, I don't want to haul in an XML parser when parsing the regular 
>output via REs is so quick and easy).
>  
>

Gmane