java.io.IOException: Lock obtain timed out: Lock@/tmp/lucene-dcc982e203ef1d2aebb5d8a4b55b3a60-write.lock

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

java.io.IOException: Lock obtain timed out: Lock@/tmp/lucene-dcc982e203ef1d2aebb5d8a4b55b3a60-write.lock

Puneet Lakhina
Hi all,
I am very new to lucene. I am using it in my application to index and serach
through text files. And my program is more or less similar to the demo
privided with lucene distribution.
Initially everything was working fine without any problems. But today while
running the application i have been getting this exception

java.io.IOException: Lock obtain timed out: Lock@/tmp/lucene-
dcc982e203ef1d2aebb5d8a4b55b3a60-write.lock

whever i try to read or write to the index. I am unable to understand why
this is happening. IS there some mistake I am making in the code.. because I
havent changed any code, which was working smoothly up until today!!!

My version of lucene is 1.9.1

I deleted the index directory and tried again and voila now it works again!!
But if I am going to be delivering my application I would really like to
know why this was happening to guard against it..

Thanks
--
Puneet
Reply | Threaded
Open this post in threaded view
|

Re: java.io.IOException: Lock obtain timed out: Lock@/tmp/lucene-dcc982e203ef1d2aebb5d8a4b55b3a60-write.lock

Raghavendra Prabhu
You are creating two IndexWriters on the same directory

I guess that is the reason for the problem and one holds the lock

Rgds
Prabhu


On 4/15/06, Puneet Lakhina <[hidden email]> wrote:

>
> Hi all,
> I am very new to lucene. I am using it in my application to index and
> serach
> through text files. And my program is more or less similar to the demo
> privided with lucene distribution.
> Initially everything was working fine without any problems. But today
> while
> running the application i have been getting this exception
>
> java.io.IOException: Lock obtain timed out: Lock@/tmp/lucene-
> dcc982e203ef1d2aebb5d8a4b55b3a60-write.lock
>
> whever i try to read or write to the index. I am unable to understand why
> this is happening. IS there some mistake I am making in the code.. because
> I
> havent changed any code, which was working smoothly up until today!!!
>
> My version of lucene is 1.9.1
>
> I deleted the index directory and tried again and voila now it works
> again!!
> But if I am going to be delivering my application I would really like to
> know why this was happening to guard against it..
>
> Thanks
> --
> Puneet
>
>
Reply | Threaded
Open this post in threaded view
|

Re: java.io.IOException: Lock obtain timed out: Lock@/tmp/lucene-dcc982e203ef1d2aebb5d8a4b55b3a60-write.lock

Karl Wettin-3
Could it just be that the application was not shut down properly? If  
you dare, check for locks and remove them when you start your  
application.

Note that both IndexReader and IndexWriter can produce a write-lock.

15 apr 2006 kl. 18.56 skrev Raghavendra Prabhu:

> You are creating two IndexWriters on the same directory
>
> I guess that is the reason for the problem and one holds the lock
>
> Rgds
> Prabhu
>
>
> On 4/15/06, Puneet Lakhina <[hidden email]> wrote:
>>
>> Hi all,
>> I am very new to lucene. I am using it in my application to index and
>> serach
>> through text files. And my program is more or less similar to the  
>> demo
>> privided with lucene distribution.
>> Initially everything was working fine without any problems. But today
>> while
>> running the application i have been getting this exception
>>
>> java.io.IOException: Lock obtain timed out: Lock@/tmp/lucene-
>> dcc982e203ef1d2aebb5d8a4b55b3a60-write.lock
>>
>> whever i try to read or write to the index. I am unable to  
>> understand why
>> this is happening. IS there some mistake I am making in the code..  
>> because
>> I
>> havent changed any code, which was working smoothly up until today!!!
>>
>> My version of lucene is 1.9.1
>>
>> I deleted the index directory and tried again and voila now it works
>> again!!
>> But if I am going to be delivering my application I would really  
>> like to
>> know why this was happening to guard against it..
>>
>> Thanks
>> --
>> Puneet
>>
>>


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: java.io.IOException: Lock obtain timed out: Lock@/tmp/lucene-dcc982e203ef1d2aebb5d8a4b55b3a60-write.lock

Raghavendra Prabhu
Deleting the lock file when you startup the application sounds like a
workaround to the issue.

But still then lucene should have removed it if the close operations for
both the IndexReader and IndexWriter had been called properly

As karl wettin said maybe the application is not closed properly leading to
persistence of lock files

Rgds
PRabhu


On 4/15/06, karl wettin <[hidden email]> wrote:

>
> Could it just be that the application was not shut down properly? If
> you dare, check for locks and remove them when you start your
> application.
>
> Note that both IndexReader and IndexWriter can produce a write-lock.
>
> 15 apr 2006 kl. 18.56 skrev Raghavendra Prabhu:
>
> > You are creating two IndexWriters on the same directory
> >
> > I guess that is the reason for the problem and one holds the lock
> >
> > Rgds
> > Prabhu
> >
> >
> > On 4/15/06, Puneet Lakhina <[hidden email]> wrote:
> >>
> >> Hi all,
> >> I am very new to lucene. I am using it in my application to index and
> >> serach
> >> through text files. And my program is more or less similar to the
> >> demo
> >> privided with lucene distribution.
> >> Initially everything was working fine without any problems. But today
> >> while
> >> running the application i have been getting this exception
> >>
> >> java.io.IOException: Lock obtain timed out: Lock@/tmp/lucene-
> >> dcc982e203ef1d2aebb5d8a4b55b3a60-write.lock
> >>
> >> whever i try to read or write to the index. I am unable to
> >> understand why
> >> this is happening. IS there some mistake I am making in the code..
> >> because
> >> I
> >> havent changed any code, which was working smoothly up until today!!!
> >>
> >> My version of lucene is 1.9.1
> >>
> >> I deleted the index directory and tried again and voila now it works
> >> again!!
> >> But if I am going to be delivering my application I would really
> >> like to
> >> know why this was happening to guard against it..
> >>
> >> Thanks
> >> --
> >> Puneet
> >>
> >>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>