[OpenSRF-GIT] OpenSRF branch master updated. 53e7f82b534eef2b513fe31bcb2a9c719a7ee746

Evergreen Git git at git.evergreen-ils.org
Fri Aug 18 12:43:45 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, master has been updated
       via  53e7f82b534eef2b513fe31bcb2a9c719a7ee746 (commit)
       via  b198681669ed28a510fd0d18d3a89d4dd0837ebe (commit)
      from  e88891bcdd9781c2d291057a802e4f751202fee9 (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 53e7f82b534eef2b513fe31bcb2a9c719a7ee746
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 b198681669ed28a510fd0d18d3a89d4dd0837ebe
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