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

ConnectionState dropped before HTTP request is finished #1467

Closed
dinhani opened this issue Oct 3, 2024 · 1 comment · Fixed by #1468
Closed

ConnectionState dropped before HTTP request is finished #1467

dinhani opened this issue Oct 3, 2024 · 1 comment · Fixed by #1468

Comments

@dinhani
Copy link
Contributor

dinhani commented Oct 3, 2024

I noticed the ConnectionState struct is being dropped before the request is finished when executing HTTP requests.

I have a custom middleware that uses the ConnectionGuard exposed via request extensions, and the number of active requests returned was 0 when it was supposed to be 1.

After some investigation, I found the conn instance is held active only for websocket requests, but for HTTP requests handled in the else branch, it is not used, causing the ConnectionState and the semaphore permit to be dropped before the request finished executing.

@niklasad1
Copy link
Member

Yes, you are correct.

Let's inject it in the box future stuff for the else if and else branches

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 a pull request may close this issue.

2 participants