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

Update metrics & ema before breaking the connection loop #4414

Merged
merged 2 commits into from
Jan 14, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions streamer/src/nonblocking/quic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1167,6 +1167,8 @@ async fn handle_connection(
CONNECTION_CLOSE_CODE_INVALID_STREAM.into(),
CONNECTION_CLOSE_REASON_INVALID_STREAM,
);
stats.total_streams.fetch_sub(1, Ordering::Relaxed);
stream_load_ema.update_ema_if_needed();

Choose a reason for hiding this comment

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

PR says update metrics but this is a logic change?

Copy link
Author

Choose a reason for hiding this comment

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

This is to restore the logic which is was broken in commit: 2be7c2e. We need to do the correct bookkeeping of the total_streams and ema before breaking the connection loop. For example,
we did the following

    stats.total_streams.fetch_add(1, Ordering::Relaxed);

before the inner loop.

After the inner loop, we need to correct these counters.
The direct break to the outer loop cause these to be missed.

Choose a reason for hiding this comment

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

Yep, I understand. What I'm saying is that the PR title says "update metrics" but the most important thing in this PR is arguably updating the EMA.

Having both changes in the same PR is fine of course, but please update PR/commit to reflect what's actually being changed. Also we're backporting this to 2.1 yeah?

Copy link
Author

Choose a reason for hiding this comment

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

okay -- updated the title to include ema.

break 'conn;
}
}
Expand Down
Loading