[Orca-dev] SourceFile.pm:add_plots error?
Podhorodecki, Michael
Michael.Podhorodecki at sensis.com.au
Sun May 30 21:40:36 PDT 2004
I believe that there is an error in SourceFile.pm:add_plots() for case 2,
"Regular expression match in the first data with additional datas".
The regular expression substitution is occurring not just for the new plot
data but is also being applied against previously processed plots via the
'creates' hash key.
I was running orca-0.27 and procallator on Redhat 9 and everything was
working well until I added a host with a second disk, After which the Orca
process promptly grew to 400 MBytes in size and exited with an "internal
error: eval ...". Trying the development snapshot "orca-snapshot-r323" still
resulted in the same crash.
The clue was that the eval output had text between round brackets "()"
replaced with the name of the second disk drive "c0d1". Case 2 generates a
new copy of an existing plot for second and subsequent matches of the re
thus the 'creates' hash key is not null at this time.
As a quick check I simply deleted the 'creates' hash key before applying the
re on the plot data (line 948 appears to recreate the "creates" key for new
plots). A context diff is attached. For my hosts and data orca is now
running with no errors and I get plots for both "c0d0" and "c1d1".
The proper fix is probably to just copy the code in deep_clone_plot() which
saves the "creates" key before it is deleted and restores it afterwards.
However I don't understand the intent of having a history of all plot data
created in this run attached to each plot rather than just that for the
current plot? Seems dangerous to me and an invitation to n^2 behaviour.
BTW the "orca-snapshot-r323/data_gatherers/procallator/procallator.cfg.in"
file has a number of two data line plots where the second data line is also
a re rather than a $ variable. eq.
title %g Disk Reads/Writes Per Second
source procallator
data disk_rd_(.*)/s
data disk_wr_(.*)/s
should the data lines not be:
data disk_rd_(.*)/s
data disk_wr_$1/s
$ diff -C 15 SourceFile.pm /usr/local/lib/Orca
*** SourceFile.pm Fri May 14 14:38:31 2004
--- /usr/local/lib/Orca/SourceFile.pm Mon May 31 13:27:20 2004
***************
*** 494,523 ****
--- 494,524 ----
if ($oldest_regexp_index == $i) {
++$oldest_regexp_index;
$handle_regexps = 0;
}
++$i;
next;
}
++$regexp_pos[$i];
# Start by making a deep copy of the plot. Replace the regular
# expression in the first data with the name of the column that
# caused the match. Then create string form of the plot object
# using Data::Dumper::Dumper and replace all of the $1, $2,
# ... with what was matched in the first data source.
$plot = deep_clone_plot($plot);
+ delete $plot->{creates};
$plot->{data}[0][$regexp_element_index] = $column_description;
my $d = Data::Dumper->Dump([$plot], [qw(plot)]);
my $count = 1;
foreach my $match (@matches) {
$d =~ s/\$$count/$match/mge;
$d =~ s/\(.+\)/$match/mge;
++$count;
}
{
local $SIG{__DIE__} = 'DEFAULT';
local $SIG{__WARN__} = \&die_when_called;
eval $d;
}
die "$0: internal error: eval on\n $d\nOutput: $@\n" if $@;
www.sensis.com.au
A leading Australian advertising, information
and directories business.
www.yellowpages.com.au
www.whitepages.com.au
www.citysearch.com.au
www.whereis.com.au
www.telstra.com.au
This email and any attachments are intended only for the use of the recipient and may be confidential and/or legally privileged.
Sensis Pty Ltd disclaims liability for any errors, omissions, viruses, loss and/or damage arising from using, opening or transmitting this email.
If you are not the intended recipient you must not use, interfere with, disclose, copy or retain this email and you should notify the sender immediately by return email or by contacting Sensis Pty Ltd by telephone on [+61 3 9201 4888]
-------------- next part --------------
An HTML attachment was scrubbed...
URL: /pipermail/orca-dev/attachments/20040531/83d08fc7/attachment.htm
More information about the Orca-dev
mailing list