report templates can cause unconstrained fetches of large tables when creating a new report

Bug #1858109 reported by Galen Charlton
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Evergreen
New
High
Unassigned

Bug Description

Report templates can be constructed such that the act of opening the interface to create a report from such a template can trigger fetching all of the rows from a large table.

For example, consider a template that has a filter on the asset.copy ID. Because acp.id has a reporter:selector defined in the IDL (the barcode), the interface for creating a report will attempt to build a selection widget that lists all of the copy barcodes for OUs that the staff user has access to. It does this by calling open-ils.reporter.magic_fetch, which at heart is a wrapper around an atomic cstore fetch all of rows of a table (possibly filtered by OU). Not a big deal for css, but likely a huge problem for acp.

The bad effects can include:

- since the cstore backend will attempt to fetch and store many rows, it may cause an out-of-memory situation
- if the fetch actually succeeds, the process of constructing a widget with thousands or hundreds of thousands of rows may choke the user's browser

Possible solutions and workarounds include:

- have open-ils.reporter.magic_fetch apply a reasonable (but arbitrary) limit on the number of rows it will fetch for a linked table
- in oils_rpt_param_editor.js, hard-code some exclusions for building oilsRptRemoteWidgets
- depending on how bug 1830804 is addressed, have the reports interface refuse to build oilsRptRemoteWidgets for "large" and "medium" tables.

Evergreen 3.2+

Tags: reports
Revision history for this message
Galen Charlton (gmc) wrote :

Example of a report template that exercises the bug

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.