You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@lucene.apache.org by Tony Qian <to...@hotmail.com> on 2007/09/04 21:45:40 UTC

open file descriptors for deleted index files

All,

I'm facing an issue in which the file descriptors are not closed for deleted 
index files. I searched mailing list and didn't find the solution. Here is 
some info:

java      21488     wppd  139r      REG        8,7 152456865     571208 
/data/index/_idx.cfs (deleted)
java      21488     wppd  140r      REG        8,7 152501356     571211 
/data/index/_idz.cfs (deleted)
java      21488     wppd  141r      REG        8,7 152516369     571210 
/data/index/_ie1.cfs (deleted)
java      21488     wppd  142r      REG        8,7 152543537     571213 
/data/index/_ie3.cfs (deleted)
java      21488     wppd  143r      REG        8,7 152555274     571212 
/data/index/_ie5.cfs (deleted)
java      21488     wppd  144r      REG        8,7 152593068     571215 
/data/index/_ie7.cfs (deleted)
java      21488     wppd  145r      REG        8,7 152625253     571214 
/data/index/_ie9.cfs (deleted)

We run a servlet inside Tomcat. We transfer index files to search server 
every 5 minutes using rsync with --delete option. Also, we schedule a 
TimeTask inside servlet to check if index files are updated. If yes, create 
a new IndexSearcher object and assign it to searcher (IndexSearcher). I hope 
JVM will GC old IndexSearcher object along with file descriptors.

Will closing old IndexSearcher solve this problem? The concern I have by 
closing old IndexSearcher is that the client will get exception if client is 
using old IndexSearcher object.

Thanks for help.
Tony

_________________________________________________________________
Share your special parenting moments! 
http://www.reallivemoms.com?ocid=TXT_TAGHM&loc=us


---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Re: open file descriptors for deleted index files

Posted by Yonik Seeley <yo...@apache.org>.
On 9/4/07, Tony Qian <to...@hotmail.com> wrote:
> We run a servlet inside Tomcat. We transfer index files to search server
> every 5 minutes using rsync with --delete option. Also, we schedule a
> TimeTask inside servlet to check if index files are updated. If yes, create
> a new IndexSearcher object and assign it to searcher (IndexSearcher). I hope
> JVM will GC old IndexSearcher object along with file descriptors.
>
> Will closing old IndexSearcher solve this problem?

Yes... you can't really rely on GC to close open file descriptors (or
for GC to be called when descriptors are running low)

> The concern I have by
> closing old IndexSearcher is that the client will get exception if client is
> using old IndexSearcher object.

Solr uses reference counting to solve this problem.

-Yonik

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Re: open file descriptors for deleted index files

Posted by Bill Au <bi...@gmail.com>.
Closing old IndexSearcher should take care of this problem for you.  Take a
look at Solr.
It opens a new IndexSearcher and direct all requests to the new one.  It
then closes the old
IndexSearcher when all the requests that it is serving has completed.

Bill

On 9/4/07, Tony Qian <to...@hotmail.com> wrote:
>
> All,
>
> I'm facing an issue in which the file descriptors are not closed for
> deleted
> index files. I searched mailing list and didn't find the solution. Here is
> some info:
>
> java      21488     wppd  139r      REG        8,7 152456865     571208
> /data/index/_idx.cfs (deleted)
> java      21488     wppd  140r      REG        8,7 152501356     571211
> /data/index/_idz.cfs (deleted)
> java      21488     wppd  141r      REG        8,7 152516369     571210
> /data/index/_ie1.cfs (deleted)
> java      21488     wppd  142r      REG        8,7 152543537     571213
> /data/index/_ie3.cfs (deleted)
> java      21488     wppd  143r      REG        8,7 152555274     571212
> /data/index/_ie5.cfs (deleted)
> java      21488     wppd  144r      REG        8,7 152593068     571215
> /data/index/_ie7.cfs (deleted)
> java      21488     wppd  145r      REG        8,7 152625253     571214
> /data/index/_ie9.cfs (deleted)
>
> We run a servlet inside Tomcat. We transfer index files to search server
> every 5 minutes using rsync with --delete option. Also, we schedule a
> TimeTask inside servlet to check if index files are updated. If yes,
> create
> a new IndexSearcher object and assign it to searcher (IndexSearcher). I
> hope
> JVM will GC old IndexSearcher object along with file descriptors.
>
> Will closing old IndexSearcher solve this problem? The concern I have by
> closing old IndexSearcher is that the client will get exception if client
> is
> using old IndexSearcher object.
>
> Thanks for help.
> Tony
>
> _________________________________________________________________
> Share your special parenting moments!
> http://www.reallivemoms.com?ocid=TXT_TAGHM&loc=us
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org
>
>