[Koha-bugs] [Bug 26854] stage-marc-import.pl does not properly fork

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Mon Nov 16 11:08:35 CET 2020


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

Martin Renvoize <martin.renvoize at ptfs-europe.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
 Attachment #113029|0                           |1
        is obsolete|                            |

--- Comment #10 from Martin Renvoize <martin.renvoize at ptfs-europe.com> ---
Created attachment 113656
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=113656&action=edit
Bug 26854: Close STDERR when forking stage-marc-import.pl

We need to close STDERR when forking stage-marc-import.pl,
or else the CGI session with Apache httpd does not properly
finish. This leads to unexpected behaviour across different httpd
versions, operating systems, etc.

This patch closes the STDERR file handle when forking a child
process to do MARC imports, and it re-opens STDERR to a log file
in the logdir directory to catch any import errors.

Test plan:
1. Apply the patch
2. Go to http://localhost:8081/cgi-bin/koha/tools/stage-marc-import.pl
3. Upload a MARC file with a large number of records (e.g. 30,000 records)
4. Open F12 dev tools
5. Click on "Network" tab
6. Clear all existing network logs
7. Click "Stage for import"
8. After ~30 seconds, the request to stage-marc-import.pl should return a 200
code
9. Immediately, calls to background-job-progress.pl should start, and the "Job
progress"
bar should update at a maximum rate of every .5 seconds
(or more realistically 1-2 seconds)

Signed-off-by: David Nind <david at davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize at ptfs-europe.com>

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


More information about the Koha-bugs mailing list