-
Notifications
You must be signed in to change notification settings - Fork 172
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
fix(server): count http calls in connection guard #1468
Conversation
server/src/server.rs
Outdated
let rp = http::response::denied(); | ||
drop(conn); | ||
Box::pin(async { Ok(rp) }) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess this is just a tidy up and isn't changing any semantics right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yupp, it was to make it more verbose that it wasn't any async code but I can revert it if you want.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added a comment for this instead. I'm not super happy with the drop stuff here because it's easy to mess up but fine for now.
let rp = | ||
http::call_with_service(request, batch_config, max_request_size, rpc_service, max_response_size) | ||
.await; | ||
drop(conn); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And this is the main bit; droping here to pull it into the async function after the await.
Perhaps worth a comment to make clear we are dropping it for this reaosn?
Close #1467
The ConnectionGuard was dropped before actually waiting for the http future to resolved which this fixes by enforcing RpcService to take ownership of ConnectionState.