Skip to content
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

Channel#watchConnectivityState: handle infinite deadlines correctly #1553

Merged

Conversation

SimonWoolf
Copy link
Contributor

Docs say they should work: https://grpc.github.io/grpc/node/grpc.html#~Deadline : "If it is a finite number, it is treated as a number of milliseconds since the Unix Epoch. If it is Infinity, the deadline will never be reached. If it is -Infinity, the deadline has already passed". Previously the Infinity case didn't work (was coerced into an invalid date, which ended up as a timeout of NaN, which is called ~immediately).

(The -Infinity case sortof did work by accident since the callback being called immediately is basically the correct behaviour for that, but I've made it a bit more explicit)

Per https://grpc.github.io/grpc/node/grpc.html#~Deadline:
"If it is a finite number, it is treated as a number of milliseconds
since the Unix Epoch. If it is Infinity, the deadline will never be
reached. If it is -Infinity, the deadline has already passed."
@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented Aug 21, 2020

CLA Check
The committers are authorized under a signed CLA.

Copy link
Member

@murgatroid99 murgatroid99 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the fix.

@murgatroid99 murgatroid99 merged commit 2111c0f into grpc:master Aug 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants