[Xapian-tickets] [Xapian] #781: Sockets never closed on RemoteDatabase errors

Xapian nobody at xapian.org
Tue Apr 30 06:24:53 BST 2019


#781: Sockets never closed on RemoteDatabase errors
----------------------------+-------------------------
 Reporter:  Kronuz          |             Owner:  olly
     Type:  defect          |            Status:  new
 Priority:  high            |         Milestone:
Component:  Backend-Remote  |           Version:
 Severity:  blocker         |        Resolution:
 Keywords:                  |        Blocked By:
 Blocking:                  |  Operating System:  All
----------------------------+-------------------------

Comment (by olly):

 It occurs to me that if there was a variant of `RemoteConnection` which
 owned its fds and was responsible for closing them then this would be a
 non-problem (because the `link` object's destructor should get called even
 if the `RemoteDatabase` object's constructor hasn't completed).

 Looking at `remoteconnection.cc`, the current semantics of the ownership
 of these fds is a little murky - the `RemoteConnection` object only closes
 them if explicitly asked to, except that if its `read_at_least()` method
 gets a zero-size read indicating EOF then it calls `do_close(false)`.
 That seems buggy as if the parent then tries to close those fds they may
 have been reused and refer to other databases (this may only manifest in
 multi-threaded code).  I've not tried to follow the code paths yet to see
 if this is a problem in practice.

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



More information about the Xapian-tickets mailing list