[OpenSRF-GIT] OpenSRF branch rel_2_4 updated. osrf_rel_2_4_1-7-gda98d30

Evergreen Git git at git.evergreen-ils.org
Thu Feb 9 10:39:30 EST 2017


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "OpenSRF".

The branch, rel_2_4 has been updated
       via  da98d30ca754a5a9bacb09982f8cad9c053a3105 (commit)
      from  5bd88d39d7d22e6deee85952f1dc827c138095c4 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit da98d30ca754a5a9bacb09982f8cad9c053a3105
Author: Galen Charlton <gmc at esilibrary.com>
Date:   Thu Dec 22 15:53:12 2016 +0500

    LP#1652122: fix infinite recursion in opensrf.system.method.all
    
    Under certain circumstances, calling opensrf.system.method.all on a
    Perl service can result in an infinite recursion when attempting to
    serialize an OpenSRF::Application object to JSON.  In particular,
    this was observed to happen when doing an introspection of
    the opensrf.settings service.
    
    This patch avoids the infinite recursion (and consequent memory
    leak) by ensuring that the 'session' key is slated for exclusion
    from serialization from OpenSRF::Application objects during
    bootstrapping.
    
    Note that the problem does not affect all Perl services; if a
    Perl service declares at least one streaming method, the auto-registration
    of the .atomic method will result in 'session'-stripping.
    
    This patch fixes a regression introduced in bug 1350457.
    
    To test
    -------
    [1] Run 'introspect opensrf.settings' via srfsh; observe
        that it never returns and that the opensrf.settings drone
        will grow in memory sized until killed.
    [2] Apply the patch, then repeat step 1. This time, the
        request should succeed.
    
    Signed-off-by: Galen Charlton <gmc at esilibrary.com>
    Signed-off-by: Mike Rylander <mrylander at gmail.com>

diff --git a/src/perl/lib/OpenSRF/System.pm b/src/perl/lib/OpenSRF/System.pm
index 39aeaf9..c9534dc 100644
--- a/src/perl/lib/OpenSRF/System.pm
+++ b/src/perl/lib/OpenSRF/System.pm
@@ -31,7 +31,7 @@ sub load_bootstrap_config {
         unless $bootstrap_config_file;
 
     OpenSRF::Utils::Config->load(config_file => $bootstrap_config_file);
-    OpenSRF::Utils::JSON->register_class_hint(name => "OpenSRF::Application", hint => "method", type => "hash");
+    OpenSRF::Utils::JSON->register_class_hint(name => "OpenSRF::Application", hint => "method", type => "hash", strip => ['session']);
     OpenSRF::Transport->message_envelope("OpenSRF::Transport::SlimJabber::MessageWrapper");
     OpenSRF::Transport::PeerHandle->set_peer_client("OpenSRF::Transport::SlimJabber::PeerConnection");
     OpenSRF::Application->server_class('client');

-----------------------------------------------------------------------

Summary of changes:
 src/perl/lib/OpenSRF/System.pm |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)


hooks/post-receive
-- 
OpenSRF


More information about the opensrf-commits mailing list