Detail tabs don't have control over slow or big queries (FHCA-6139)
Description
Environment
Activity
One more issue found opening a “Change Audit” with big number of records:
Sometimes the application shows “No rows found” instead of the timeout message, this is misleading as the table has many records. Noticed this is caused because the waitLoadingForRow times out before the query timeout in the database
Also, while testing noticed that waitLoadingForRow is a method heavily called and it can be optimized to avoid processing when the conditions to process are not met
We just noticed a bad effect of the changes on IDEMPIERE - 6123 and here.
If the query has an error - for example a virtual column with a syntax error - then the window takes 30 seconds to open and sometimes do not show the error the first time and show it just the second time is tried to query.
pull request 2643 created
for testing big number of records in postgresql/oracle the instructions are at https://idempiere.atlassian.net/browse/IDEMPIERE-6123?focusedCommentId=50836
for testing big number of records on the detail tab, the same can be done with the view AD_AllUserRoles_V
for testing slow queries is similar, adding
pg_sleep(60)
as a join to the views AD_AllUsers_V (header), AD_AllUserRoles_V (detail) makes the trick
With IDEMPIERE-6123: Query in search window causing slowness and load spikes in the database (FHCA-5356)Closedwe have better control over slow and queries returning big number of records.
But, we found that detail tabs are causing similar issues:
when the detail tab in the query is too slow, the records are not shown without any indication to the user about what happened
when the detail tab returns too many records, there is no control about the max query records, and the user is informed about the number of records and start loading in background without any indication to the user about what’s happening. Also, when the background load is too big (millions of records) the server crashes with an Out Of Memory error.
So, this ticket is to apply the same controls on detail tabs as those implemented in the header tab.