Report rendering handler to prevent linux from crashing on too much reporting at once

This commit is contained in:
2021-10-27 00:11:57 +00:00
parent 35c39c30a7
commit ae2b42065a
7 changed files with 103 additions and 24 deletions

View File

@@ -33,6 +33,9 @@ These values can all be specified as an environment variable or as a command lin
- [AYANOVA_JWT_SECRET](ops-config-jwt-secret.md)
- [AYANOVA_USE_URLS](ops-config-use-urls.md)
## REPORTING
- [AYANOVA_REPORT_RENDERING_TIMEOUT](ops-config-report-rendering-timeout.md)
## SECURITY

View File

@@ -0,0 +1,51 @@
# REPORT RENDERING TIMEOUT SETTING
The report rendering timeout value controls how long AyaNova will wait for a prior report to complete rendering when it receives a request to render a subsequent report.
This avoids a situation where a subsequent user can not get their report because a prior report generation is frozen due to a bug in a report template script or simply selecting too many records to report in a practical amount of time.
## How timeouts work
When a report is requested to be rendered AyaNova starts the process and makes note of the time and will process that report indefinitely for as long as it takes to complete. However, if a subsequent report request is made and the first report has not completed yet then AyaNova will use this setting to wait for the first report to process before starting the next one. If the timeout period completes without the first report completed rendering then AyaNova will forcibly stop processing the first report and release the resources dedicated to it and start processing the new report.
It's important to note that this timeout does not prevent AyaNova from processing a report for any length of time necessary to complete it; this timeout only takes effect if another report is requested to be rendered so if a User has to render a very large report that is known to take longer than the timeout period they would be advised to render that report when no one else is requesting a report (i.e. after hours)
The value is specified in **milliseconds** or thousandths of a second. For example a 30 second timeout is 30000 milliseconds.
## Default
If no override is specified AyaNova will use the following default value:
`30000`
This means AyaNova will wait for a prior report to complete for no longer than 30,000 milliseconds or 30 seconds before it will stop that prior report render and start the new one.
## Hard cap
There is a hard cap of 3 minutes or 180000 milliseconds built into AyaNova so specifying a value greater than 180000 milliseconds will be ignored.
## Overriding
AyaNova expects this value to be provided by an environment variable or command line parameter named
`AYANOVA_REPORT_RENDERING_TIMEOUT`
The value specified should be a string specifying the timeout in **milliseconds**, for example:
`30000`
Example command line parameter
`dotnet run --AYANOVA_REPORT_RENDERING_TIMEOUT="30000`
Example environment variable
Windows
`set "AYANOVA_REPORT_RENDERING_TIMEOUT=60000"`
Linux / MAC
`export AYANOVA_REPORT_RENDERING_TIMEOUT="120000"`
If both a command line parameter and an environment variable are set the command line parameter takes precedence.