[Xapian-tickets] [Xapian] #739: Expose a lazy Xapian::Document() attached to a database

Xapian nobody at xapian.org
Wed Dec 14 05:52:32 GMT 2016


#739: Expose a lazy Xapian::Document() attached to a database
-------------------------+--------------------------
 Reporter:  Kronuz       |             Owner:  olly
     Type:  enhancement  |            Status:  new
 Priority:  normal       |         Milestone:  1.4.2
Component:  Other        |           Version:
 Severity:  normal       |        Resolution:
 Keywords:               |        Blocked By:
 Blocking:               |  Operating System:  All
-------------------------+--------------------------

Comment (by olly):

 Trying to implement this, I found one slightly awkward issue.

 Currently the backend can just assume that the Document object's docid is
 valid, but with a lazily created document it can't.

 I can see two options:

  * We record that the docid hasn't been vetted, and check before first use
 - essentially validate the docid lazily.  This doesn't seem to gain much -
 if you routinely create `Document` objects you don't use, that seems
 better solved at a higher level.  I guess maybe it's useful to delay the
 potential I/O, but that seems a stretch.
  * We say that's undefined behaviour.  But that means you can get
 segfaults and the like via innocent looking code in scripting languages
 via the bindings, which is nasty.

 I guess you know for sure that the docid is valid, so lazy vetting isn't
 useful for your case.

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



More information about the Xapian-tickets mailing list