Bug 31072

Summary: Remove direct CSV export in itemsearch.pl
Product: Koha Reporter: Simon Hohl <simon.hohl>
Component: Architecture, internals, and plumbingAssignee: Bugs List <koha-bugs>
Status: NEW --- QA Contact: Testopia <testopia>
Severity: enhancement    
Priority: P5 - low CC: lari.taskula
Version: 21.11   
Hardware: All   
OS: All   
GIT URL: Change sponsored?: ---
Patch complexity: --- Documentation contact:
Documentation submission: Text to go in the release notes:
Version(s) released in:
Circulation function:

Description Simon Hohl 2022-06-30 12:28:00 UTC
I am not 100% sure if this is something you are considering in need of fixing, but anyway: We just had a colleague crashing our system by running multiple searches with cgi-bin/koha/catalogue/itemsearch.pl. 

The search scope was rather broad (a lot of entries) and the output option had been set to CSV (without going to the "screen" view). Because the interface did not give any feedback after starting the search (it just indicated "website loading"), the colleague refreshed the browser window and started another search. The result: We had 2 processes running on the server, using 8gb of RAM each, thus causing our server to grind to a halt.
Comment 1 Lari Taskula 2023-10-25 10:05:24 UTC
We also experienced a similar problem with itemsearch.pl when attempting to export tens of thousands of items as CSV in multiple processes, probably refreshing the page like in Simon's case, resulting in Koha becoming completely unresponsive.

When selecting "Screen" as output then the response is fast and it works as expected. Even barcodes work fine.

Perhaps limit the number of csv-exportable results? Or have the server respond immediately, saying the csv is being generated and implementing a way to serve such large csv to the user.