incubator-lucy-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From goran kent <gorank...@gmail.com>
Subject [lucy-user] Re: Remote SearchServer and PolySearcher(SearchClient) usage
Date Tue, 01 Nov 2011 08:36:22 GMT
Morning,

Providing some more debug info...

I've added some prints to see what's happening in the SearchServer.pm code:

Within the serve() routine while/for loop:

    chomp( $method = <$client_sock> );
+   print "DEBUG: method:[$method]\n";
...
     elsif ( !$dispatch{$method} ) {
+                    print "ERROR: Bad method name: $method\n";
                    print $client_sock "ERROR: Bad method name: $method\n";

I patched the SearchClient code similarly.

And I requested a single result via SearchClient.

The client sends the final 'fetch_doc' method, gets the answer
correctly, and quits.

DEBUG: sending [doc_max] len:11
DEBUG: received [HASH(0x893b398)]
DEBUG: sending [doc_freq] len:37
... repeat similar lines ...
DEBUG: sending [top_docs] len:6942
DEBUG: received [HASH(0x9635d5c)]
...
DEBUG: sending [fetch_doc] len:26
DEBUG: received [HASH(0x95dd308)]
... results displayed as normal ...


My SearchServer script dies as follows:

DEBUG: method:[doc_max]
DEBUG: method:[doc_freq]
... repeat last 31 times ...
DEBUG: method:[top_docs]
DEBUG: method:[fetch_doc]   <---------- so far so good.
... then fails ...
Use of uninitialized value in chomp at
/usr/lib64/perl5/site_perl/5.8.8/x86_64-linux-thread-multi/LucyX/Remote/SearchServer.pm
line 105, <GEN2> line 35.
Use of uninitialized value in concatenation (.) or string at
/usr/lib64/perl5/site_perl/5.8.8/x86_64-linux-thread-multi/LucyX/Remote/SearchServer.pm
line 107, <GEN2> line 35.
DEBUG: method:[]


/////////////////////////////////////////////
// more hacking follows
// time passes...
////////////////////////////////////////////

Solved, LucyX::Remote::SearchClient->close is not being called on
client script end.  Therefore the 'done' method is never sent to the
remote SearchServer, so it doesn't know that the current search
session has ended.

I ended my script with (unelegantly):

foreach my $remote (@searcher) {
    $remote->close;
}

and the problem went away.  The SearchServer now stays in it's loop
without error:

DEBUG: method:[fetch_doc]
DEBUG: method:[done]

You may want to pop something in the docs for
LucyX::Remote::SearchClient about the need to close remote sessions,
or have garbage collection close those sessions.

ciao

Mime
View raw message