You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@maven.apache.org by Florin Vancea <fv...@maxiq.ro> on 2003/04/22 07:49:01 UTC

HttpUtils leaves .incomplete files around

In HttpUtils.java, line 165 in HEAD (or at least very recent) says:

        tempFile.renameTo(destinationFile);

Well, the rename is OK, as far as there's nothing there with that target
name. On W2k (and I guess on other platforms, too) renaming here fails,
particularly when getting the second time a SNAPSHOT jar.

Because the rename fails to overwrite the existing SNAPSHOT.jar, the
latest-and-greatest is stuck with the status of ".incomplete" and never
makes it to the project itself. I think this may create weird problems and
it should be taken care of.

<offtopic>
I would try to offer patches for trivial things like that, instead of merely
pointing at them.
However, my previous attempts to offer a solution along with the problem
(yes, I admit, clumsy ones) were completely ignored. Therefore I will only
signal to whoever is interested the bugs/"features" I've found and maybe
someone will take care of them. At least until someone authoritative shoves
me off to the user list where I probably belong, whining like this.
</offtopic>

Sorry for intruding,
Florin



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


Re: HttpUtils leaves .incomplete files around

Posted by Ben Walding <de...@walding.com>.
Until recently we did not receive notifications when new bugs were 
filed. They just sat in JIRA.  We are now notified when new bugs are 
filed. Probably best to fire an email to the dev list after a week if 
nothing is happening.


Also, you have to remember that it is never just a matter of applying a 
patch. It has to be tested (irrespective of what it looks like, we do 
test things). I've been burned before when just applying a patch that 
goes and breaks a whole lot of other stuff.



Florin Vancea wrote:

>In HttpUtils.java, line 165 in HEAD (or at least very recent) says:
>
>        tempFile.renameTo(destinationFile);
>
>Well, the rename is OK, as far as there's nothing there with that target
>name. On W2k (and I guess on other platforms, too) renaming here fails,
>particularly when getting the second time a SNAPSHOT jar.
>
>Because the rename fails to overwrite the existing SNAPSHOT.jar, the
>latest-and-greatest is stuck with the status of ".incomplete" and never
>makes it to the project itself. I think this may create weird problems and
>it should be taken care of.
>
><offtopic>
>I would try to offer patches for trivial things like that, instead of merely
>pointing at them.
>However, my previous attempts to offer a solution along with the problem
>(yes, I admit, clumsy ones) were completely ignored. Therefore I will only
>signal to whoever is interested the bugs/"features" I've found and maybe
>someone will take care of them. At least until someone authoritative shoves
>me off to the user list where I probably belong, whining like this.
></offtopic>
>
>Sorry for intruding,
>Florin
>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
>For additional commands, e-mail: dev-help@maven.apache.org
>
>
>  
>



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


Re: HttpUtils leaves .incomplete files around

Posted by Ben Walding <de...@walding.com>.
1.  That would have been happening pre my .incomplete changes.

2. I'll fix that tonight.

Florin Vancea wrote:

>I saw the patch, thanks for looking so quickly in to the issue.
>
>I also tested it myself. It does not leave any ".incomplete" files and
>apparently refreshes the jar.
>
>However, there are some issues (please correct me if there is another proper
>way to make such comments).
>
>1. (maybe major) The original lock is due to the fact that the jar is
>already in the classpath. I don't know exactly how things are handled "under
>the hood" but I wonder: Writing over the jar (which is already taken into
>"custody" by the classloader!) is a good thing? Is this not capable of
>producing some ugly VM/classloader errors later?
>I fear that this issue alone, if I understand it well, is enough to stop the
>benefits of the "console" mode or any other similar usage pattern where the
>MavenSession is loaded only once. Re-loading a new version of the dependency
>during a "console"-type cycle _does_ or _does_not_ happen? To me it looks
>like the classloader has already seen and loaded the original version and
>everything that's not forked will use the "old" version, until the session
>terminates. Please tell me that I'm wrong.
>
>2. (surely minor) The new code does not restore the timestamp of the
>refreshed jar to the timestamp of the original in the repository, but sets
>the file timestamp to the datetime of the copying. No real harm done, but
>it's not "backwards compatible".
>
>Florin
>
>----- Original Message -----
>From: "Ben Walding" <de...@walding.com>
>To: "Maven Developers List" <de...@maven.apache.org>
>Sent: Tuesday, April 22, 2003 1:00 PM
>Subject: Re: HttpUtils leaves .incomplete files around
>
>
>  
>
>>Okie dokie.
>>
>>I'm looking at it all now.
>>
>>I should have read the api for File.delete and File.rename. They return
>>booleans rather than throwing IOExceptions when they fail. Stupid api...
>>
>>Florin Vancea wrote:
>>
>>    
>>
>>>Thanks for replying and please excuse me for any "misbehavior".
>>>
>>>----- Original Message -----
>>>From: "Ben Walding" <de...@walding.com>
>>>To: "Maven Developers List" <de...@maven.apache.org>
>>>Sent: Tuesday, April 22, 2003 12:14 PM
>>>Subject: Re: HttpUtils leaves .incomplete files around
>>>
>>>
>>>
>>>
>>>      
>>>
>>>>Also, once it's a confirmed bug, please file it in JIRA.
>>>>
>>>>
>>>>        
>>>>
>>>Now I did that. You'll find it as MAVEN-412. I thought that talking to
>>>      
>>>
>the
>  
>
>>>dev list is a lesser action than filing the issue into JIRA.
>>>
>>>
>>>
>>>      
>>>
>>>>My memory of what occurred on the list is limited to about 12hrs when I
>>>>purge it all.  I regularly go through and look at all the unassigned
>>>>issues however (once a week on average)
>>>>
>>>>Did you file all your previous patches in JIRA?
>>>>
>>>>
>>>>        
>>>>
>>>No, due to the same concept above and also due to the fact I had trouble
>>>with creating clean patches against the current HEAD.
>>>
>>>
>>>
>>>[snip]
>>>
>>>
>>>
>>>---------------------------------------------------------------------
>>>To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
>>>For additional commands, e-mail: dev-help@maven.apache.org
>>>
>>>
>>>
>>>
>>>      
>>>
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
>>For additional commands, e-mail: dev-help@maven.apache.org
>>
>>
>>    
>>
>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
>For additional commands, e-mail: dev-help@maven.apache.org
>
>
>  
>



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


Re: HttpUtils leaves .incomplete files around

Posted by Florin Vancea <fv...@maxiq.ro>.
I saw the patch, thanks for looking so quickly in to the issue.

I also tested it myself. It does not leave any ".incomplete" files and
apparently refreshes the jar.

However, there are some issues (please correct me if there is another proper
way to make such comments).

1. (maybe major) The original lock is due to the fact that the jar is
already in the classpath. I don't know exactly how things are handled "under
the hood" but I wonder: Writing over the jar (which is already taken into
"custody" by the classloader!) is a good thing? Is this not capable of
producing some ugly VM/classloader errors later?
I fear that this issue alone, if I understand it well, is enough to stop the
benefits of the "console" mode or any other similar usage pattern where the
MavenSession is loaded only once. Re-loading a new version of the dependency
during a "console"-type cycle _does_ or _does_not_ happen? To me it looks
like the classloader has already seen and loaded the original version and
everything that's not forked will use the "old" version, until the session
terminates. Please tell me that I'm wrong.

2. (surely minor) The new code does not restore the timestamp of the
refreshed jar to the timestamp of the original in the repository, but sets
the file timestamp to the datetime of the copying. No real harm done, but
it's not "backwards compatible".

Florin

----- Original Message -----
From: "Ben Walding" <de...@walding.com>
To: "Maven Developers List" <de...@maven.apache.org>
Sent: Tuesday, April 22, 2003 1:00 PM
Subject: Re: HttpUtils leaves .incomplete files around


> Okie dokie.
>
> I'm looking at it all now.
>
> I should have read the api for File.delete and File.rename. They return
> booleans rather than throwing IOExceptions when they fail. Stupid api...
>
> Florin Vancea wrote:
>
> >Thanks for replying and please excuse me for any "misbehavior".
> >
> >----- Original Message -----
> >From: "Ben Walding" <de...@walding.com>
> >To: "Maven Developers List" <de...@maven.apache.org>
> >Sent: Tuesday, April 22, 2003 12:14 PM
> >Subject: Re: HttpUtils leaves .incomplete files around
> >
> >
> >
> >
> >>Also, once it's a confirmed bug, please file it in JIRA.
> >>
> >>
> >
> >Now I did that. You'll find it as MAVEN-412. I thought that talking to
the
> >dev list is a lesser action than filing the issue into JIRA.
> >
> >
> >
> >>My memory of what occurred on the list is limited to about 12hrs when I
> >>purge it all.  I regularly go through and look at all the unassigned
> >>issues however (once a week on average)
> >>
> >>Did you file all your previous patches in JIRA?
> >>
> >>
> >
> >No, due to the same concept above and also due to the fact I had trouble
> >with creating clean patches against the current HEAD.
> >
> >
> >
> >[snip]
> >
> >
> >
> >---------------------------------------------------------------------
> >To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> >For additional commands, e-mail: dev-help@maven.apache.org
> >
> >
> >
> >
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org
>
>



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


Re: HttpUtils leaves .incomplete files around

Posted by Ben Walding <de...@walding.com>.
Okie dokie.

I'm looking at it all now.

I should have read the api for File.delete and File.rename. They return 
booleans rather than throwing IOExceptions when they fail. Stupid api...

Florin Vancea wrote:

>Thanks for replying and please excuse me for any "misbehavior".
>
>----- Original Message -----
>From: "Ben Walding" <de...@walding.com>
>To: "Maven Developers List" <de...@maven.apache.org>
>Sent: Tuesday, April 22, 2003 12:14 PM
>Subject: Re: HttpUtils leaves .incomplete files around
>
>
>  
>
>>Also, once it's a confirmed bug, please file it in JIRA.
>>    
>>
>
>Now I did that. You'll find it as MAVEN-412. I thought that talking to the
>dev list is a lesser action than filing the issue into JIRA.
>
>  
>
>>My memory of what occurred on the list is limited to about 12hrs when I
>>purge it all.  I regularly go through and look at all the unassigned
>>issues however (once a week on average)
>>
>>Did you file all your previous patches in JIRA?
>>    
>>
>
>No, due to the same concept above and also due to the fact I had trouble
>with creating clean patches against the current HEAD.
>
>  
>
>[snip]
>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
>For additional commands, e-mail: dev-help@maven.apache.org
>
>
>  
>



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


Re: HttpUtils leaves .incomplete files around

Posted by Florin Vancea <fv...@maxiq.ro>.
Thanks for replying and please excuse me for any "misbehavior".

----- Original Message -----
From: "Ben Walding" <de...@walding.com>
To: "Maven Developers List" <de...@maven.apache.org>
Sent: Tuesday, April 22, 2003 12:14 PM
Subject: Re: HttpUtils leaves .incomplete files around


> Also, once it's a confirmed bug, please file it in JIRA.

Now I did that. You'll find it as MAVEN-412. I thought that talking to the
dev list is a lesser action than filing the issue into JIRA.

>
> My memory of what occurred on the list is limited to about 12hrs when I
> purge it all.  I regularly go through and look at all the unassigned
> issues however (once a week on average)
>
> Did you file all your previous patches in JIRA?

No, due to the same concept above and also due to the fact I had trouble
with creating clean patches against the current HEAD.

>
[snip]



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


Re: HttpUtils leaves .incomplete files around

Posted by Ben Walding <de...@walding.com>.
Also, once it's a confirmed bug, please file it in JIRA.

My memory of what occurred on the list is limited to about 12hrs when I 
purge it all.  I regularly go through and look at all the unassigned 
issues however (once a week on average)

Did you file all your previous patches in JIRA?

Florin Vancea wrote:

>I did a little digging around and here is what I found:
>
>The rename fails because the particular SNAPSHOT.jar is already added to the
>classpath at the time of the "refresh".
>Just before downloading the dependency, the DependencyVerifier(271) code
>wants to tell us it's loading the file.
>For that it uses finally MavenUtils.loadMessages() which scans (and
>apparently locks) all the jars in the classpath, _including_ the one we want
>to fresh-bring-in. Which prevents finally bringing in the newest version, as
>I outlined below.
>
>Florin
>
>----- Original Message -----
>From: "Florin Vancea" <fv...@maxiq.ro>
>To: "Maven Developers List" <de...@maven.apache.org>
>Sent: Tuesday, April 22, 2003 8:49 AM
>Subject: HttpUtils leaves .incomplete files around
>
>
>  
>
>>In HttpUtils.java, line 165 in HEAD (or at least very recent) says:
>>
>>        tempFile.renameTo(destinationFile);
>>
>>Well, the rename is OK, as far as there's nothing there with that target
>>name. On W2k (and I guess on other platforms, too) renaming here fails,
>>particularly when getting the second time a SNAPSHOT jar.
>>
>>Because the rename fails to overwrite the existing SNAPSHOT.jar, the
>>latest-and-greatest is stuck with the status of ".incomplete" and never
>>makes it to the project itself. I think this may create weird problems and
>>it should be taken care of.
>>
>><offtopic>
>>I would try to offer patches for trivial things like that, instead of
>>    
>>
>merely
>  
>
>>pointing at them.
>>However, my previous attempts to offer a solution along with the problem
>>(yes, I admit, clumsy ones) were completely ignored. Therefore I will only
>>signal to whoever is interested the bugs/"features" I've found and maybe
>>someone will take care of them. At least until someone authoritative
>>    
>>
>shoves
>  
>
>>me off to the user list where I probably belong, whining like this.
>></offtopic>
>>
>>Sorry for intruding,
>>Florin
>>
>>
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
>>For additional commands, e-mail: dev-help@maven.apache.org
>>
>>
>>    
>>
>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
>For additional commands, e-mail: dev-help@maven.apache.org
>
>
>  
>



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


Re: HttpUtils leaves .incomplete files around

Posted by Florin Vancea <fv...@maxiq.ro>.
I did a little digging around and here is what I found:

The rename fails because the particular SNAPSHOT.jar is already added to the
classpath at the time of the "refresh".
Just before downloading the dependency, the DependencyVerifier(271) code
wants to tell us it's loading the file.
For that it uses finally MavenUtils.loadMessages() which scans (and
apparently locks) all the jars in the classpath, _including_ the one we want
to fresh-bring-in. Which prevents finally bringing in the newest version, as
I outlined below.

Florin

----- Original Message -----
From: "Florin Vancea" <fv...@maxiq.ro>
To: "Maven Developers List" <de...@maven.apache.org>
Sent: Tuesday, April 22, 2003 8:49 AM
Subject: HttpUtils leaves .incomplete files around


> In HttpUtils.java, line 165 in HEAD (or at least very recent) says:
>
>         tempFile.renameTo(destinationFile);
>
> Well, the rename is OK, as far as there's nothing there with that target
> name. On W2k (and I guess on other platforms, too) renaming here fails,
> particularly when getting the second time a SNAPSHOT jar.
>
> Because the rename fails to overwrite the existing SNAPSHOT.jar, the
> latest-and-greatest is stuck with the status of ".incomplete" and never
> makes it to the project itself. I think this may create weird problems and
> it should be taken care of.
>
> <offtopic>
> I would try to offer patches for trivial things like that, instead of
merely
> pointing at them.
> However, my previous attempts to offer a solution along with the problem
> (yes, I admit, clumsy ones) were completely ignored. Therefore I will only
> signal to whoever is interested the bugs/"features" I've found and maybe
> someone will take care of them. At least until someone authoritative
shoves
> me off to the user list where I probably belong, whining like this.
> </offtopic>
>
> Sorry for intruding,
> Florin
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org
>
>



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


Re: HttpUtils leaves .incomplete files around

Posted by di...@multitask.com.au.
"Florin Vancea" <fv...@maxiq.ro> wrote on 22/04/2003 03:49:01 PM:

> In HttpUtils.java, line 165 in HEAD (or at least very recent) says:
> 
>         tempFile.renameTo(destinationFile);
> 
> Well, the rename is OK, as far as there's nothing there with that target
> name. On W2k (and I guess on other platforms, too) renaming here fails,
> particularly when getting the second time a SNAPSHOT jar.
> 
> Because the rename fails to overwrite the existing SNAPSHOT.jar, the
> latest-and-greatest is stuck with the status of ".incomplete" and never
> makes it to the project itself. I think this may create weird problems 
and
> it should be taken care of.

Thanks for the bug report.

> <offtopic>
> I would try to offer patches for trivial things like that, instead of 
merely
> pointing at them.
> However, my previous attempts to offer a solution along with the problem
> (yes, I admit, clumsy ones) were completely ignored. Therefore I will 
only
> signal to whoever is interested the bugs/"features" I've found and maybe
> someone will take care of them. At least until someone authoritative 
shoves
> me off to the user list where I probably belong, whining like this.
> </offtopic>
Chances are you're not being "completely ignored". It's just we all have 
limited time to do work on Maven, and often a bug fix is missed, unless 
it's listed in the bug tracking system, jira.

If you ask again on the lists for someone to apply a patch, usually 
picking the one developer to have a conversation with, such as myself, or 
Ben, emanuelle, jt, bob etc, they'll get the job done.
--
dIon Gillard, Multitask Consulting
Blog:      http://www.freeroller.net/page/dion/Weblog
Work:      http://www.multitask.com.au



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org