[Xapian-tickets] [Xapian] #781: Sockets never closed on RemoteDatabase errors
Xapian
nobody at xapian.org
Mon Apr 29 07:27:25 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):
Thinking about this some more, the basic idea of the fix seems right, but:
* I'm not sure `do_close()` is quite the right way to achieve this - in
particular it will try to wait for confirmation of the close for a
writable database, which is probably foolish if we hit `NetworkError`.
There can't be any changes to be written or committed at this point; it's
possible the remote end managed to lock the database, but we aren't likely
to be able to wait for it to confirm it has unlocked it. I'm thinking
`link.do_close(false)` is a better approach.
* If whatever we call to close the connection has any likelihood of
throwing we probably should catch and discard any exceptions from it
(because it's more useful to re-throw the original exception rather than
any exception we hit trying to close the connection). If we switch to
`link.do_close(false)` this is much less of a concern, since that boils
down to one or two calls to `close()` - nothing in that code path should
throw that I can see.
--
Ticket URL: <https://trac.xapian.org/ticket/781#comment:3>
Xapian <https://xapian.org/>
Xapian
More information about the Xapian-tickets
mailing list