incubator-lucy-user mailing list archives

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

Providing some more debug info...

I've added some prints to see what's happening in the 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
line 105, <GEN2> line 35.
Use of uninitialized value in concatenation (.) or string at
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) {

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.


View raw message