Task execution is aborted due to timeout in Java service

Hi Team
I’m reporting this issue which is similar to this one : https://support.backendless.com/t/eventhandler-code-not-working-when-deployed/12436

The code was working perfectly until last week (or before, my client contacted me last week).

I’m able to resolve the issue when running in local mode (CodeRunner).
Is there any change on your side that impacted my code?

Backendless Version (3.x / 6.x, Online / Managed / Pro )

Cloud 9

Client SDK (REST / Android / Objective-C / Swift / JS )

REST api calling java code :

Application ID

4F036E66-2926-B11C-FF1F-741011904C00

Expected Behavior

Please describe the expected behavior of the issue, starting from the first action.

  1. The modbile app makes an Api rest call : BackendlessUrl//BackendlessApplicationId/ApiKey/data/ArcolevRapportRequest
  2. A document is generated
  3. This document is processed by generateVGPReport to generate a PDF

Actual Behavior

  1. [OK]
  2. [OK]
  3. [KO] (see logs below)

Reproducible Test Case

You can use the api /testPDf in ArcolevPDFService

Log

11:37:3.50 | com.mbaas.Logger | INFO | Inside generateVGPReport
11:37:3.417 | com.mbaas.Logger | INFO | Report 20221055-5
11:37:2.781 | SERVER_CODE | INFO | [32088] Building ServerCode Model for path (/opt/backendless/repo/4f036e66-2926-b11c-ff1f-741011904c00/files/servercode/CODELESS/default/PRODUCTION)
11:37:2.783 | SERVER_CODE | INFO | [32088] Reading models/arcolevcatalog.js…
11:37:2.785 | SERVER_CODE | INFO | [32088] Reading models/arcolevclient.js…
11:37:2.785 | SERVER_CODE | INFO | [32088] Reading models/arcolevclientchantier.js…
11:37:2.786 | SERVER_CODE | INFO | [32088] Reading models/arcolevclientutilisateur.js…
11:37:2.787 | SERVER_CODE | INFO | [32088] Reading models/arcolevcontrole.js…-
11:37:2.788 | SERVER_CODE | INFO | [32088] Reading models/arcolevpointcontrole.js…
11:37:2.789 | SERVER_CODE | INFO | [32088] Reading models/arcolevrapportrequest.js…
11:37:2.790 | SERVER_CODE | INFO | [32088] ServerCode Model built in 12ms
11:37:2.790 | SERVER_CODE | INFO | [32088] Reading handlers/persistence/arcolevrapportrequest/afterCreate.js…
11:37:2.791 | SERVER_CODE | INFO | [32088] ServerCode Model extended in 1ms
11:37:2.793 | SERVER_CODE | INFO | [32088] [3b63c011-5413-40f8-834d-86bd3cf84342] [INVOKE HANDLER] persistence.afterCreate (ArcolevRapportRequest, async)
11:37:7.795 | SERVER_CODE | ERROR | [32088] Task execution is aborted due to timeout
11:37:7.795 | SERVER_CODE | INFO | [32088] Processing finished in 5023.557ms
11:37:7.795 | SERVER_CODE | INFO | [32088] Task results sent
11:37:7.795 | SERVER_CODE | INFO | [32088] Flushing logs

Hello @Mkhafague

We will investigate the problem and let you know the result as soon as possible.

Regards,
Inna

Hello @Mkhafague

sorry for the long wait for an answer. According to your logs, you get timeout because your event handler calls services/ArcolevPDFService/generateVGPReport service. Test your service first. Also, be aware that the time of pdf generation in debug mode and production mode may be different. Because when you execute the service in DEBUG mode then logic will be executed on your local machine. In production mode your share memory and CPU with other guys so it may work a little bit slower or faster than on your machine. I suggest adding more logs to your service to see how much time logic takes to execute. Then optimize your logic if possible or by the additional package to extend execution time Backendless

Hi @sergey.kuk
Thanks for your answer.
Sure I can add additionnal logs to my service. But my code is on prod since 1 year and it was working. I tried the service in different time same issue.
Is there any new limit applied to my container?
Thanks in advance

@Mkhafague

no, there are no new limits. Could it be that pdf became bigger?

they are even smaller in November (under 80ko), you can check files in this folder /app/epiprod/files/ARCOLEV

@Mkhafague what arguments should we pass to the service to reproduce the issue?

Hi @sergey.kuk
you can try with this payload :
{
“controleObjectId”: “03CAC4E8-1499-41C9-823A-A4095989EFAF”,
“requestObjectId”: “1F86AD4F-EFF6-49D9-BE41-99803B9E1244”
}
thanks

Hi @sergey.kuk
You can also use this api /services/ArcolevPDFService/testPDf without param. I created this endpoint by isolating the code that is generating the error.
You can see the code in the this ticket : https://support.backendless.com/t/eventhandler-code-not-working-when-deployed/12436

Hello @Mkhafague ,

We were able to reproduce the issue and are working on it. Internal ticket BKNDLSS-30330 created.
We will let you know when the problem has been fixed.

Regards, Nazar

Hello @Mkhafague ,

sorry for the such delay with a fix. I have checked in your app and the methods works fine now, please check from your side