durusmail: quixote-users: Dulcinea: Logging traceback of conflicts (Patch)
Dulcinea: Logging traceback of conflicts (Patch)
2004-02-10
Dulcinea: Logging traceback of conflicts (Patch)
ThomasGüttler
2004-02-10
Hi,

unfortunately I can't provide patch, since my version
is too different. But logging the traceback of conflicts
is very helpfull since it shows you where the hot spots
of your application are:

       for i in range(retries):
            try:
                return Publisher.try_publish(self, request, path)
            except ConflictError, exc:
                import sys
                import traceback
                import cStringIO
                (exc_type, exc_value, tb) = sys.exc_info()
                error_file = cStringIO.StringIO()
                traceback.print_exception(exc_type, exc_value, tb,
                                          file=error_file)
                stacktrace=error_file.getvalue()
                log("ConflictError %sv%s: retrying request. " \
                    "path=%s user=%s str(exc)=%s %s" % (
                    i, retries,
                    path, os.environ.get("REMOTE_USER", ""), str(exc),
                    stacktrace))
                self.connection.sync()
                request.response = HTTPResponse() # reset response object

 Thank you for Quixote and Dulcinea,
   thomas

--
Thomas Güttler, TBZ-PARIV GmbH, Bernsdorfer Str. 210-212, 09126 Chemnitz
Tel.: 0371/5221217 Fax:  0371/5221216




reply