Merge lp:~spiv/bzr/hpss-log-noise into lp:~bzr/bzr/trunk-old

Proposed by Andrew Bennetts
Status: Merged
Merged at revision: not available
Proposed branch: lp:~spiv/bzr/hpss-log-noise
Merge into: lp:~bzr/bzr/trunk-old
Diff against target: 52 lines
To merge this branch: bzr merge lp:~spiv/bzr/hpss-log-noise
Reviewer Review Type Date Requested Status
Robert Collins (community) Approve
Review via email: mp+8922@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Andrew Bennetts (spiv) wrote :

The fix has two simple parts:

 * don't log UnknownSmartMethod exceptions from the request handler, as these
   are not exceptional (or particularly interesting) events for the server.

 * don't bother trying to invoke do_chunk or do_end if there is no live command
   in the request handler (e.g. because the request we are parsing is currently
   for an unknown method). Unknown requests should simply be consumed and
   discarded (after sending an UnknownMethod response, of course).

This fixes bug #338561.

-Andrew.

Revision history for this message
Robert Collins (lifeless) wrote :

 review +1

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'NEWS'
--- NEWS 2009-07-16 23:20:23 +0000
+++ NEWS 2009-07-17 05:35:14 +0000
@@ -40,6 +40,10 @@
40 committed to will no longer corrupt the dirstate. This was caused by an40 committed to will no longer corrupt the dirstate. This was caused by an
41 bug in the dirstate update_minimal method. (Robert Collins, #395556)41 bug in the dirstate update_minimal method. (Robert Collins, #395556)
4242
43* Requests for unknown methods no longer cause the smart server to log
44 lots of backtraces about ``UnknownSmartMethod``, ``do_chunk`` or
45 ``do_end``. (Andrew Bennetts, #338561)
46
43* ``WorkingTree4.unversion`` will no longer fail to unversion ids which47* ``WorkingTree4.unversion`` will no longer fail to unversion ids which
44 were present in a parent tree but renamed in the working tree.48 were present in a parent tree but renamed in the working tree.
45 (Robert Collins, #187207)49 (Robert Collins, #187207)
4650
=== modified file 'bzrlib/smart/protocol.py'
--- bzrlib/smart/protocol.py 2009-07-08 07:03:38 +0000
+++ bzrlib/smart/protocol.py 2009-07-17 05:35:14 +0000
@@ -897,7 +897,8 @@
897 # We do *not* set self.decoding_failed here. The message handler897 # We do *not* set self.decoding_failed here. The message handler
898 # has raised an error, but the decoder is still able to parse bytes898 # has raised an error, but the decoder is still able to parse bytes
899 # and determine when this message ends.899 # and determine when this message ends.
900 log_exception_quietly()900 if not isinstance(exception.exc_value, errors.UnknownSmartMethod):
901 log_exception_quietly()
901 self.message_handler.protocol_error(exception.exc_value)902 self.message_handler.protocol_error(exception.exc_value)
902 # The state machine is ready to continue decoding, but the903 # The state machine is ready to continue decoding, but the
903 # exception has interrupted the loop that runs the state machine.904 # exception has interrupted the loop that runs the state machine.
904905
=== modified file 'bzrlib/smart/request.py'
--- bzrlib/smart/request.py 2009-06-15 06:47:14 +0000
+++ bzrlib/smart/request.py 2009-07-17 05:35:14 +0000
@@ -281,6 +281,9 @@
281281
282 def accept_body(self, bytes):282 def accept_body(self, bytes):
283 """Accept body data."""283 """Accept body data."""
284 if self._command is None:
285 # no active command object, so ignore the event.
286 return
284 self._run_handler_code(self._command.do_chunk, (bytes,), {})287 self._run_handler_code(self._command.do_chunk, (bytes,), {})
285288
286 def end_of_body(self):289 def end_of_body(self):
@@ -344,6 +347,9 @@
344 self._run_handler_code(self._command.execute, args, {})347 self._run_handler_code(self._command.execute, args, {})
345348
346 def end_received(self):349 def end_received(self):
350 if self._command is None:
351 # no active command object, so ignore the event.
352 return
347 self._run_handler_code(self._command.do_end, (), {})353 self._run_handler_code(self._command.do_end, (), {})
348354
349 def post_body_error_received(self, error_args):355 def post_body_error_received(self, error_args):