From dff2a1995063b29f3338a0be8cfd4bb11609a1a3 Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Sun, 22 Nov 2015 15:23:18 +0900 Subject: [PATCH 1/4] nghttpx: Don't send RST_STREAM to h2 backend if backend is disconnected state This avoid establishing HTTP/2 backend connection again w/o pending request. See GH-431 --- src/shrpx_http2_downstream_connection.cc | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/src/shrpx_http2_downstream_connection.cc b/src/shrpx_http2_downstream_connection.cc index 8a9a216f..d5674f73 100644 --- a/src/shrpx_http2_downstream_connection.cc +++ b/src/shrpx_http2_downstream_connection.cc @@ -67,14 +67,8 @@ Http2DownstreamConnection::~Http2DownstreamConnection() { error_code = NGHTTP2_INTERNAL_ERROR; } - if (downstream_->get_downstream_stream_id() != -1) { - if (LOG_ENABLED(INFO)) { - DCLOG(INFO, this) << "Submit RST_STREAM for DOWNSTREAM:" << downstream_ - << ", stream_id=" - << downstream_->get_downstream_stream_id() - << ", error_code=" << error_code; - } - + if (http2session_->get_state() == Http2Session::CONNECTED && + downstream_->get_downstream_stream_id() != -1) { submit_rst_stream(downstream_, error_code); http2session_->consume(downstream_->get_downstream_stream_id(), @@ -143,7 +137,8 @@ int Http2DownstreamConnection::submit_rst_stream(Downstream *downstream, if (LOG_ENABLED(INFO)) { DCLOG(INFO, this) << "Submit RST_STREAM for DOWNSTREAM:" << downstream << ", stream_id=" - << downstream->get_downstream_stream_id(); + << downstream->get_downstream_stream_id() + << ", error_code=" << error_code; } rv = http2session_->submit_rst_stream( downstream->get_downstream_stream_id(), error_code); From e95ad297ed7be75ced9bd37804293334c36fbfb0 Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Mon, 23 Nov 2015 14:58:17 +0900 Subject: [PATCH 2/4] travis: Enable integration tests and neverbleed We added spdylay build since integration tests require it. --- .travis.yml | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 1dee67b8..7239bd90 100644 --- a/.travis.yml +++ b/.travis.yml @@ -27,12 +27,26 @@ before_install: - $CC --version - if [ "$CXX" = "g++" ]; then export CXX="g++-4.9" CC="gcc-4.9"; fi - $CC --version + - go version before_script: + # First build spdylay, since integration tests require it. + # spdylay is going to be built under third-party/spdylay + - cd third-party + - git clone https://github.com/tatsuhiro-t/spdylay.git + - cd spdylay + - autoreconf -i + - ./configure --disable-src --disable-examples + - make check + - export SPDYLAY_HOME=$PWD + - cd ../.. + # Now build nghttp2 - autoreconf -i - - automake - - autoconf - git submodule update --init - - ./configure --enable-werror --with-mruby + - ./configure --enable-werror --with-mruby --with-neverbleed LIBSPDYLAY_CFLAGS="-I$SPDYLAY_HOME/lib/includes" LIBSPDYLAY_LIBS="-L$SPDYLAY_HOME/lib/.libs -lspdylay" script: - make - make check + - cd integration-tests + - export GOPATH="$PWD/integration-tests/golang" + - make itprep-local + - make it-local From 718f7a5f7e1c0772df75974ebe7f1d18ba16bedb Mon Sep 17 00:00:00 2001 From: Kit Chan Date: Mon, 23 Nov 2015 09:58:38 +0000 Subject: [PATCH 3/4] h2load goes into infinite loop when timing script file starts with 0.0 in first line --- src/h2load.cc | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/h2load.cc b/src/h2load.cc index 9e9c9bcb..32ea3704 100644 --- a/src/h2load.cc +++ b/src/h2load.cc @@ -742,10 +742,14 @@ int Client::connection_made() { break; } duration = config.timings[reqidx]; + if(reqidx == 0) //if reqidx wraps around back to 0, we uses up all lines and should break + break; } - request_timeout_watcher.repeat = duration; - ev_timer_again(worker->loop, &request_timeout_watcher); + if (duration >= 1e-9) { //double check since we may have break due to reqidx wraps around back to 0 + request_timeout_watcher.repeat = duration; + ev_timer_again(worker->loop, &request_timeout_watcher); + } } signal_write(); From 84e23bff10e03fffcfac112d2e8092efadbbdfa2 Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Mon, 23 Nov 2015 20:05:40 +0900 Subject: [PATCH 4/4] h2load: clang-format --- src/h2load.cc | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/h2load.cc b/src/h2load.cc index 32ea3704..13fe4cbd 100644 --- a/src/h2load.cc +++ b/src/h2load.cc @@ -742,11 +742,16 @@ int Client::connection_made() { break; } duration = config.timings[reqidx]; - if(reqidx == 0) //if reqidx wraps around back to 0, we uses up all lines and should break + if (reqidx == 0) { + // if reqidx wraps around back to 0, we uses up all lines and + // should break break; + } } - if (duration >= 1e-9) { //double check since we may have break due to reqidx wraps around back to 0 + if (duration >= 1e-9) { + // double check since we may have break due to reqidx wraps + // around back to 0 request_timeout_watcher.repeat = duration; ev_timer_again(worker->loop, &request_timeout_watcher); }