Skip to content

grpc: Clean up initialization and allocation of timers in the test#4226

Merged
htuch merged 2 commits intoenvoyproxy:masterfrom
jmarantz:timer-allocation-cleanup
Aug 23, 2018
Merged

grpc: Clean up initialization and allocation of timers in the test#4226
htuch merged 2 commits intoenvoyproxy:masterfrom
jmarantz:timer-allocation-cleanup

Conversation

@jmarantz
Copy link
Copy Markdown
Contributor

Signed-off-by: Joshua Marantz jmarantz@google.com

Description: The management of the timer_ variable in the test class was a little funky, and looked leak-prone. This PR cleans this up a little,. Without this PR, #4180 memory-leaks on this test, I think due to overwriting timer_. This is all toward resolution of #4160

Risk Level: Low.
Testing: //test/common/config:grpc_mux_impl_test
Docs Changes: n/a
Release Notes: n/a

Signed-off-by: Joshua Marantz <jmarantz@google.com>
@jmarantz
Copy link
Copy Markdown
Contributor Author

@htuch ptal; this should be easy.

@htuch htuch self-assigned this Aug 22, 2018
Grpc::MockAsyncClient* async_client_;
Event::MockTimer* timer_;
Event::TimerCb timer_cb_;
Event::MockTimer* timer_; // Only used by ResetStream
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This looks like a nice cleanup. Can you just move these two variables to be local to ResetStream? This will make reasoning even simpler.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

done.

Signed-off-by: Joshua Marantz <jmarantz@google.com>
@jmarantz
Copy link
Copy Markdown
Contributor Author

Anything else needed before you merge?

@htuch htuch merged commit 78ad2ef into envoyproxy:master Aug 23, 2018
@jmarantz jmarantz deleted the timer-allocation-cleanup branch August 23, 2018 20:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants