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

Add New Listener Callback for DoS Mode #4868

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open

Conversation

vgmahajanshetty
Copy link
Contributor

@vgmahajanshetty vgmahajanshetty commented Feb 27, 2025

Description

Resolved #3717.
To support health probe, added new event for listeners. This event will be triggered for all opted in listeners.

Testing

Did basic tests manually.

Documentation

Is there any documentation impact for this change?

Copy link

codecov bot commented Feb 27, 2025

Codecov Report

Attention: Patch coverage is 93.61702% with 3 lines in your changes missing coverage. Please review.

Project coverage is 86.11%. Comparing base (90fd241) to head (1775e91).
Report is 10 commits behind head on main.

Files with missing lines Patch % Lines
src/core/listener.c 88.88% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4868      +/-   ##
==========================================
- Coverage   86.27%   86.11%   -0.17%     
==========================================
  Files          56       56              
  Lines       17630    17677      +47     
==========================================
+ Hits        15211    15223      +12     
- Misses       2419     2454      +35     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@vgmahajanshetty vgmahajanshetty marked this pull request as ready for review February 28, 2025 15:56
@vgmahajanshetty vgmahajanshetty requested a review from a team as a code owner February 28, 2025 15:56
@vgmahajanshetty vgmahajanshetty enabled auto-merge (squash) February 28, 2025 15:56
@nibanks nibanks changed the title 3717: Support health probe Add New Listener Callback for DoS Mode Mar 3, 2025
TEST_QUIC_SUCCEEDED(ClientConfiguration.GetInitStatus());

QuicAddr ServerLocalAddr(QuicAddrFamily);
MsQuicAutoAcceptListener Listener(Registration, ServerConfiguration, MsQuicConnection::NoOpCallback);
Copy link
Member

Choose a reason for hiding this comment

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

The listener needs to validate it actually received the expected event.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

Copy link
Member

Choose a reason for hiding this comment

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

I don't see any code handling the callback event.

Comment on lines +833 to +835
MsQuicLib.HandshakeMemoryLimit =
(MsQuicLib.Settings.RetryMemoryLimit * CxPlatTotalMemory) / UINT16_MAX;
QuicLibraryEvaluateSendRetryState();
Copy link
Member

Choose a reason for hiding this comment

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

Can we put this after the log below please? It might help with debugging in the future.

Comment on lines +214 to +215


Copy link
Member

Choose a reason for hiding this comment

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

Suggested change

Comment on lines +1524 to +1527
case IOCTL_QUIC_RUN_RETRY_MEMORY_LIMIT_CONNECT:
CXPLAT_FRE_ASSERT(Params != nullptr);
QuicTestCtlRun(QuicTestRetryMemoryLimitConnect(Params->Family));
break;
Copy link
Member

@nibanks nibanks Mar 3, 2025

Choose a reason for hiding this comment

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

Suggested change
case IOCTL_QUIC_RUN_RETRY_MEMORY_LIMIT_CONNECT:
CXPLAT_FRE_ASSERT(Params != nullptr);
QuicTestCtlRun(QuicTestRetryMemoryLimitConnect(Params->Family));
break;
case IOCTL_QUIC_RUN_RETRY_MEMORY_LIMIT_CONNECT:
CXPLAT_FRE_ASSERT(Params != nullptr);
QuicTestCtlRun(QuicTestRetryMemoryLimitConnect(Params->Family));
break;

Comment on lines +3488 to +3489


Copy link
Member

Choose a reason for hiding this comment

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

Suggested change

Comment on lines +3482 to +3487
TEST_QUIC_SUCCEEDED(
MsQuic->SetParam(
Listener.Handle,
QUIC_PARAM_DOS_MODE_EVENTS,
sizeof(buffer),
&buffer));
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
TEST_QUIC_SUCCEEDED(
MsQuic->SetParam(
Listener.Handle,
QUIC_PARAM_DOS_MODE_EVENTS,
sizeof(buffer),
&buffer));
TEST_QUIC_SUCCEEDED(
MsQuic->SetParam(
Listener.Handle,
QUIC_PARAM_DOS_MODE_EVENTS,
sizeof(buffer),
&buffer));

Comment on lines +3499 to +3500


Copy link
Member

Choose a reason for hiding this comment

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

Suggested change

Comment on lines +3465 to +3470
TEST_QUIC_SUCCEEDED(
MsQuic->SetParam(
NULL,
QUIC_PARAM_GLOBAL_RETRY_MEMORY_PERCENT,
sizeof(RetryMemoryLimit),
&RetryMemoryLimit));
Copy link
Member

Choose a reason for hiding this comment

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

You should set this after you create the listener to trigger the event.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support health probe
2 participants