[OpenSRF-GIT] OpenSRF branch rel_2_5 updated. osrf_rel_2_5_0-5-gdc3bfa4

Evergreen Git git at git.evergreen-ils.org
Fri Aug 18 12:44:19 EDT 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_5 has been updated
       via  dc3bfa4771e5e5b139d31c73b42562917f100688 (commit)
       via  2c7b9787c63c8477fc7f1e7b46f1262a62abf6f0 (commit)
      from  dab68778d6064b3ff5688ea3c622b38f07b4f993 (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 dc3bfa4771e5e5b139d31c73b42562917f100688
Author: Galen Charlton <gmc at equinoxinitiative.org>
Date:   Fri Aug 18 11:11:29 2017 -0400

    LP#1711194: avoid division by zero errors
    
    Under some circumstances, osrf_control --diagnostic may not
    be able to deduce the correct max_children setting for a service,
    e.g., if it's run without --localhost on a system that doesn't
    have a opensrf.xml config section specifying active apps for a
    specific hostname. When that happens, just display the count
    of running drones rather than displaying error messages about
    undefined $dmax values and divisions by zero.
    
    Signed-off-by: Galen Charlton <gmc at equinoxinitiative.org>
    Signed-off-by: Bill Erickson <berickxx at gmail.com>

diff --git a/bin/opensrf-perl.pl.in b/bin/opensrf-perl.pl.in
index 021f00e..40015e3 100755
--- a/bin/opensrf-perl.pl.in
+++ b/bin/opensrf-perl.pl.in
@@ -267,8 +267,12 @@ sub do_diagnostic {
                 my @drones = `pgrep -f "Drone \\[$svc\\]"`;
                 my $dcount = scalar(@drones);
                 my $dmax = $max_children_map{$svc};
-                $str .= "#drones=$dcount/$dmax ";
-                $str .= sprintf('%3d%%', (int(($dcount / $dmax) * 100)));
+                if (defined($dmax) && $dmax > 0) {
+                    $str .= "#drones=$dcount/$dmax ";
+                    $str .= sprintf('%3d%%', (int(($dcount / $dmax) * 100)));
+                } else {
+                    $str .= "#drones=$dcount";
+                }
                 msg($str);
                 msg("\tERR $svc has no running drones.") unless @drones;
             }

commit 2c7b9787c63c8477fc7f1e7b46f1262a62abf6f0
Author: Bill Erickson <berickxx at gmail.com>
Date:   Wed Aug 16 14:10:13 2017 -0400

    LP#1711194 osrf_config --diagnostic reports max-children
    
    --diagnostic output shows the maximum number of allowed drones per
    service along with the active drone count.  Additionally, a usage
    percentage value is displayed.
    
    E.g.
    
    $ /openils/bin/osrf_control -l --diagnostic
    
    * open-ils.acq   [1581] uptime=00:35 cputime=00:00:00 #drones=1/15 6%
    * open-ils.actor [1629] uptime=00:35 cputime=00:00:00 #drones=2/15 13%
    
    Signed-off-by: Bill Erickson <berickxx at gmail.com>
    Signed-off-by: Chris Sharp <csharp at georgialibraries.org>
    Signed-off-by: Galen Charlton <gmc at equinoxinitiative.org>

diff --git a/bin/opensrf-perl.pl.in b/bin/opensrf-perl.pl.in
index e1c7efc..021f00e 100755
--- a/bin/opensrf-perl.pl.in
+++ b/bin/opensrf-perl.pl.in
@@ -65,6 +65,7 @@ my $opt_ignore_orphans = 0;
 my $sclient;
 my @perl_services;
 my @nonperl_services;
+my %max_children_map;
 my $hostname = $ENV{OSRF_HOSTNAME} || hostfqdn();
 
 GetOptions(
@@ -264,7 +265,10 @@ sub do_diagnostic {
                 msg($str);
             } else {
                 my @drones = `pgrep -f "Drone \\[$svc\\]"`;
-                $str .= "#drones=".scalar(@drones);
+                my $dcount = scalar(@drones);
+                my $dmax = $max_children_map{$svc};
+                $str .= "#drones=$dcount/$dmax ";
+                $str .= sprintf('%3d%%', (int(($dcount / $dmax) * 100)));
                 msg($str);
                 msg("\tERR $svc has no running drones.") unless @drones;
             }
@@ -332,6 +336,10 @@ sub do_init {
                 next;
             }
             my $lang = $sclient->config_value('apps', $app, 'language') || '';
+
+            $max_children_map{$app} = $sclient->config_value(
+                'apps', $app, 'unix_config', 'max_children');
+
             if ($lang =~ /perl/i) {
                 push(@perl_services, $app);
             } else {

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

Summary of changes:
 bin/opensrf-perl.pl.in |   14 +++++++++++++-
 1 files changed, 13 insertions(+), 1 deletions(-)


hooks/post-receive
-- 
OpenSRF


More information about the opensrf-commits mailing list