-
Notifications
You must be signed in to change notification settings - Fork 228
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 routes API #603
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
39fb439
to
f476d23
Compare
Generally looks good, but can we call it |
@treeder Sure, why not. |
77a35a7
to
6862a43
Compare
6862a43
to
ebe7be7
Compare
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.
I am 👎 this because I really think has not been thought through.
Now, instead of one timeouts, there are two. And one private constant, that most likely had a very good reason to be private, is now converted into a part of a public interface.
Also, lacking documentation about the use of this attribute and its impact in the behavior of the machinery - before, it has a predictable behavior, now, no one will actually know how it will behave.
@ccirello So, yes, there are two timeouts, and it doesn't look like something bad or confusing. One timeout is for function call, and the idle timeout defines for how long to keep hot function around without serving requests for it. You're saying that it was not thought through, i tend to disagree on this, because it's not clear why hardcoded 30s timeout is exact timeout that every hot function should wait without processing requests before becoming "cold". |
@denismakogon - makes sense to a point.
Without context, I doubt people will know the difference between timeout and idle_timeout. This could be easily addressed with documentation though - as of now, however, docs are missing.
Indeed, it is not clear the reason behind 30s. However, whenever we change a constant to a variable, we are changing the behavior of the system. So what you are saying is that the user needs it - which I am fine with - and that this reason alone is enough to justify this change as it is right now. I did not see anywhere any consideration of the consequences of this change: it does not define min and max boundaries, does not explain the consequence of too short or too long idle timeouts, it seems to address the zero case implicitly (for instance, it is not self-evident for me what happens if this idle_timeout is zero); also I do not see in the source code the interaction between this field being updated in the DB while the hot functions are still running. Again, I am not against the goal of this change - but this implementation of this change is lacking in many aspects. A middle-way here would be to merge this as it is, and open a batch of tickets addresses its deficiencies. |
@ccirello I agree on documentation as well as with edge cases. I'll make next PR with docs that explicitly describes all possible cases for idle time and its combinations with regular timeout. |
The docs should be part of this PR, agree with @ccirello . Not complete without docs. |
@treeder doc is already here. Check last 2 commits. |
@ccirello ok now with docs? |
@denismakogon @treeder LGTM |
* Add inactivity_timeout to routes API Closes: iron-io#544 * Fix failing datastore tests * Rename inactivity_timeout to idle_timeout * Update swagger doc * Update hot fn doc * Fix json tags * Add function timeouts docs * Rewording
Adding
inactivity_timeout
to routes API.This change will allow users to define idle timeout for hot functions via API instead of having it hardcoded in
worker.go
.Closes: #554