pkp / pkp-lib

The library used by PKP's applications OJS, OMP and OPS, open source software for scholarly publishing.
https://pkp.sfu.ca
GNU General Public License v3.0
297 stars 442 forks source link

Separate ProcessUsageStatsLogFile into several smaller jobs #9822

Open bozana opened 5 months ago

bozana commented 5 months ago

Big installations, that have huge log files and that use AcronPlugin for job processing, can experience timeouts. Thus, try to separate the ProcessUsageStatsLogFile into several smaller jobs, so that each job processes only e.g. 100 lines of the log file.

bozana commented 4 months ago

Because the current solution works also for the huge installation, I will close this issue for now...

shantanu198713 commented 1 month ago

Hi @bozana I am still facing too many times or run too long. The job may have previously timed out issue. This has been coming to light for a long time. I execute it by manually clicking the TryAgain button multiple times.

Screenshot 2024-07-09 155516

{
    "message": "APP\\jobs\\statistics\\ProcessUsageStatsLogFile has been attempted too many times or run too long. The job may have previously timed out.",
    "code": 0,
    "file": "\/ojs\/lib\/pkp\/lib\/vendor\/laravel\/framework\/src\/Illuminate\/Queue\/Worker.php",
    "line": 746,
    "trace": [
        {
            "file": "\/ojs\/lib\/pkp\/lib\/vendor\/laravel\/framework\/src\/Illuminate\/Queue\/Worker.php",
            "line": 505,
            "function": "maxAttemptsExceededException",
            "class": "Illuminate\\Queue\\Worker",
            "type": "->"
        },
        {
            "file": "\/ojs\/lib\/pkp\/lib\/vendor\/laravel\/framework\/src\/Illuminate\/Queue\/Worker.php",
            "line": 415,
            "function": "markJobAsFailedIfAlreadyExceedsMaxAttempts",
            "class": "Illuminate\\Queue\\Worker",
            "type": "->"
        },
        {
            "file": "\/ojs\/lib\/pkp\/lib\/vendor\/laravel\/framework\/src\/Illuminate\/Queue\/Worker.php",
            "line": 375,
            "function": "process",
            "class": "Illuminate\\Queue\\Worker",
            "type": "->"
        },
        {
            "file": "\/ojs\/lib\/pkp\/lib\/vendor\/laravel\/framework\/src\/Illuminate\/Queue\/Worker.php",
            "line": 326,
            "function": "runJob",
            "class": "Illuminate\\Queue\\Worker",
            "type": "->"
        },
        {
            "file": "\/ojs\/lib\/pkp\/classes\/core\/PKPQueueProvider.php",
            "line": 106,
            "function": "runNextJob",
            "class": "Illuminate\\Queue\\Worker",
            "type": "->"
        },
        {
            "file": "\/ojs\/lib\/pkp\/classes\/queue\/JobRunner.php",
            "line": 220,
            "function": "runJobInQueue",
            "class": "PKP\\core\\PKPQueueProvider",
            "type": "->"
        },
        {
            "file": "\/ojs\/lib\/pkp\/classes\/core\/PKPQueueProvider.php",
            "line": 135,
            "function": "processJobs",
            "class": "PKP\\queue\\JobRunner",
            "type": "->"
        },
        {
            "function": "PKP\\core\\{closure}",
            "class": "PKP\\core\\PKPQueueProvider",
            "type": "->"
        }
    ]
}
mpbraendle commented 1 month ago

Same here - one usage events log file is just not processed with the same errors as OP reported. Log files are between 3 M and 21 M.