I am able to 'repair' the bug by adding sleep statements in three places in pipe.pm, as follows: IN Statistics::R::Bridge::pipe::send:
my $file = "$this->{LOG_DIR}/input.$n.r" ; sleep(2); while( -e $file || -e "$file._" ) {
AGAIN IN Statistics::R::Bridge::pipe::send
my ($x,$xx) ; sleep(2); while( (!$has_quit || $this->{STOPING} == 1) && -e $file && $this- +>is_started( !$this->{STOPING} ) ) { ++$x ;
IN Statistics::R::Bridge::pipe::read_processR
my ($n) = ( $data =~ /(\d+)\s*$/gi ); $n = 1 if $n eq '' ; sleep(1); return( $n , $data ) if wantarray ;
By doing this, I was able to get through 500 Fisher's test iterations on a UNIX server with no failed tests.
However, it is very slow because 5secs of artificial delay have been incorporated into each $R->send()!

My hypothesised reason for this is that the adjustment prevents process.log and the input.x.r files in the log_dir from getting out of sync with $n and $data.

The total time taken for 500 (successful) Fisher's tests with this alteration was: 358.38u 41.23s 1:23:39.62 7.9%


In reply to Re^3: Buggy CPAN Module (Statistics::R) by maybeD
in thread Buggy CPAN Module (Statistics::R) by maybeD

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.