Hi all, I''ve got a slight problem with using Ferret in unit tests. In order to create as little cross-contamination between test suites as possible, some of my tests are creating a fresh index per test case, and then calling Index#close and deleting the containing dir during the teardown. The problem comes when GC.start kicks in after the deleting the directory: IOError: IO Error occured at <except.c>:79 in xraise Error occured in fs_store.c:146 - fs_clear_locks clearing locks in persistence_path/00000000001: <No such file or directory> The persistence_path/ directory is the one that was File.rm_r''d. How can I stop this from happening? Is it a bug, or have I messed something up? This worked with 0.9.5, but doesn''t now that I''ve updated to 0.10.6. Any clues? -- Alex
On 9/22/06, Alex Young <alex at blackkettle.org> wrote:> Hi all, > > I''ve got a slight problem with using Ferret in unit tests. In order to > create as little cross-contamination between test suites as possible, > some of my tests are creating a fresh index per test case, and then > calling Index#close and deleting the containing dir during the teardown. > The problem comes when GC.start kicks in after the deleting the directory: > > IOError: IO Error occured at <except.c>:79 in xraise > Error occured in fs_store.c:146 - fs_clear_locks > clearing locks in persistence_path/00000000001: <No such file > or directory> > > The persistence_path/ directory is the one that was File.rm_r''d. How > can I stop this from happening? Is it a bug, or have I messed something > up? This worked with 0.9.5, but doesn''t now that I''ve updated to > 0.10.6. Any clues? > > -- > Alex >Hi Alex, This is a bug which I''m fixing right now. If you open any FSDirectories then you must close them too before you rm_f the index dir. Unfortunately FSDirectory#close doesn''t currently work and the Index class doesn''t call it either so try 0.10.7 when I release it. Cheers, Dave
David Balmain wrote:> On 9/22/06, Alex Young <alex at blackkettle.org> wrote: >> Hi all, >> >> I''ve got a slight problem with using Ferret in unit tests. In order to >> create as little cross-contamination between test suites as possible, >> some of my tests are creating a fresh index per test case, and then >> calling Index#close and deleting the containing dir during the teardown. >> The problem comes when GC.start kicks in after the deleting the directory: >> >> IOError: IO Error occured at <except.c>:79 in xraise >> Error occured in fs_store.c:146 - fs_clear_locks >> clearing locks in persistence_path/00000000001: <No such file >> or directory> >> >> The persistence_path/ directory is the one that was File.rm_r''d. How >> can I stop this from happening? Is it a bug, or have I messed something >> up? This worked with 0.9.5, but doesn''t now that I''ve updated to >> 0.10.6. Any clues? >> >> -- >> Alex >> > > Hi Alex, > > This is a bug which I''m fixing right now. If you open any > FSDirectories then you must close them too before you rm_f the index > dir. Unfortunately FSDirectory#close doesn''t currently work and the > Index class doesn''t call it either so try 0.10.7 when I release it.Ah, ok. It''s not actually affecting live code, it just makes a mess of my tests as it stands. Keep up the good work :-) -- Alex
Has this been resolved? I''m still getting this problem on the latest Ferret. Is there any way around this problem? Thanks Ray Alex Young wrote:> David Balmain wrote: >>> Error occured in fs_store.c:146 - fs_clear_locks >>> >> >> Hi Alex, >> >> This is a bug which I''m fixing right now. If you open any >> FSDirectories then you must close them too before you rm_f the index >> dir. Unfortunately FSDirectory#close doesn''t currently work and the >> Index class doesn''t call it either so try 0.10.7 when I release it. > > Ah, ok. It''s not actually affecting live code, it just makes a mess of > my tests as it stands. > > Keep up the good work :-)-- Posted via http://www.ruby-forum.com/.
On 2/23/07, Raymond O''connor <nappin713 at yahoo.com> wrote:> Has this been resolved? I''m still getting this problem on the latest > Ferret. Is there any way around this problem? > > Thanks RayHi Ray, This problem (below) has been fixed in the current working copy of Ferret. I would still recommend explicitly closing your index and creating a new index. Deleting the directory shouldn''t be necessary but if will be safe to do it in the next release. Cheers, Dave> > Alex Young wrote: > > David Balmain wrote: > >>> Error occured in fs_store.c:146 - fs_clear_locks > >>> > >> > >> Hi Alex, > >> > >> This is a bug which I''m fixing right now. If you open any > >> FSDirectories then you must close them too before you rm_f the index > >> dir. Unfortunately FSDirectory#close doesn''t currently work and the > >> Index class doesn''t call it either so try 0.10.7 when I release it. > > > > Ah, ok. It''s not actually affecting live code, it just makes a mess of > > my tests as it stands. > > > > Keep up the good work :-) > > > -- > Posted via http://www.ruby-forum.com/. > _______________________________________________ > Ferret-talk mailing list > Ferret-talk at rubyforge.org > http://rubyforge.org/mailman/listinfo/ferret-talk >-- Dave Balmain http://www.davebalmain.com/