Smart server transmits MemoryError as ('error', '')

Bug #722416 reported by Andrew Bennetts
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Bazaar
Fix Released
High
Martin Packman

Bug Description

This is related to some existing bugs, but I think it's a new bug.

When the smart server encounters an unexpected exception it catches it and sends a generic error back to the client of ('error', str(exception)). Unfortunately some errors, like MemoryError, have empty str()s. Our users would be much better served in this case if they knew it was a MemoryError; they may be able to self-diagnose and fix/workaround the cause of the problem, and when they can't they'll at least be able to file more informative bug reports.

I think we should:

 1. specially handle MemoryError: it's the most common case of these (we suspect). Either a new error code or a hard-coded generic error of ('error', 'memory error') would do.
 2. do better in the general case of exceptions with empty str()s. Perhaps detect that case and emit the repr() or exception class name instead? Perhaps always send the exception class name along with the str()?
 3. make it clear to the user of the client that it is (probably) a fault in the server, rather than the client (although some bugs are triggered by the user/client doing unusual or nonsensical actions...)

This bug is primarily about the first point. but perhaps the other points can be cheaply addressed at the same time.

Tags: hpss

Related branches

Revision history for this message
Martin Pool (mbp) wrote : Re: [Bug 722416] [NEW] Smart server transmits MemoryError as ('error', '')

In the specific case of Launchpad, see also bug 613806.

Revision history for this message
Vincent Ladeuil (vila) wrote :

+1 for 2: always send the exception class name along with the str()

+1 for 3 make it clear to the user of the client that it is (probably) a fault in the server

Revision history for this message
Martin Packman (gz) wrote :

I'll take this if you're not already working on it Andrew.

Changed in bzr:
assignee: nobody → Martin [gz] (gz)
status: Confirmed → In Progress
Revision history for this message
Andrew Bennetts (spiv) wrote : Re: [Bug 722416] Re: Smart server transmits MemoryError as ('error', '')

> I'll take this if you're not already working on it Andrew.

Be my guest! :)

Revision history for this message
Martin Packman (gz) wrote :

First point in bug is addressed by linked branch, and continuation in <lp:~gz/bzr/smarter_smart_error_reporting_full_722416> which was merged at the same time covers points two and three.

Changed in bzr:
milestone: none → 2.4b1
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.