-
Notifications
You must be signed in to change notification settings - Fork 160
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
Adding checklist for candidate validation #42
Conversation
75516e9
to
9c4ffd6
Compare
From a quick review, it looks good to me. I guess this PR does not address adding a new prflx "local" candidate. Correct? (I guess that would be the next step after this) |
@enobufs 🤔 not sure what you mean by prflx local candidate |
It's related to things we talked about earlier around "we should check (xor-)mapped address in the binding-response message".. so that we can have a complete list of local candidates that would include prflx candidate also. Say if you have this srflx candidate as your local candidate.
Later, you may find a new prflx candidate from the binding-response:
I believe doing this does not affect "connectivity" (nor checklist because these share the same related addr...), but it may help later in selection logic (I think prflx is preferred more than srflx, etc) and diagnostic purpose (you can tell which candidate(mapped-addr) is actually being used(valid/nominated), etc) |
@enobufs oh yes, you are right: https://github.com/pion/ice/blob/master/candidatetype.go#L35 didn't realise that, I thought it was just a useful debugging property. |
dd64a69
to
ae90131
Compare
TestTimeout is failing on my mac...(rev @ae901)
|
@enobufs yes, that's a known issue, also happens with master. Fails on mac and not on linux, not sure why (I never actually checked) |
I see. I don't know exactly what the testing is testing, but as it says, |
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.
Other than the timeout test failure (appears to be a separate issue), the changes look good to me.
ae90131
to
09800bb
Compare
This has been addressed in #49 ! |
9a85f5c
to
b056104
Compare
Codecov Report
@@ Coverage Diff @@
## master #42 +/- ##
==========================================
- Coverage 70.89% 68.89% -2.01%
==========================================
Files 20 20
Lines 1357 1469 +112
==========================================
+ Hits 962 1012 +50
- Misses 327 370 +43
- Partials 68 87 +19
Continue to review full report at Codecov.
|
agent.go
Outdated
@@ -215,6 +228,41 @@ func NewAgent(config *AgentConfig) (*Agent, error) { | |||
} | |||
a.haveStarted.Store(false) | |||
|
|||
a.maxBindingRequests = config.MaxBindingRequests |
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.
Fantastic work!
Would you mind moving the defaultValues into const
values?
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.
done!
Amazing work @hugoArregui ! This is an approve from me, would you mind just moving the 'default values' into constants. Just easier for people to audit/twiddle that way. Beyond that I am gonna go home and play with this a little bit, but it is a approve from me :) |
b056104
to
eef2260
Compare
This implements a basic validation schema using a checklist. We try every pair at least maxTries, and mark it as failed if we don't get a success response after that many requests. Once we get a success response, we check if it belongs to the best candidate available so far, if it does we nominate it, otherwise we continue. Also, after a given timeout, if no candidate has been nominated, we simply choose the best valid candidate we got so far (if no candidate is valid, we mark the connection as failed). Finally, the nomination request also has a maximum of maxTries, we mark the connection as failed if after that many attempt we fail to get a success response.
eef2260
to
17870a0
Compare
Add helper function to add localCandidates. Brings down the duplication and make sure we have a properly formed checklist when we are doing trickle. When comparing candidates in findPair do by value, and not address. Before some candidates were failing to be found because of this.
Fixes #35
This implements a basic validation schema using a checklist. We try every pair at least maxTries (7 by default see #35), and mark it as failed if we don't get a success response after that many requests. Once we get a success response, we check if it belongs to the best candidate available so far, if it does we nominate it, otherwise we continue.
Also, after a given timeout, if no candidate has been nominated, we simply choose the best valid candidate we got so far (if no candidate is valid, we mark the connection as failed).
Finally, the nomination request also has a maximum of maxTries, we mark the connection as failed if after that many attempt we fail to get a success response.