Reputation: 143
I'm triggering a long running scraping Cloud Run function with a PubSub topic and subscription trigger. Everytime I run it it does crash after 121.8 seconds but I don't get why.
POST 503 556B 121.8s APIs-Google; (+https://developers.google.com/webmasters/APIs-Google.html) https://????.a.run.app/
The request failed because either the HTTP response was malformed or connection to the instance had an error.
I've got a built-in timeout trigger and when I set it at 1 minute the functions runs without any problems but when I set at 2 minutes the above error gets triggered so it must be something with the Cloud Run or Subscription timeout settings but I've tried to increase those (read more below).
Things involved
1 x Cloud Run 1 x SubPub subscription 1 x SubPub topic
These are the things I've checked
Anyone who can point me in the right direction?
Upvotes: 2
Views: 1138
Reputation: 5179
This is almost certainly due to Node.js' default server timeout of 120secs.
Try server.setTimeout(0)
to remove this timeout.
Upvotes: 4