GoogleCloudPlatform / functions-framework-go

FaaS (Function as a service) framework for writing portable Go functions
https://godoc.org/github.com/GoogleCloudPlatform/functions-framework-go
Apache License 2.0
464 stars 63 forks source link

fix: cancel request context when timeout exceeded #244

Closed garethgeorge closed 4 months ago

garethgeorge commented 4 months ago

This PR sets the request timeout (signaled by CLOUD_RUN_TIMEOUT_SECONDS) on the request context so that ff users can write functions that are deadline aware.

Functions overrunning CLOUD_RUN_TIMEOUT_SECONDS may continue to execute and spend CPU cycles but represent wasted work as the cloud functions runtime typically cuts off the response at this point, no data can be sent.