[Koha-bugs] [Bug 8437] Large database backups and large exports from export.pl fail under plack

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Thu Oct 22 06:33:34 CEST 2020


https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=8437

--- Comment #39 from David Cook <dcook at prosentient.com.au> ---
That truncated response is 32489 bytes long... 

I'm guessing the issue is with CGI::Parse::PSGI::Streaming...

According to the tools/export.pl, I'm writing a body of 33441 characters...

Looking at CGI::Parse::PSGI::Streaming, I'm only seeing 32768 characters (which
includes the HTTP headers and the HTTP body), and 32768 bytes is the same as
32KB...

CGI::Parse::PSGI::Streaming::Handle shows the full response in the buffer and
says it is 33750 characters long... 

Ah, I think it's a bug in CGI::Parse::PSGI::Streaming::Handle. For some reason,
the author takes the data printed to STDOUT, creates an in-memory file handle
stored in a scalar variable, and prints the contents of that "STDOUT" to the
in-memory file handle, and that's when it is truncated from 33750 characters to
32768 characters...

This is the line in CGI::Parse::PSGI::Streaming::Handle which seemingly breaks
things:
print {$self->{fh}} substr($buf, $offset, $len);

The weird thing is that I'm trying to reproduce the problem in a more stripped
back program and I can't do it. It just works...

-- 
You are receiving this mail because:
You are watching all bug changes.


More information about the Koha-bugs mailing list