You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Using cron-connector, users should have the option to deploy functions with an additional annotation, e.g. async (in addition to the current required annotations topic and schedule) which specifies whether the function should be invoked asynchronously.
Alternatively, users should have the option to deploy functions with a different topic annotation, e.g. cron-connector-async, which would yield the same result.
Current Behaviour
The cron-connector is very useful for scheduling invocation of functions which need to be executed at specific intervals.
Currently invocations are made using the /function/ path of the API Gateway, meaning they are invoked synchronously, hence the connector waits for an HTTP response for a while (write_timeout) before concluding whether the function was successful.
This is fine for short-running functions, but may be less adequate for long-running functions (e.g. 10 minutes). Of course timeouts can be increased, but this may leave some functions waiting for an HTTP response for over 10 minutes, and in some cases there may be several functions which need to be invoked simultaneously.
Possible Solution
Invoking functions asynchronously using the /async-function/ path may be a more fitting solution for long-running functions.
In terms of the effort required to implement something like this, checking an additional annotation and invoking the function using the appropriate path (async-function) shouldn't require significant modifications to the current cron-connector.
Also, the modifications could be made in a way that users of cron-connector who don't use or are not aware of an asynchronous annotation are not affected by it. The default behavior could be use of synchronous invocations, as they are currently.
Context
Longer running functions such as website scrapers may require several minutes to complete. When using the cron-connector, this means that the write_timeout has to be set rather high and sockets remain open awaiting HTTP responses until function completion.
The text was updated successfully, but these errors were encountered:
Thank you for your interest in openfaas. Could you introduce yourself and who you're working for?
I'm also unclear why this issue wasn't raised on the cron-connector repository?
Bear with us as we have to triage and manage all user requests, and this is a fairly large project. Companies with a Premium Subscription get prioritisation.
My actions before raising this issue
Expected Behaviour
Using cron-connector, users should have the option to deploy functions with an additional annotation, e.g.
async
(in addition to the current required annotationstopic
andschedule
) which specifies whether the function should be invoked asynchronously.Alternatively, users should have the option to deploy functions with a different
topic
annotation, e.g.cron-connector-async
, which would yield the same result.Current Behaviour
The cron-connector is very useful for scheduling invocation of functions which need to be executed at specific intervals.
Currently invocations are made using the
/function/
path of the API Gateway, meaning they are invoked synchronously, hence the connector waits for an HTTP response for a while (write_timeout
) before concluding whether the function was successful.This is fine for short-running functions, but may be less adequate for long-running functions (e.g. 10 minutes). Of course timeouts can be increased, but this may leave some functions waiting for an HTTP response for over 10 minutes, and in some cases there may be several functions which need to be invoked simultaneously.
Possible Solution
Invoking functions asynchronously using the
/async-function/
path may be a more fitting solution for long-running functions.In terms of the effort required to implement something like this, checking an additional annotation and invoking the function using the appropriate path (
async-function
) shouldn't require significant modifications to the current cron-connector.Also, the modifications could be made in a way that users of cron-connector who don't use or are not aware of an asynchronous annotation are not affected by it. The default behavior could be use of synchronous invocations, as they are currently.
Context
Longer running functions such as website scrapers may require several minutes to complete. When using the cron-connector, this means that the
write_timeout
has to be set rather high and sockets remain open awaiting HTTP responses until function completion.The text was updated successfully, but these errors were encountered: