Skip to content

External App-Driven Execution Model Clean up Issues #5126

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

Open
3 of 4 tasks
nibanks opened this issue May 28, 2025 · 1 comment · May be fixed by #5127
Open
3 of 4 tasks

External App-Driven Execution Model Clean up Issues #5126

nibanks opened this issue May 28, 2025 · 1 comment · May be fixed by #5127
Assignees
Milestone

Comments

@nibanks
Copy link
Member

nibanks commented May 28, 2025

Describe the bug

With the latest external execution APIs, cleanup has issues. If any objects still have references internally then MsQuic waits for them to be cleaned up in both RegistrationClose and MsQuicClose. For external execution, this creates a deadlock because there might not be a different thread to run and drain any clean up work queued during these calls.

For instance, RegistrationClose may trigger async shutdown of any leftover connections, and then wait. MsQuicClose cleans up the stateless registration and datapath, both of which might queue other cleanup work; and then it waits.

Affected OS

  • Windows
  • Linux
  • macOS
  • Other (specify below)

Additional OS information

No response

MsQuic version

main

Steps taken to reproduce bug

Run a single threaded handshake test (server and client local) and then try to clean up.

Expected behavior

Cleanup should succeed.

Actual outcome

Depending on the situation, one of the MsQuic APIs hangs indefinitely.

Additional details

No response

@nibanks nibanks added this to the Future milestone May 28, 2025
@nibanks
Copy link
Member Author

nibanks commented May 28, 2025

I've been thinking about this problem, and I think the solution is that we must expose async clean up (with completion callbacks) APIs for registrations and the API overall.

My idea: RegistrationCloseAsync and MsQuicCloseAsync with take a completion function pointer (and context pointer). These APIs effectively do the same thing as the synchronous APIs, but instead of waiting (usually on rundowns) they will return; then when the rest completes the callback functions will be called (very last thing, even after everything is freed).

@Copilot Copilot AI linked a pull request May 28, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: No status
Development

Successfully merging a pull request may close this issue.

1 participant