• Do not register here on develop.twiki.org, login with your twiki.org account.
• Use View topic Item7848 for generic doc work for TWiki-6.1.1. Use View topic Item7851 for doc work on extensions that are not part of a release. More... Close
• Anything you create or change in standard webs (Main, TWiki, Sandbox etc) will be automatically reverted on every SVN update.
Does this site look broken?. Use the LitterTray web for test cases.

Item4692: Forking search algorithm throws error if topic is nonexistent

Item Form Data

AppliesTo: Component: Priority: CurrentState: WaitingFor: TargetRelease ReleasedIn
Engine Forking.pm Urgent Closed   minor  

Edit Form Data

Summary:
Reported By:
Codebase:
Applies To:
Component:
Priority:
Current State:
Waiting For:
Target Release:
Released In:
 

Detail

Example

Do a search like
%SEARCH{ "Test" web="%WEB%" topic="SomeNonExistentPage" }%
with the TWiki::Store::SearchAlgorithms::Forking algorithm. In the "rendered" page you get an error of the form
 Could not perform search. Error was: /bin/grep -F -i -l -H -- %TOKEN|U% %FILES|F% Grep for 'Test' returned error

If you choose some e.g. TWiki::Store::SearchAlgorithms::PurePerl as your search algo, you get no errors (and no hits, of course).

Reason

Taking a look at Forking.pm, you can see
throw Error::Simple("$program Grep for '$searchString' returned error")
  if $exit > 1;
But grep's return error code is 2, because the topic cannot be found.

This behaviour is new to 4.2 and differs from 4.1.2.

-- TWiki:Main/ChristianLudwig - 21 Sep 2007

Flip side of this, is that perhaps TWiki should not be calling grep on topics that don't exist - as each fork of a process is slow.

Good find!

-- TWiki:Main.SvenDowideit - 21 Sep 2007

I changed the grep command from /bin/egrep to /bin/grep -E for consistency with Windows. Looks like it may have been a bad move frown

A testcase is required for this.

-- TWiki:Main.CrawfordCurrie - 22 Sep 2007

Fixed

CC

ItemTemplate
Summary Forking search algorithm throws error if topic is nonexistent
ReportedBy TWiki:Main.ChristianLudwig
Codebase 4.2.0, ~twiki4
SVN Range TWiki-4.3.0, Thu, 20 Sep 2007, build 14972
AppliesTo Engine
Component Forking.pm
Priority Urgent
CurrentState Closed
WaitingFor

Checkins TWikirev:14998 TWikirev:14999
TargetRelease minor
ReleasedIn

Edit | Attach | Watch | Print version | History: r9 < r8 < r7 < r6 < r5 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r9 - 2008-01-22 - KennethLavrsen
 
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2019 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback