[Xapian-tickets] [Xapian] #758: Test behaviour on remote backend errors

Xapian nobody at xapian.org
Fri Apr 20 01:10:45 BST 2018


#758: Test behaviour on remote backend errors
--------------------------+-------------------------------
 Reporter:  olly          |             Owner:  olly
     Type:  defect        |            Status:  new
 Priority:  normal        |         Milestone:
Component:  Test Suite    |           Version:  git master
 Severity:  normal        |        Resolution:
 Keywords:  GoodFirstBug  |        Blocked By:
 Blocking:                |  Operating System:  All
--------------------------+-------------------------------

Comment (by olly):

 > Initially, I thought pid_to_fd will contain the pid of the server for
 the entire duration of test run, but later found out it gets cleaned up
 once child signals the parent.

 It's really once the OS signals to the parent that the child process has
 terminated (the child doesn't signal this to parent - the child process no
 longer exists at that point).

 If we didn't clean out entries for processes which have gone we'd need a
 much larger fixed sized array, and linearly scanning it to find entries
 would probably be problematic.  A dynamic data structure doesn't work well
 here as we're inside the memory leak checking that's wrapped around the
 running of each testcase.  But a fixed size array for just the live
 servers can be much smaller, and doesn't need enlarging just because more
 testcases have been added.

 > Where should these tests go(api_closedb.cc or other)?

 `api_closedb.cc` seems reasonable - it's not too large yet and these tests
 are related.

 > I want to show the interface used by apitest. Please comment on that and
 suggest if you have better way.

 It would be better if we could kill just the remote server corresponding
 to a particular database.  Killing all running remote databases would be a
 real problem if we move to a multi-threaded test harness, which is
 something that would be good to be able to do so the tests can be run
 faster.

 Also it would allow testing more cases - for example, searching two remote
 databases together and then one of them dies but the other still works
 (which simulates failure of one node in a distributed sharded system).

 This needs a way to map from a database to the server process to kill.
 Not sure how best to allow that.  Possibly there needs to be an opaque (to
 the testcase) token which a testcase can get when it opens a database it
 will want to kill later.  That token could just be the index into
 `pid_to_fd`.

--
Ticket URL: <https://trac.xapian.org/ticket/758#comment:4>
Xapian <https://xapian.org/>
Xapian



More information about the Xapian-tickets mailing list