-
Notifications
You must be signed in to change notification settings - Fork 227
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
add idle_timeout to fn tool #663
Conversation
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.
LGTM 👍
I tested it with your command and func.yaml way and both of them succeeded.
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.
Looks good to me too.
Any chance to cover this with an autotest ?
Thanks ! Yes I am looking at providing some test coverage. Might take a while ! |
I added tests for setting Regarding the test I posted go code above, it actually tests hot functions spin down behaviour, which is beyond the scope of this PR. This PR only deals with setting |
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.
Looks good to me.
Thanks for tests!
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.
Thank you! LGTM 👍
@@ -43,6 +43,7 @@ type Funcfile struct { | |||
Memory *int64 `yaml:"memory,omitempty" json:"memory,omitempty"` | |||
Format *string `yaml:"format,omitempty" json:"format,omitempty"` | |||
Timeout *time.Duration `yaml:"timeout,omitempty" json:"timeout,omitempty"` | |||
IDLETimeout *time.Duration `yaml:"idle_timeout,omitempty" json:"idle_timeout,omitempty"` |
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.
nits: I think IdleTimeout is better than IDLETimeout.
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.
Yes but unfortunately it is defined as IDLETimeout
in functions_go (which is auto generated). I am not sure why it capitalizes.
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.
Oh, so it's no problem.
Thanks 👍
I'm checking your hotfunction example and trying to make it running on my environment. And find this post , it seems you guys are working on it . Let me know when there's a patch of fn cmd. Just let you guys know my result. Thanks again. |
@sss0350 Thanks for the response ! Yes, this is actually ready to go, so setting Regarding UI, we already added it but it is not released yet. We will combine a couple of feature requests for UI and release a new version soon (hopefully in a couple of weeks) ! |
I just get it a quick try this afternoon at my office, I can set idle_timeout from cmd.
And trigger your hot function examples ( https://github.com/iron-io/functions/tree/master/examples/hotfunctions/http ), but find the containers still not keep alive within 30s. |
Yes, it should be alive for the duration of idle timeout. You can see if it's being killed in the server logs. Can you see anything there? |
It seems fn tool doesn't support setting
idle_timeout
param for hot function routes.https://github.com/iron-io/functions/blob/master/docs/function-timeouts.md
https://github.com/iron-io/functions/blob/master/docs/hot-functions.md
To test, create an app, and a route with :
modify hot-functions func.go to look something like :
to keep a passed value, and print both when there is a request. Then you can call the function with :
You should see previous call in the second call output.
after a while, you should see the hot func spin down in the service logs
without this patch (and setting
idle_timeout
) the function spins down immediately after serving the response.