Opened 18 years ago

Closed 17 years ago

Last modified 17 years ago

#146 closed defect (released)

exception errno and error_message lost for remote exceptions

Reported by: Mark Hammond Owned by: Olly Betts
Priority: normal Milestone:
Component: Backend-Remote Version: SVN trunk
Severity: normal Keywords:
Cc: Blocked By:
Blocking: Operating System: All

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 (6)

comment:1 by Olly Betts, 18 years ago

Status: newassigned

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.

comment:2 by Olly Betts, 18 years ago

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.

comment:3 by Richard Boulton, 18 years ago

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. ;-)

comment:4 by Olly Betts, 18 years ago

rep_platform: PCAll

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.

comment:5 by Olly Betts, 17 years ago

Resolution: fixed
Status: assignedclosed

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

comment:6 by Olly Betts, 17 years ago

Operating System: All
Resolution: fixedreleased

Fixed in 1.0.1.

Note: See TracTickets for help on using tickets.