Response problem with long actions

Hi team,

For some actions, we are required to handle a lot of things that need time, and these specific actions can take up to more than 2 minutes.

Because the browser is not receiving an answer in time, we are getting a timeout on the browser side, while the action is still running on our server.

Would it be possible to setup something that prevents the browser to generate a timeout? Is there some existing parameter for that kind of issue?

Thanks in advance for your help.

My current setup:

"meta": {
    "database_type": "postgres",
    "liana": "forest-express-sequelize",
    "liana_version": "6.3.11",
    "engine": "nodejs",
    "engine_version": "12.13.1",
    "framework": "express",
    "framework_version": "^4.17.1",
    "orm_version": "4.44.0"
}

Hi @Louis-Marie,

Thank you for sharing your issue with us, I’ve got a few questions to get the context in which this timeout issue is happening.

  • What browser are you experiencing the issue on?
  • How long is the action taking? Only 2mn or more? (I haven’t been able to reproduce with a 2mn delay on the action)
  • Is the action response needed (and helpful) or is that just an action that could run as a background process?

Thank you

Hi @anon37102731

  • What browser are you experiencing the issue on?
    I am using Brave.

  • How long is the action taking? Only 2mn or more? (I haven’t been able to reproduce with a 2mn delay on the action)
    The typical use case: we are receiving a file per day from a partner that we have to import in our system. When reading it, we have to do some background actions on our customers. At the end of the import, a result has to be displayed to confirm the import action was executed correctly or not. The delay we are getting is not generated by the import itself, but by the actions that we need to execute on each of impacted records.
    The delay is varying with the length of the imported file, and the delay in the answers of the different services.
    We noticed that it works well for small files, but we are getting timeout issues after some delay.
    Unfortunately, I have not written down the exact delay, but could you try with 3 minutes?

  • Is the action response needed (and helpful) or is that just an action that could run as a background process?
    The admin user needs to have the result before continuing his job, so a wait is required for this typical action.

Thanks

1 Like

I managed to reproduce the issue and there is a way to increase the timeout threshold.

Following this tip you can manually set an express server timeout limit. To to so in your lumber app, go to the server.js file at the root of your project and just after the server.listen(port); line add a server.timeout = your_timeout_threshold;

However, I must warn you that this will apply to the all app and it might not be the expected behavior. As you’re trying to perform especially long tasks, you should consider handling those in separated tasks that would run in background, with the smart action only triggering it. And if you ned some kind of stamp to know that the action performed correctly, you can maybe use a third party service that could send a notification through email for example.

I hope that those tips and advises will help, feel free to reach out if you have any other concern

1 Like