-
Notifications
You must be signed in to change notification settings - Fork 5.3k
overload: scale transport socket connect timeout #13800
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
Changes from all commits
abcdb84
f5b8d56
7d28234
5d0d600
76cd8c4
2f169bf
0c1cf92
3376062
927ea02
68e62d4
9d85d8a
29ea543
f52c76e
a5ccd82
18f6022
4ca4b11
ee93040
ddad3e5
9be6e8f
475253b
2f2ed9f
6ad33cf
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4,6 +4,7 @@ | |
|
|
||
| #include "envoy/common/platform.h" | ||
| #include "envoy/config/core/v3/base.pb.h" | ||
| #include "envoy/event/scaled_range_timer_manager.h" | ||
| #include "envoy/network/address.h" | ||
|
|
||
| #include "common/api/os_sys_calls_impl.h" | ||
|
|
@@ -403,7 +404,10 @@ TEST_P(ConnectionImplTest, SetServerTransportSocketTimeout) { | |
| // Avoid setting noDelay on the fake fd of 0. | ||
| auto local_addr = std::make_shared<Network::Address::PipeInstance>("/pipe/path"); | ||
|
|
||
| auto* mock_timer = new NiceMock<Event::MockTimer>(mocks.dispatcher_.get()); | ||
| auto* mock_timer = new NiceMock<Event::MockTimer>(); | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. i wonder if this would result into memory leak, wrap in std::make_unique?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It gets returned by the EXPECT_CALL on line 363, which wraps it in a unique_ptr. |
||
| EXPECT_CALL(*mocks.dispatcher_, | ||
| createScaledTypedTimer_(Event::ScaledTimerType::TransportSocketConnectTimeout, _)) | ||
| .WillOnce(DoAll(SaveArg<1>(&mock_timer->callback_), Return(mock_timer))); | ||
| auto server_connection = std::make_unique<Network::ServerConnectionImpl>( | ||
| *mocks.dispatcher_, | ||
| std::make_unique<ConnectionSocketImpl>(std::move(io_handle), local_addr, nullptr), | ||
|
|
@@ -442,7 +446,10 @@ TEST_P(ConnectionImplTest, ServerTransportSocketTimeoutDisabledOnConnect) { | |
| IoHandlePtr io_handle = std::make_unique<IoSocketHandleImpl>(0); | ||
| auto local_addr = std::make_shared<Network::Address::PipeInstance>("/pipe/path"); | ||
|
|
||
| auto* mock_timer = new NiceMock<Event::MockTimer>(mocks.dispatcher_.get()); | ||
| auto* mock_timer = new NiceMock<Event::MockTimer>(); | ||
| EXPECT_CALL(*mocks.dispatcher_, | ||
| createScaledTypedTimer_(Event::ScaledTimerType::TransportSocketConnectTimeout, _)) | ||
| .WillOnce(DoAll(SaveArg<1>(&mock_timer->callback_), Return(mock_timer))); | ||
| auto server_connection = std::make_unique<Network::ServerConnectionImpl>( | ||
| *mocks.dispatcher_, | ||
| std::make_unique<ConnectionSocketImpl>(std::move(io_handle), local_addr, nullptr), | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.