Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

conn: Return non-zero delay when in CONNECTING state #1908

Closed
wants to merge 1 commit into from

Conversation

rikonen
Copy link
Contributor

@rikonen rikonen commented Sep 25, 2019

If connection is in state CONNECTING and there is data ready to be sent
using value 0 for the delay results in busy loop because Sender calls
select with the value returned from here and then just keeps on calling
it again and again until connection completes or fails. In some cases
this can take a long time and if the connection failed it will just be
retried and the busy loop continues.

This return value was changed from 999999999 to 0 in commit 16c13f9 and
it doesn't look like it needs to be exactly zero for other logic to work
correctly.

Fixes #1907


This change is Reviewable

If connection is in state CONNECTING and there is data ready to be sent
using value 0 for the delay results in busy loop because Sender calls
select with the value returned from here and then just keeps on calling
it again and again until connection completes or fails. In some cases
this can take a long time and if the connection failed it will just be
retried and the busy loop continues.

This return value was changed from 999999999 to 0 in commit 16c13f9 and
it doesn't look like it needs to be exactly zero for other logic to work
correctly.

Fixes dpkp#1907
@dpkp
Copy link
Owner

dpkp commented Sep 28, 2019

Going to close in favor of #1909 -- I think we can just rely on the selector to wake on the socket buffer becoming writeable, and not introduce a new configuration option.

@dpkp dpkp closed this Sep 28, 2019
@dpkp
Copy link
Owner

dpkp commented Sep 28, 2019

Thanks for the issue report + PR though -- this is a great catch!

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Sender may busy loop when connection is in CONNECTING state
2 participants