-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Switch to latest connector-SDK release #31
Conversation
I apologise for my comment about using the PR template. It seems that we forgot to add it to the repo. Please can you reformat this PR description? The most important part is this question
https://github.com/openfaas/faas/blob/master/.github/PULL_REQUEST_TEMPLATE.md Thanks for the PR |
This seems a bit too short. The default for functions in the watchdog is 10s, I would suggest maybe having that to match the default? |
What do you think to using the async invocation mode in the connector-sdk, I'm pretty sure that was added at some point? |
How did you decide on 5 second resync period, what if this was made configurable instead? Add a helm chart maybe? I covered creating these in my latest tutorial/lab - https://github.com/alexellis/helm3-expressjs-tutorial |
Thx @alexellis for your quick review! Updated the PR with the template and will that one going forward!
No prob, will reset and update the docs accordingly.
1s (default) seemed rather short (was afraid of overwhelming the API if everyone follows this). But I'm totally fine reverting to 1s if this is deemed appropriate. Either way, I'll update the docs accordingly.
Sounds reasonable. Any drawbacks of this approach vs sync (besides the "immediate" feedback?) |
Created openfaas/connector-sdk#45 to discuss intervals/timeouts in the SDK. |
Wow was it really 1 second? That is not a good choice in retrospect. So I'm totally fine with bumping it higher, thank you for the suggestion.
In your scenario where you may be running for 10s per invocation the async approach would fire and forget, so keep up with the system emitting events (vcenter), but without it, it could potentially fail if many events arrived at once. |
Seems like we had 15s upstream to match the default watchdog setting + some grace, then topic map rebuilds every 10s? |
Thx, I was checking the connector-sdk for examples and the only one provided was for the tester. Let me revert.
That was also a concern I had, especially when using interpreted runtimes (PowerShell, PowerCLI). The drawback is I don't see function responses (just err on invocation or |
Running final test with the recent changes and will update this comment accordingly. Do you want me to squash the commits before merging? [Update] |
Given that the commits add unwanted behaviour then revert it, I think it'd be better to squash that out of the history completely. 👍 |
The connector now leverages the latest connector-sdk features such as allowing multiple event topic subscriptions (delimited with ",") and printing invokation responses via the `controller.Subscribe` interface (implemented by `events.NewEventReceiver()`. The controller uses a 10 second `RebuildInterval` (sync function subscriptions) and 15 second `UpstreamTimeout` for invoking functions. The controller uses asynchronous invocation mode to not block on slow/long-running functions. Function comments are line-wrapped. Updates to Gopkg.toml to use the latest releases for imported packages: - connector-sdk 0.5.3 - openfaas-cloud 0.11.10 - govmomi 0.21.0 Build successfully tested against VMware vCenter 6.7U3 and OpenFaaS faas-netes commit b14f727. README updated covering the recent changes. Signed-off-by: Michael Gasch <[email protected]>
I just want to leave a final comment here on async invocation. I think async is the way to go for this connector to not limit throughput. However, I came across this issue openfaas/faas#1298 where I think the author is correct and this behavior could cause issues especially when troubleshooting. The only information the connector receives upon function invocation is basically the err status of the underlying http call ( [1] E.g. (to be) deleted during rolling upgrade or not accepting new connections |
TopicAnnotationDelimiter: topicDelimiter, | ||
RebuildInterval: time.Second * 10, | ||
UpstreamTimeout: time.Second * 15, | ||
AsyncFunctionInvocation: true, // don't block when invoking long-running/heavy functions, higher throughput |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMHO this needs to. be configurable as in, the user should decide.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approved, but please make the async invocation an optional 12-factor configuration via environment variable.
Thx @alexellis
Good point. I can file a follow-up commit making async optional via Given that Let me know if this works and I'll create a PR. |
Description
The connector now leverages the latest connector-sdk features such as
allowing multiple event topic subscriptions (delimited with ",") and
printing invokation responses via the
controller.Subscribe
interface(implemented by
events.NewEventReceiver()
.The controller uses a 5 second
RebuildInterval
(sync functionsubscriptions) and 3 second
UpstreamTimeout
for invoking functions tonot block too long.
Function comments are line-wrapped.
Updates to Gopkg.toml to use the latest releases for imported packages:
Fixes #33
Motivation and Context
design/approved
labelHow Has This Been Tested?
[1]
Output of
vcenter-connector
:Output of
of-echo
:Types of changes
Checklist:
git commit -s
Signed-off-by: Michael Gasch [email protected]