-
Notifications
You must be signed in to change notification settings - Fork 763
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 fix for deadline of strings, NaN, Infinity and -Infinity #556
Conversation
In response to issue #554 |
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.
Sorry for the delaying in reviewing this.
Actually, in the gRPC protocol definition, if Timeout is omitted, it's assumed to be Infinite. So what we should be doing here is that, in L215, if "Infinity" is passed in, just don't set the "grpc-timeout" header. Does it make sense?
No problem, being an open source maintainer is tough work!
I think then that defaulting to |
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.
Thanks for the contributions and the updates.
This will change
Infinity
toMath.pow(2, 53) - 1
(Number.MAX_SAFE_INTEGER
in ES6, see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/MAX_SAFE_INTEGER). Anything that becomesNaN
will be discarded (for example setting deadline to a string orNaN
),-Infinity
will also be discarded.I don't know if it is best to let bad values for deadlines slip past silently or not...