Skip to content

Commit

Permalink
add 1.15 based release branch (envoyproxy#575)
Browse files Browse the repository at this point in the history
* Revert "test: shard http2_integration_test (envoyproxy#11939)"

This reverts commit 2026ec2.

* Revert "fuzz: added fuzz test for listener filter original_dst (envoyproxy#11847)"

This reverts commit 673cab8.

* Revert "docs: updating release instructions (envoyproxy#11938)"

This reverts commit 09b96a5.

* Revert "test: remove superfluous test dependencies (envoyproxy#11912)"

This reverts commit 5e9fb8a.

* Revert "dynamic_forward_proxy: cleanup integration test (envoyproxy#11891)"

This reverts commit 11a4667.

* Revert "preliminary PR to Porting Envoy to C++17 (envoyproxy#11840)"

This reverts commit 9ad964d.

* Revert "connection: Do not reset delayed closed timer if doWrite consumes 0 bytes from the output buffer. (envoyproxy#11833)"

This reverts commit 5960533.

* Revert "threadlocal: avoiding a dynamic cast in opt builds (envoyproxy#11900)"

This reverts commit 363b104.

* Revert "release: kicking off 1.16.0 (envoyproxy#11930)"

This reverts commit ef74d8f.

Signed-off-by: Lizan Zhou <lizan@tetrate.io>
  • Loading branch information
lizan authored Jul 20, 2020
1 parent daedee6 commit a1b8c4f
Show file tree
Hide file tree
Showing 48 changed files with 300 additions and 524 deletions.
28 changes: 5 additions & 23 deletions GOVERNANCE.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,20 +88,18 @@ or you can subscribe to the iCal feed [here](https://app.opsgenie.com/webcal/get
* Switch the [VERSION](VERSION) from a "dev" variant to a final variant. E.g., "1.6.0-dev" to
"1.6.0".
* Get a review and merge.
* Wait for tests to pass on [master](https://dev.azure.com/cncf/envoy/_build).
* Create a [tagged release](https://github.com/envoyproxy/envoy/releases). The release should
start with "v" and be followed by the version number. E.g., "v1.6.0". **This must match the
[VERSION](VERSION).**
* From the envoy [landing page](https://github.com/envoyproxy/envoy) use the branch drop-down to create a branch
from the tagged release, e.g. "release/v1.6". It will be used for the
* Create a branch from the tagged release, e.g. "release/v1.6". It will be used for the
[stable releases](RELEASES.md#stable-releases).
* Monitor the AZP tag build to make sure that the final docker images get pushed along with
the final docs. The final documentation will end up in the
[envoyproxy.github.io repository](https://github.com/envoyproxy/envoyproxy.github.io/tree/master/docs/envoy).
* Update the website ([example PR](https://github.com/envoyproxy/envoyproxy.github.io/pull/148)) for the new release.
* Craft a witty/uplifting email and send it to all the email aliases including envoy-announce@.
* Make sure we tweet the new release: either have Matt do it or email social@cncf.io and ask them to do an Envoy account
post.
* If possible post on Twitter (either have Matt do it or contact caniszczyk@ on Slack and have the
Envoy account post).
* Do a new PR to setup the next version
* Update [VERSION](VERSION) to the next development release. E.g., "1.7.0-dev".
* `git mv docs/root/version_history/current.rst docs/root/version_history/v1.6.0.rst`, filling in the previous
Expand All @@ -114,24 +112,8 @@ or you can subscribe to the iCal feed [here](https://app.opsgenie.com/webcal/get
1.7.0 (Pending)
===============
Incompatible Behavior Changes
-----------------------------
*Changes that are expected to cause an incompatibility if applicable; deployment changes are likely required*
Minor Behavior Changes
----------------------
*Changes that may cause incompatibilities for some users, but should not for most*
Bug Fixes
---------
*Changes expected to improve the state of the world and are unlikely to have negative effects*
Removed Config or Runtime
-------------------------
*Normally occurs at the end of the* :ref:`deprecation period <deprecated>`
New Features
------------
Changes
-------
Deprecated
----------
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.16.0-dev
1.15.0
145 changes: 143 additions & 2 deletions docs/root/version_history/current.rst

Large diffs are not rendered by default.

166 changes: 0 additions & 166 deletions docs/root/version_history/v1.15.0.rst

This file was deleted.

1 change: 0 additions & 1 deletion docs/root/version_history/version_history.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ Version history
:titlesonly:

current
v1.15.0
v1.14.3
v1.14.2
v1.14.1
Expand Down
1 change: 0 additions & 1 deletion include/envoy/runtime/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ envoy_cc_library(
external_deps = ["abseil_optional"],
deps = [
"//include/envoy/stats:stats_interface",
"//include/envoy/thread_local:thread_local_interface",
"//source/common/common:assert_lib",
"//source/common/singleton:threadsafe_singleton",
"@envoy_api//envoy/type/v3:pkg_cc_proto",
Expand Down
5 changes: 3 additions & 2 deletions include/envoy/runtime/runtime.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@

#include "envoy/common/pure.h"
#include "envoy/stats/store.h"
#include "envoy/thread_local/thread_local.h"
#include "envoy/type/v3/percent.pb.h"

#include "common/common/assert.h"
Expand Down Expand Up @@ -71,8 +70,10 @@ using RandomGeneratorPtr = std::unique_ptr<RandomGenerator>;
/**
* A snapshot of runtime data.
*/
class Snapshot : public ThreadLocal::ThreadLocalObject {
class Snapshot {
public:
virtual ~Snapshot() = default;

struct Entry {
std::string raw_string_value_;
absl::optional<uint64_t> uint_value_;
Expand Down
10 changes: 3 additions & 7 deletions include/envoy/thread_local/thread_local.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,10 @@ class Slot {

/**
* This is a helper on top of get() that casts the object stored in the slot to the specified
* type. Since the slot only stores pointers to the base interface, the static_cast operates
* in production for performance, and the dynamic_cast validates correctness in tests and debug
* builds.
* type. Since the slot only stores pointers to the base interface, dynamic_cast provides some
* level of protection via RTTI.
*/
template <class T> T& getTyped() {
ASSERT(std::dynamic_pointer_cast<T>(get()) != nullptr);
return *static_cast<T*>(get().get());
}
template <class T> T& getTyped() { return *std::dynamic_pointer_cast<T>(get()); }

/**
* Run a callback on all registered threads.
Expand Down
2 changes: 1 addition & 1 deletion source/common/formatter/substitution_formatter.cc
Original file line number Diff line number Diff line change
Expand Up @@ -424,7 +424,7 @@ class StreamInfoDurationFieldExtractor : public StreamInfoFormatter::FieldExtrac
}

private:
absl::optional<int64_t> extractMillis(const StreamInfo::StreamInfo& stream_info) const {
absl::optional<uint32_t> extractMillis(const StreamInfo::StreamInfo& stream_info) const {
const auto time = field_extractor_(stream_info);
if (time) {
return std::chrono::duration_cast<std::chrono::milliseconds>(time.value()).count();
Expand Down
2 changes: 1 addition & 1 deletion source/common/grpc/google_async_client_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ class GoogleAsyncStreamImpl : public RawAsyncStream,
// End-of-stream with no additional message.
PendingMessage() = default;

const absl::optional<grpc::ByteBuffer> buf_{};
const absl::optional<grpc::ByteBuffer> buf_;
const bool end_stream_{true};
};

Expand Down
9 changes: 3 additions & 6 deletions source/common/network/connection_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -645,18 +645,15 @@ void ConnectionImpl::onWriteReady() {
} else if ((inDelayedClose() && new_buffer_size == 0) || bothSidesHalfClosed()) {
ENVOY_CONN_LOG(debug, "write flush complete", *this);
if (delayed_close_state_ == DelayedCloseState::CloseAfterFlushAndWait) {
ASSERT(delayed_close_timer_ != nullptr && delayed_close_timer_->enabled());
if (result.bytes_processed_ > 0) {
delayed_close_timer_->enableTimer(delayed_close_timeout_);
}
ASSERT(delayed_close_timer_ != nullptr);
delayed_close_timer_->enableTimer(delayed_close_timeout_);
} else {
ASSERT(bothSidesHalfClosed() || delayed_close_state_ == DelayedCloseState::CloseAfterFlush);
closeConnectionImmediately();
}
} else {
ASSERT(result.action_ == PostIoAction::KeepOpen);
ASSERT(!delayed_close_timer_ || delayed_close_timer_->enabled());
if (delayed_close_timer_ != nullptr && result.bytes_processed_ > 0) {
if (delayed_close_timer_ != nullptr) {
delayed_close_timer_->enableTimer(delayed_close_timeout_);
}
if (result.bytes_processed_ > 0) {
Expand Down
4 changes: 3 additions & 1 deletion source/common/runtime/runtime_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,9 @@ struct RuntimeStats {
/**
* Implementation of Snapshot whose source is the vector of layers passed to the constructor.
*/
class SnapshotImpl : public Snapshot, Logger::Loggable<Logger::Id::runtime> {
class SnapshotImpl : public Snapshot,
public ThreadLocal::ThreadLocalObject,
Logger::Loggable<Logger::Id::runtime> {
public:
SnapshotImpl(RandomGenerator& generator, RuntimeStats& stats,
std::vector<OverrideLayerConstPtr>&& layers);
Expand Down
2 changes: 1 addition & 1 deletion source/common/upstream/outlier_detection_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class DetectorHostMonitorNullImpl : public DetectorHostMonitor {
double successRate(SuccessRateMonitorType) const override { return -1; }

private:
const absl::optional<MonotonicTime> time_{};
const absl::optional<MonotonicTime> time_;
};

/**
Expand Down
1 change: 0 additions & 1 deletion source/extensions/common/aws/credentials_provider.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#pragma once

#include <memory>
#include <string>

#include "envoy/common/pure.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ Http::FilterHeadersStatus Filter::encodeHeaders(Http::ResponseHeaderMap& headers
headers.setGrpcStatus(Envoy::Grpc::Status::WellKnownGrpcStatus::Unknown);
headers.setStatus(enumToInt(Http::Code::OK));

if (!content_type.empty()) {
if (content_type != nullptr) {
headers.setContentType(content_type_);
}

Expand Down
3 changes: 1 addition & 2 deletions test/common/config/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -430,8 +430,7 @@ envoy_cc_test(
"//source/common/protobuf:utility_lib",
"//source/extensions/common/crypto:utility_lib",
"//test/mocks/event:event_mocks",
"//test/mocks/init:init_mocks",
"//test/mocks/runtime:runtime_mocks",
"//test/mocks/server:server_mocks",
"//test/mocks/upstream:upstream_mocks",
"//test/test_common:utility_lib",
"@envoy_api//envoy/config/core/v3:pkg_cc_proto",
Expand Down
3 changes: 1 addition & 2 deletions test/common/config/datasource_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@
#include "common/protobuf/protobuf.h"

#include "test/mocks/event/mocks.h"
#include "test/mocks/init/mocks.h"
#include "test/mocks/runtime/mocks.h"
#include "test/mocks/server/mocks.h"
#include "test/mocks/upstream/mocks.h"
#include "test/test_common/utility.h"

Expand Down
4 changes: 3 additions & 1 deletion test/common/network/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ envoy_cc_test(
"//test/mocks/buffer:buffer_mocks",
"//test/mocks/event:event_mocks",
"//test/mocks/network:network_mocks",
"//test/mocks/server:server_mocks",
"//test/mocks/stats:stats_mocks",
"//test/test_common:environment_lib",
"//test/test_common:network_utility_lib",
Expand Down Expand Up @@ -188,10 +189,10 @@ envoy_cc_test(
"//source/common/network:listener_lib",
"//source/common/network:utility_lib",
"//source/common/stats:stats_lib",
"//source/common/stream_info:stream_info_lib",
"//test/common/network:listener_impl_test_base_lib",
"//test/mocks/network:network_mocks",
"//test/mocks/runtime:runtime_mocks",
"//test/mocks/server:server_mocks",
"//test/test_common:environment_lib",
"//test/test_common:network_utility_lib",
"//test/test_common:utility_lib",
Expand All @@ -212,6 +213,7 @@ envoy_cc_test(
"//source/common/stats:stats_lib",
"//test/common/network:listener_impl_test_base_lib",
"//test/mocks/network:network_mocks",
"//test/mocks/server:server_mocks",
"//test/test_common:environment_lib",
"//test/test_common:network_utility_lib",
"//test/test_common:threadsafe_singleton_injector_lib",
Expand Down
108 changes: 4 additions & 104 deletions test/common/network/connection_impl_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
#include "test/mocks/buffer/mocks.h"
#include "test/mocks/event/mocks.h"
#include "test/mocks/network/mocks.h"
#include "test/mocks/server/mocks.h"
#include "test/mocks/stats/mocks.h"
#include "test/test_common/environment.h"
#include "test/test_common/network_utility.h"
Expand Down Expand Up @@ -1454,11 +1455,6 @@ TEST_P(ConnectionImplTest, DelayedCloseTimerResetWithPendingWriteBufferFlushes)
std::make_unique<ConnectionSocketImpl>(std::move(io_handle), nullptr, nullptr),
std::move(mocks.transport_socket_), stream_info_, true);

#ifndef NDEBUG
// Ignore timer enabled() calls used to check timer state in ASSERTs.
EXPECT_CALL(*mocks.timer_, enabled()).Times(AnyNumber());
#endif

InSequence s1;
// The actual timeout is insignificant, we just need to enable delayed close processing by
// setting it to > 0.
Expand All @@ -1480,115 +1476,19 @@ TEST_P(ConnectionImplTest, DelayedCloseTimerResetWithPendingWriteBufferFlushes)

// The write ready event cb (ConnectionImpl::onWriteReady()) will reset the timer to its
// original timeout value to avoid triggering while the write buffer is being actively flushed.
EXPECT_CALL(*transport_socket, doWrite(BufferStringEqual("data"), _))
.WillOnce(Invoke([&](Buffer::Instance& buffer, bool) -> IoResult {
// Partial flush.
uint64_t bytes_drained = 1;
buffer.drain(bytes_drained);
return IoResult{PostIoAction::KeepOpen, bytes_drained, false};
}));
EXPECT_CALL(*mocks.timer_, enableTimer(timeout, _)).Times(1);
(*mocks.file_ready_cb_)(Event::FileReadyType::Write);

EXPECT_CALL(*transport_socket, doWrite(BufferStringEqual("ata"), _))
.WillOnce(Invoke([&](Buffer::Instance& buffer, bool) -> IoResult {
// Flush the entire buffer.
uint64_t bytes_drained = buffer.length();
buffer.drain(buffer.length());
return IoResult{PostIoAction::KeepOpen, bytes_drained, false};
}));
EXPECT_CALL(*mocks.timer_, enableTimer(timeout, _)).Times(1);
(*mocks.file_ready_cb_)(Event::FileReadyType::Write);

// Force the delayed close timeout to trigger so the connection is cleaned up.
mocks.timer_->invokeCallback();
}

// Test that the delayed close timer is not reset by spurious fd Write events that either consume 0
// bytes from the output buffer or are delivered after close(FlushWriteAndDelay).
TEST_P(ConnectionImplTest, IgnoreSpuriousFdWriteEventsDuringFlushWriteAndDelay) {
ConnectionMocks mocks = createConnectionMocks();
MockTransportSocket* transport_socket = mocks.transport_socket_.get();
IoHandlePtr io_handle = std::make_unique<IoSocketHandleImpl>(0);
auto server_connection = std::make_unique<Network::ConnectionImpl>(
*mocks.dispatcher_,
std::make_unique<ConnectionSocketImpl>(std::move(io_handle), nullptr, nullptr),
std::move(mocks.transport_socket_), stream_info_, true);

#ifndef NDEBUG
// Ignore timer enabled() calls used to check timer state in ASSERTs.
EXPECT_CALL(*mocks.timer_, enabled()).Times(AnyNumber());
#endif

InSequence s1;
// The actual timeout is insignificant, we just need to enable delayed close processing by
// setting it to > 0.
auto timeout = std::chrono::milliseconds(100);
server_connection->setDelayedCloseTimeout(timeout);

EXPECT_CALL(*mocks.file_event_, activate(Event::FileReadyType::Write))
.WillOnce(Invoke(*mocks.file_ready_cb_));
EXPECT_CALL(*transport_socket, doWrite(BufferStringEqual("data"), _))
.WillOnce(Invoke([&](Buffer::Instance&, bool) -> IoResult {
// Do not drain the buffer and return 0 bytes processed to simulate backpressure.
return IoResult{PostIoAction::KeepOpen, 0, false};
}));
Buffer::OwnedImpl data("data");
server_connection->write(data, false);

EXPECT_CALL(*mocks.timer_, enableTimer(timeout, _)).Times(1);
server_connection->close(ConnectionCloseType::FlushWriteAndDelay);

// The write ready event cb (ConnectionImpl::onWriteReady()) will reset the timer to its
// original timeout value to avoid triggering while the write buffer is being actively flushed.
EXPECT_CALL(*transport_socket, doWrite(BufferStringEqual("data"), _))
.WillOnce(Invoke([&](Buffer::Instance& buffer, bool) -> IoResult {
// Partial flush.
uint64_t bytes_drained = 1;
buffer.drain(bytes_drained);
return IoResult{PostIoAction::KeepOpen, bytes_drained, false};
return IoResult{PostIoAction::KeepOpen, 1, false};
}));
EXPECT_CALL(*mocks.timer_, enableTimer(timeout, _)).Times(1);
(*mocks.file_ready_cb_)(Event::FileReadyType::Write);

// Handle a write event and drain 0 bytes from the buffer. Verify that the timer is not reset.
EXPECT_CALL(*transport_socket, doWrite(BufferStringEqual("ata"), _))
.WillOnce(Invoke([&](Buffer::Instance&, bool) -> IoResult {
// Don't consume any bytes.
return IoResult{PostIoAction::KeepOpen, 0, false};
}));
EXPECT_CALL(*mocks.timer_, enableTimer(timeout, _)).Times(0);
(*mocks.file_ready_cb_)(Event::FileReadyType::Write);

// Handle a write event and drain the remainder of the buffer. Verify that the timer is reset.
EXPECT_CALL(*transport_socket, doWrite(BufferStringEqual("ata"), _))
EXPECT_CALL(*transport_socket, doWrite(BufferStringEqual("data"), _))
.WillOnce(Invoke([&](Buffer::Instance& buffer, bool) -> IoResult {
// Flush the entire buffer.
ASSERT(buffer.length() > 0);
uint64_t bytes_drained = buffer.length();
buffer.drain(buffer.length());
EXPECT_EQ(server_connection->state(), Connection::State::Closing);
return IoResult{PostIoAction::KeepOpen, bytes_drained, false};
}));
EXPECT_CALL(*mocks.timer_, enableTimer(timeout, _)).Times(1);
(*mocks.file_ready_cb_)(Event::FileReadyType::Write);

// Handle a write event after entering the half-closed state. Verify that the timer is not reset
// because write consumed 0 bytes from the empty buffer.
EXPECT_CALL(*transport_socket, doWrite(BufferStringEqual(""), _))
.WillOnce(Invoke([&](Buffer::Instance&, bool) -> IoResult {
EXPECT_EQ(server_connection->state(), Connection::State::Closing);
return IoResult{PostIoAction::KeepOpen, 0, false};
}));
EXPECT_CALL(*mocks.timer_, enableTimer(timeout, _)).Times(0);
(*mocks.file_ready_cb_)(Event::FileReadyType::Write);

// Handle a write event that somehow drains bytes from an empty output buffer. Since
// some bytes were consumed, the timer is reset.
EXPECT_CALL(*transport_socket, doWrite(BufferStringEqual(""), _))
.WillOnce(Invoke([&](Buffer::Instance&, bool) -> IoResult {
EXPECT_EQ(server_connection->state(), Connection::State::Closing);
return IoResult{PostIoAction::KeepOpen, 1, false};
return IoResult{PostIoAction::KeepOpen, buffer.length(), false};
}));
EXPECT_CALL(*mocks.timer_, enableTimer(timeout, _)).Times(1);
(*mocks.file_ready_cb_)(Event::FileReadyType::Write);
Expand Down
2 changes: 1 addition & 1 deletion test/common/network/listener_impl_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
#include "common/network/address_impl.h"
#include "common/network/listener_impl.h"
#include "common/network/utility.h"
#include "common/stream_info/stream_info_impl.h"

#include "test/common/network/listener_impl_test_base.h"
#include "test/mocks/network/mocks.h"
#include "test/mocks/server/mocks.h"
#include "test/test_common/environment.h"
#include "test/test_common/network_utility.h"
#include "test/test_common/test_runtime.h"
Expand Down
1 change: 1 addition & 0 deletions test/common/network/udp_listener_impl_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
#include "test/common/network/listener_impl_test_base.h"
#include "test/mocks/api/mocks.h"
#include "test/mocks/network/mocks.h"
#include "test/mocks/server/mocks.h"
#include "test/test_common/environment.h"
#include "test/test_common/network_utility.h"
#include "test/test_common/threadsafe_singleton_injector.h"
Expand Down
1 change: 1 addition & 0 deletions test/extensions/clusters/aggregate/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ envoy_extension_cc_test(
"//test/integration:http_integration_lib",
"//test/integration:integration_lib",
"//test/mocks/runtime:runtime_mocks",
"//test/mocks/server:server_mocks",
"//test/test_common:network_utility_lib",
"//test/test_common:resources_lib",
"//test/test_common:utility_lib",
Expand Down
Loading

0 comments on commit a1b8c4f

Please sign in to comment.