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

Timeout pairs after not receiving data for long enough #40

Merged
merged 2 commits into from
May 7, 2024
Merged

Conversation

mickel8
Copy link
Member

@mickel8 mickel8 commented May 6, 2024

This PR:

  • timeouts pairs if they don't receive any data for long enough (5 seconds)
  • sets end-of-candidates flag after 10 seconds (this is chosen arbitrarly) starting from calling set_remote_credentials (see RFC 8863)
  • converts selected_pair into selected_pair_id
  • renames handle_timeout to handle_ta_timeout

@mickel8 mickel8 force-pushed the keepalive branch 2 times, most recently from 3f5070d to b920bce Compare May 6, 2024 16:24
Copy link

codecov bot commented May 6, 2024

Codecov Report

Attention: Patch coverage is 71.30435% with 33 lines in your changes are missing coverage. Please review.

Project coverage is 81.06%. Comparing base (fcf31c9) to head (befbe87).

❗ Current head befbe87 differs from pull request most recent head 7ed7cac. Consider uploading reports for the commit 7ed7cac to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##           master      #40      +/-   ##
==========================================
+ Coverage   80.63%   81.06%   +0.43%     
==========================================
  Files          25       25              
  Lines        1301     1368      +67     
==========================================
+ Hits         1049     1109      +60     
- Misses        252      259       +7     
Files Coverage Δ
lib/ex_ice/priv/candidate_pair.ex 63.63% <100.00%> (ø)
lib/ex_ice/priv/conn_check_handler/controlling.ex 78.26% <100.00%> (+10.07%) ⬆️
lib/ex_ice/ice_agent.ex 46.80% <33.33%> (-2.09%) ⬇️
lib/ex_ice/priv/ice_agent.ex 84.56% <80.28%> (+0.42%) ⬆️
lib/ex_ice/priv/conn_check_handler/controlled.ex 53.84% <48.48%> (+3.84%) ⬆️

... and 1 file with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update fcf31c9...7ed7cac. Read the comment docs.

@mickel8 mickel8 force-pushed the keepalive branch 9 times, most recently from 79428be to c114308 Compare May 6, 2024 18:03
@mickel8 mickel8 requested a review from LVala May 6, 2024 18:11
defp timeout_pairs(ice_agent, [pair | pairs], now) do
if now - pair.last_seen >= @pair_timeout do
Logger.debug("""
Pair: #{pair.id} didn't receive any data in #{@pair_timeout}ms. \
Copy link
Member

Choose a reason for hiding this comment

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

Maybe better to log the now - pair.last_seen instead of @pair_timeout?

In theory we could go almost twice as long as @pair_timeout without marking it as failed (which is fine, I think), so I can think of a case when this might be a bit misleading.

Edit: Now I see that your're checking every div(@pair_timeout, 2) but I think the point still stands, I guess?

@mickel8 mickel8 merged commit 273a77e into master May 7, 2024
2 checks passed
@mickel8 mickel8 deleted the keepalive branch May 7, 2024 08:03
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.

2 participants