Mongoose catches runaway Pythons

New Mongoose package now available:

License: LGPL

Read more about Mongoose below or download and try Mongoose today:

Download URL: http://sourceforge.net/project/showfiles.php?group_id=77296

Email: opensource@notanothercorporation.com

Basic usage example

  import mongoose
  from mongoose.reporters import FileLogReporter

  mongoose.start()
  mongoose.registerReporter(FileLogReporter('mongoose.log'))
  mongoose.setSessionInfo('your_app_version', '1.0')
  # < ... your code here ... >
  mongoose.stop()

Mongoose Reporters

Mongoose replaces the default system exception handler so one or more "reporters" can act in response to an uncaught exception. Supplied sample reporters can:

Mongoose Incident Identifiers

Mongoose Incident Identifier technology provides developers with a convenient way to track the same exceptional incident (i.e. "bug") across multiple computers. A Mongoose Incident Identifier is an automatically generated unique identifier that will be the same on any computer which encounters the problem. (Similar to Full Circle Software's TalkBack ID and Bugtoaster's Crash Signature.)

Sample reporter output

ConsoleReporter

    This program has encountered a problem that means it can not continue.
    
    Please contact your technical support provider, system
    administrator or the vendor of this software and ask them for
    assistance.
    
    Mongoose Incident Identifier: 89662

FileLogReporter (Long format)

    ---------------------------------------------------------------------------
    Mon Mar  3 15:50:23 2003	89662	exceptions.Exception	Dummy Exception
    
    Traceback (most recent call last):
      File "mongoose/reporters.py", line 491, in ?
        raise Exception("Dummy Exception")
    Exception: Dummy Exception
    
    info one: Stuff
    info two: A value
    ---------------------------------------------------------------------------

EmailReporter

    From: mongoose@example.com
    To: developer@example.com
    Subject: Mongoose Incident Report
    X-Mongoose-Id: 89662
    Date: Mon,  3 Mar 2003 15:50:23 -0800 (PST)
    
    (This is an optional message prologue.)
    ---------------------------------------------------------------------------
    Mon Mar  3 15:50:23 2003	89662	exceptions.Exception	Dummy Exception
    
    Traceback (most recent call last):
      File "mongoose/reporters.py", line 491, in ?
        raise Exception("Dummy Exception")
    Exception: Dummy Exception
    
    info one: Stuff
    info two: A value
    ---------------------------------------------------------------------------

GuiReporter

More about "Mongoose Incident Identifiers"

The following is an example MII:

89662

Exciting, huh?

Why is a Mongoose Incident Identifier good for users?

Why is a Mongoose Incident Identifier good for support staff?

Why is a Mongoose Incident Identifier good for developers?

Read more about Mongoose below or download and try Mongoose today:

Download URL: http://sourceforge.net/project/showfiles.php?group_id=77296

Email: opensource@notanothercorporation.com

More documentation

Mongoose source code uses Epydoc compatible docstrings, feel free to read them. These will be particularly useful if you want to develop your own reporter. (e.g. to page some hapless SysAdmin; record a MII and log to a web site; send a message to a remote system monitor, etc...)

Other Limitations

We're not gonna catch a segfault, okay? (That belongs in the realm of a non-Python specific Open Source/Free Software implementation of this functionality.)

Utility modules

runall.py
Executes all the unit tests found in the 'test' directory. Can be used to do this in your packages too.

test/extunit.py
A special type of unit test class that allows us to unit test functionality that would otherwise disrupt or be disrupted by the standard Python unittest framework. This is how we unit test our replacement system exception handler (otherwise the unit test framework would catch all the uncaught exceptions). This can be used in your own test suites also--it's internally documented, but the documentation probably needs elaboration.

How is a Mongoose Incident Identifier generated?

This is the implementation specific, technical bit, you don't need to know this to use MIIs, and you shouldn't rely on the exact method of generating MIIs in the current implementation either.

At present a MII is generated by extracting function names from the traceback of the uncaught exception and concatenating them into a string, getting a hash for that string and then using the value of the hash modulo 10000.

This method has some pros and cons:

Pros

Cons

It is possible for an MII to have an extended form but this is not currently implemented. An MII in extended form looks like:

501-89662-72
where the first number is the software release version, the second number the simple MII and the last number the line number (possibly modulo 100) of the file where the exception occurred. This form reduces the likelihood of a MII clash caused by two different exceptions in one function. If there is sufficient demand for this form it may be added.

Download and try Mongoose today:

Download URL: http://sourceforge.net/project/showfiles.php?group_id=77296

Email: opensource@notanothercorporation.com