GoogleCloudPlatform / functions-framework-python

FaaS (Function as a service) framework for writing portable Python functions
https://pypi.org/p/functions-framework/
Apache License 2.0
875 stars 118 forks source link

fix!: avoid long running process when request timeout #309

Closed chujchen closed 9 months ago

chujchen commented 9 months ago
 Previously function framework use 0 timeout which is actually "no timeout" restriction.
 This was causing a problem that when user provides a request timeout to Cloud function, process will still continue and consume resources.
 In this fix, timeout is enabled; default timeout settings is 5 min, same as Cloud run.
 To make sure timeout settings will be respected, default settings switched from multi-threads to multi-workers.

 However, user is still allowed to  customize workers/threads by assigning env var. But user need to note that timeout won't work when #thread > 1.