Skip to content

Commit

Permalink
Add trace to h2 for try_h2 test flakyness
Browse files Browse the repository at this point in the history
  • Loading branch information
estk committed May 10, 2018
1 parent 839d647 commit 13594f4
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/proto/h2/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ where
pub(crate) fn new(io: T, service: S, exec: Exec) -> Server<T, S, B> {
let handshake = Builder::new()
.handshake(io);
trace!("h2::Server::new handshake");
Server {
exec,
state: State::Handshaking(handshake),
Expand All @@ -71,15 +72,19 @@ where
type Error = ::Error;

fn poll(&mut self) -> Poll<Self::Item, Self::Error> {
trace!("h2::Server::poll");
loop {
let next = match self.state {
State::Handshaking(ref mut h) => {
trace!("h2::Server::poll state = handshake");
let conn = try_ready!(h.poll().map_err(::Error::new_h2));
trace!("h2::Server::poll state => serving");
State::Serving(Serving {
conn: conn,
})
},
State::Serving(ref mut srv) => {
trace!("h2::Server::poll state = serving");
return srv.poll_server(&mut self.service, &self.exec);
}
};
Expand All @@ -102,6 +107,7 @@ where
S::Error: Into<Box<::std::error::Error + Send + Sync>>,
S::Future: Send + 'static,
{
trace!("h2::Serving::poll_server state = serving");
while let Some((req, respond)) = try_ready!(self.conn.poll().map_err(::Error::new_h2)) {
trace!("incoming request");
let req = req.map(::Body::h2);
Expand Down

0 comments on commit 13594f4

Please sign in to comment.