You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@wicket.apache.org by cwilkes <cw...@ladro.com> on 2007/08/28 16:27:42 UTC

Does FileCleaner.destroy stop the reaper thread?

I'm having a problem reloading my wicket application only when running on
Windows (this doesn't happen on my Mac).  From what I can tell it looks like
the problem lies in FileCleaner.  When hot deploying (that is, copying a new
war file over the existing war file) Tomcat's output hangs with "Deploying
web application archive yourapp.war"

Pressing control-break shows the thread dump with this is at the top:

"File Reaper" daemon prio=10 tid=0x0340d248 nid=0xafc in Object.wait()
[0x043cf000..0x043cfae8]
        at java.lang.Object.wait(Native Method)
        - waiting on <0x25db6740> (a java.lang.ref.ReferenceQueue$Lock)
        at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:116)
        - locked <0x25db6740> (a java.lang.ref.ReferenceQueue$Lock)
        at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:132)
        at
org.apache.wicket.util.file.FileCleaner$1.run(FileCleaner.java:61)


That line in wicket 1.3-beta2 is "q.remove()" where q is the ReferenceQueue. 
What I think is happening is that the reaper thread is being interrupted via
the destroy() method and that exception is caught and ignored -- instead the
reaper thread's run() method should exit.

Thoughts?
-- 
View this message in context: http://www.nabble.com/Does-FileCleaner.destroy-stop-the-reaper-thread--tf4342035.html#a12368920
Sent from the Wicket - Dev mailing list archive at Nabble.com.


Re: Does FileCleaner.destroy stop the reaper thread?

Posted by Igor Vaynberg <ig...@gmail.com>.
no need, i already committed it into trunk

-igor


On 8/28/07, cwilkes <cw...@ladro.com> wrote:
>
>
> Yep, that gets past FileCleaner's reaper thread not being shut
> down.  Should
> I create a JIRA entry for this?   I only see the destroy() method called
> in
> the WebApplication.internalDestroy() method so it is probably safe to do.
>
> I'm on to another problem with Tomcat (5.5.23 on Windows) still hanging
> after that change.  I don't see a wicket or my own class mentioned in the
> thread dump so it is something with tomcat.
>
> Chris
>
>
> igor.vaynberg wrote:
> >
> > try
> >                 {
> >                     // Wait for a tracker to remove.
> >                     tracker = (Tracker)q.remove();
> >                 }
> >                 catch (InterruptedException e) <=== added lines
> >                 {                                           <=== added
> > lines
> >                     break;                               <=== added
> lines
> >                 }                                           <=== added
> > lines
> >                 catch (Exception e)
> >                 {
> >                     continue;
> >                 }
> >
> >
> > let me know if that helps
> >
> > -igor
> >
> > On 8/28/07, cwilkes <cw...@ladro.com> wrote:
> >>
> >>
> >> I'm having a problem reloading my wicket application only when running
> on
> >> Windows (this doesn't happen on my Mac).  From what I can tell it looks
> >> like
> >> the problem lies in FileCleaner.  When hot deploying (that is, copying
> a
> >> new
> >> war file over the existing war file) Tomcat's output hangs with
> >> "Deploying
> >> web application archive yourapp.war"
> >>
> >
> --
> View this message in context:
> http://www.nabble.com/Does-FileCleaner.destroy-stop-the-reaper-thread--tf4342035.html#a12372337
> Sent from the Wicket - Dev mailing list archive at Nabble.com.
>
>

Re: Does FileCleaner.destroy stop the reaper thread?

Posted by cwilkes <cw...@ladro.com>.
Hot deploying with tomcat on windows now works if I sent
"antiResourceLocking" to true in my context.xml :
  http://tomcat.apache.org/tomcat-5.5-doc/config/context.html
if I don't set that and copy in a new war file the old one isn't fully
removed, leaving only the 2 wicket jars in my WEB-INF/lib directory.

What antiResourceLocking does:
If true, Tomcat will prevent any file locking. This will significantly
impact startup time of applications, but allows full webapp hot deploy and
undeploy on platforms or configurations where file locking can occur. If not
specified, the default value is false.

Unfortunately I can't tell from JMX / thread dumps what is causing the file
locking (if indeed that is the problem).

Chris


cwilkes wrote:
> 
> Yep, that gets past FileCleaner's reaper thread not being shut down. 
> Should I create a JIRA entry for this?   I only see the destroy() method
> called in the WebApplication.internalDestroy() method so it is probably
> safe to do.
> 
> I'm on to another problem with Tomcat (5.5.23 on Windows) still hanging
> after that change.  I don't see a wic
> 

-- 
View this message in context: http://www.nabble.com/Does-FileCleaner.destroy-stop-the-reaper-thread--tf4342035.html#a12375374
Sent from the Wicket - Dev mailing list archive at Nabble.com.


Re: Does FileCleaner.destroy stop the reaper thread?

Posted by cwilkes <cw...@ladro.com>.
Yep, that gets past FileCleaner's reaper thread not being shut down.  Should
I create a JIRA entry for this?   I only see the destroy() method called in
the WebApplication.internalDestroy() method so it is probably safe to do.

I'm on to another problem with Tomcat (5.5.23 on Windows) still hanging
after that change.  I don't see a wicket or my own class mentioned in the
thread dump so it is something with tomcat.

Chris


igor.vaynberg wrote:
> 
> try
>                 {
>                     // Wait for a tracker to remove.
>                     tracker = (Tracker)q.remove();
>                 }
>                 catch (InterruptedException e) <=== added lines
>                 {                                           <=== added
> lines
>                     break;                               <=== added lines
>                 }                                           <=== added
> lines
>                 catch (Exception e)
>                 {
>                     continue;
>                 }
> 
> 
> let me know if that helps
> 
> -igor
> 
> On 8/28/07, cwilkes <cw...@ladro.com> wrote:
>>
>>
>> I'm having a problem reloading my wicket application only when running on
>> Windows (this doesn't happen on my Mac).  From what I can tell it looks
>> like
>> the problem lies in FileCleaner.  When hot deploying (that is, copying a
>> new
>> war file over the existing war file) Tomcat's output hangs with
>> "Deploying
>> web application archive yourapp.war"
>>
> 
-- 
View this message in context: http://www.nabble.com/Does-FileCleaner.destroy-stop-the-reaper-thread--tf4342035.html#a12372337
Sent from the Wicket - Dev mailing list archive at Nabble.com.


Re: Does FileCleaner.destroy stop the reaper thread?

Posted by Igor Vaynberg <ig...@gmail.com>.
try
                {
                    // Wait for a tracker to remove.
                    tracker = (Tracker)q.remove();
                }
                catch (InterruptedException e) <=== added lines
                {                                           <=== added lines
                    break;                               <=== added lines
                }                                           <=== added lines
                catch (Exception e)
                {
                    continue;
                }


let me know if that helps

-igor

On 8/28/07, cwilkes <cw...@ladro.com> wrote:
>
>
> I'm having a problem reloading my wicket application only when running on
> Windows (this doesn't happen on my Mac).  From what I can tell it looks
> like
> the problem lies in FileCleaner.  When hot deploying (that is, copying a
> new
> war file over the existing war file) Tomcat's output hangs with "Deploying
> web application archive yourapp.war"
>
> Pressing control-break shows the thread dump with this is at the top:
>
> "File Reaper" daemon prio=10 tid=0x0340d248 nid=0xafc in Object.wait()
> [0x043cf000..0x043cfae8]
>         at java.lang.Object.wait(Native Method)
>         - waiting on <0x25db6740> (a java.lang.ref.ReferenceQueue$Lock)
>         at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:116)
>         - locked <0x25db6740> (a java.lang.ref.ReferenceQueue$Lock)
>         at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:132)
>         at
> org.apache.wicket.util.file.FileCleaner$1.run(FileCleaner.java:61)
>
>
> That line in wicket 1.3-beta2 is "q.remove()" where q is the
> ReferenceQueue.
> What I think is happening is that the reaper thread is being interrupted
> via
> the destroy() method and that exception is caught and ignored -- instead
> the
> reaper thread's run() method should exit.
>
> Thoughts?
> --
> View this message in context:
> http://www.nabble.com/Does-FileCleaner.destroy-stop-the-reaper-thread--tf4342035.html#a12368920
> Sent from the Wicket - Dev mailing list archive at Nabble.com.
>
>