Browse Source

See issue 223 (attempt to isolate reported error condition).

Chris McDonough 18 years ago
parent
commit
e9ec0dd44b
2 changed files with 14 additions and 0 deletions
  1. 6 0
      CHANGES.txt
  2. 8 0
      src/supervisor/xmlrpc.py

+ 6 - 0
CHANGES.txt

@@ -13,6 +13,12 @@
     Now a maximum of one every three seconds is sent up until SIGKILL
     time.  Thanks to Ian Bicking.
 
+  - Add an assertion: we never want to try to marshal None to XML-RPC
+    callers.  Issue 223 in the collector from vgatto indicates that
+    somehow a supervisor XML-RPC method is returning None (which
+    should never happen), but I cannot identify how.  Maybe the
+    assertion will give us more clues if it happens again.
+
 2.1b2
 
   - Added new tailProcessLog() command to the XML-RPC API that

+ 8 - 0
src/supervisor/xmlrpc.py

@@ -907,6 +907,14 @@ class supervisor_xmlrpc_handler(xmlrpc_handler):
             try:
                 logger.debug('XML-RPC method called: %s()' % method)
                 value = self.call(method, params)
+                # application-specific: instead of we never want to
+                # marshal None (even though we could by saying allow_none=True
+                # in dumps within xmlrpc_marshall), this is meant as
+                # a debugging fixture, see issue 223.
+                assert value is not None, (
+                    'return value from method %r with params %r is None' %
+                    (method, params)
+                    )
                 logger.debug('XML-RPC method %s() returned successfully' %
                              method)
             except RPCError, err: