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
Happy eyeballs fixes #1928
Happy eyeballs fixes #1928
Conversation
The timer should be started after conn->connecttime is set. Otherwise the timer could expire without this condition being true: /* should we try another protocol family? */ if(i == 0 && conn->tempaddr[1] == NULL && curlx_tvdiff(now, conn->connecttime) >= HAPPY_EYEBALLS_TIMEOUT) {
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.
Ugh, nice catch!
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.
You'll need to edit symbols-in-versions
too and add a man page for the new option. I think this option makes perfect sence and I'm +1 on adding it, but the new option needs to wait for the feature window after the pending release but the bugfix part can be cherry-picked already now.
I added docs and updated symbols-in-versions. I assumed 7.55.3 for the version. Is that correct? Thanks. |
The timer should be started after conn->connecttime is set. Otherwise the timer could expire without this condition being true: /* should we try another protocol family? */ if(i == 0 && conn->tempaddr[1] == NULL && curlx_tvdiff(now, conn->connecttime) >= HAPPY_EYEBALLS_TIMEOUT) { Ref: #1928
I cherry-picked the first commit into master now, see 49d75a4 |
@Andersbakken: If you can rebase this and fix the conflicts, we can work on merging this PR! |
I have two patches for happy eyeballs.
3e50c6a
Fixes a race condition that can happen if the thread running libcurl gets preempted at certain times.
The following can happen:
thread is stalled a little bit:
singleipconnect is called at 3 ms
conn->connecttime is set to 3ms
curl_multi_perform is called at 201 ms,
struct curltime now = Curl_tvnow(); is set to 201
Curl_is_connected is called at 201 ms.
This statement is false:
curlx_tvdiff(now, conn->connecttime) >= HAPPY_EYEBALLS_TIMEOUT) {
curl_multi_perform removes the happy eyeballs timer since 201 >= 200 with this statement:
multi->timetree = Curl_splaygetbest(now, multi->timetree, &t);
The timer never fires.
ed1fb2d
adds a feature to set customize the 200ms delay for happy eyeballs to whatever one wants.