Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

AppEngine - What's the timeout for Node cloud tasks handlers?

I have an application that does some work in background, using default Cloud Tasks for scheduling/executing the process.

I would like the job to be able to run for a few minutes, or at least understand what the actual limitations are and what I can do about them.

According to docs on Push Queues (which seem to be equivalent to the modern Cloud Tasks?), the deadline is 10 minutes for auto-scaling, and 24 hours for basic scaling.

However, my job seems to crash after 2 minutes. 115 seconds is fine, 121 seconds is a crash. The workload and resource consumption is the same in all cases. The message is always the unhelpful "The process handling this request unexpectedly died. This is likely to cause a new process to be used for the next request to your application. (Error code 203)".

It does not matter if I use an auto-scaling F2 instance, or basic-scaling B2. It gets terminated after 2 minutes.

According to docs on Node request handling, there is a 60-second timeout for "request handlers"

What is the timeout in the end? Is it 1 minute, 2 minutes, or 10 minutes? Is there anything I can do to change it, if I want my job to run for 5 or 30 minutes.

like image 822
Konrad Garus Avatar asked Nov 16 '18 11:11

Konrad Garus


People also ask

How long does cloud Task run?

They guarantee reliable task execution - upon success, all workers must send an HTTP response code (200-299) to the Cloud Tasks service before the default timeout deadline of 10 minutes, with a maximum of 30 minutes. If a different response is sent, or no response, the task is retried.

How long does it take my application to handle a given request?

The average length of time it takes to hear back is one to two weeks or around 10-14 days after you submit your application materials. In contrast, certain jobs, like those for government positions could take as long as six to eight weeks to hear back.

What is the role of Google Appengine?

App Engine is a fully managed, serverless platform for developing and hosting web applications at scale. You can choose from several popular languages, libraries, and frameworks to develop your apps, and then let App Engine take care of provisioning servers and scaling your app instances based on demand.

What is go App Engine?

Google App Engine is a service and a platform where you can develop and host web applications. You can learn more about Google App Engine at the official Google App Engine site. With App Engine integration, you can run and debug Google App Engine applications.


1 Answers

In short summary, I think the best deduction that can help your scenario is Node's Request Timeout which has exactly 2 minutes timeout by default


In Long, after reading your question. I decided to create PoC out of it

  1. created the Dummy Node 8 Service which only uses a built-in HTTP server
  2. created a URL path that can have an artificially long response (using setTimeout) and can specify the duration from the request (e.g. /lr/300 means it gonna response approximately in 5 minutes)
  3. deployed it to GAE service another than default (Node8, Automatic Scaling)
  4. created Cloud Tasks "task" that request /lr/540 to the aforementioned service

Before: Before

As you can see, the Cloud Tasks and App Engine have problems waiting longer than 2 minutes, and have the same unhelpful message that you got (The process handling this request unexpectedly died...)

And then: Code

I wrote this line in order to increase Global Request Timeout

And the result: Result

In my case, I can safely say that it's Node Request Timeout that causes the problem. I hope this can be of use to you too.

like image 107
Thammachart Avatar answered Oct 19 '22 20:10

Thammachart