Skip to content

chore(server): Remove unnecessary await service ready #2258

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

Merged
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
6 changes: 1 addition & 5 deletions tonic/src/transport/server/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ use hyper::{body::Incoming, service::Service as HyperService};
use pin_project::pin_project;
use std::{
fmt,
future::{self, poll_fn, Future},
future::{self, Future},
marker::PhantomData,
net::SocketAddr,
pin::{pin, Pin},
Expand Down Expand Up @@ -725,10 +725,6 @@ impl<L> Server<L> {

trace!("connection accepted");

poll_fn(|cx| svc.poll_ready(cx))
.await
.map_err(super::Error::from_source)?;

Comment on lines -728 to -731
Copy link
Member

Choose a reason for hiding this comment

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

technically speaking a user can pass in a service that requires calling poll_ready so removing this could break that? I don't think we need to actually remove this?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Whatever service users pass in will not affect this process. This process does not process the user's service.

let req_svc = svc
.call(&io)
.await
Expand Down
Loading