Ticket #146 (closed defect: released)

Opened 20 months ago

Last modified 19 months ago

exception errno and error_message lost for remote exceptions

Reported by: mhammond Owned by: olly
Priority: normal Milestone:
Component: Backend-Remote Version: SVN trunk
Severity: normal Keywords:
Cc: Blocked By:
Operating System: All Blocking:

Description

If a NetworkError? is thrown across a remote connection, it seems the errno and system error message are discarded. A problem is that while its probably OK to transmit the errno, its not OK to assume the other end can turn it into error text - meaning the message must also be serialized.

In the short term, it might be worth having RemoteServer::run() dump the exception to stderr so at least the exception info can be seen. (In the even shorter term, I'm just using a debugger - which is how I noticed...)

Change History

Changed 20 months ago by olly

  • status changed from new to assigned

Hmm, I think this means we really have to stop storing errno (or related codes) in Xapian::Error - as you suggest, the client and server may be on different OSes where the errno (and other) values don't match.

So we should certainly deprecate Error::get_errno() in 1.0.0 (I don't think it's actually especially useful to have access to the raw errno value anyway - I've never seen code using Xapian which checked the numeric errno value).

We can either just leave get_error_string() there (and store it as a string, at least in some cases), or perhaps just merge it into the normal message.

Changed 20 months ago by olly

Deprecation done.

Error class internals are ABI visible, so if we're going to store the error as a string in 1.0.X, we have to do it in 1.0.0. I'll check in a patch for that in a few minutes.

Then we need to tweak the Xapian::Error serialisation before 1.0.0 too, if we're requiring no bumps in the remote protocol (not sure if that's too strong a requirement or not). I'll see how easy that looks anyway - probably pretty easy.

Changed 20 months ago by richard

I suspect that keeping the remote protocol stable is going to be too strong a requirement at present. There are several things that I very much want to get added during the 1.0 series which I think will require network protocol changes (eg more flexibility for sort orders, and my metadata patch) - we may be able to make these backwards compatible, but that might also be more work than it's worth.

Don't let that stop you trying, though. ;-)

Changed 20 months ago by olly

  • rep_platform changed from PC to All

The "error string" (i.e. the textual equivalent of "get_errno()") should now be serialised, but I couldn't easily see how to add a testcase for this or indeed test it by hand.

If you can confirm this now works, I think this bug can be closed.

Changed 20 months ago by olly

  • status changed from assigned to closed
  • resolution set to fixed

Added new testcase to cover this (serialiseerror1 in internaltest), so closing.

Changed 19 months ago by olly

  • resolution changed from fixed to released

Fixed in 1.0.1.

Changed 19 months ago by trac

  • platform set to All
Note: See TracTickets for help on using tickets.