Skip to content

Fixes environment-dependent failures in MixerFaultTest#2144

Merged
duderino merged 1 commit intoistio:release-1.1from
dmitri-d:fix-happy-path
Mar 22, 2019
Merged

Fixes environment-dependent failures in MixerFaultTest#2144
duderino merged 1 commit intoistio:release-1.1from
dmitri-d:fix-happy-path

Conversation

@dmitri-d
Copy link
Contributor

@dmitri-d dmitri-d commented Mar 7, 2019

What this PR does / why we need it:
Fixes intermittent/environment-dependent failures in MixerFaultTest. Please see https://github.com/istio/proxy/issues/2124.

Special notes for your reviewer:
The failures were due to lambda parameter in ServerCallbackHelper::ServerCallbackHelper going out of scope.

@googlebot googlebot added the cla: yes Set by the Google CLA bot to indicate the author of a PR has signed the Google CLA. label Mar 7, 2019
@istio-testing istio-testing requested review from JimmyCYJ and linsun March 7, 2019 03:42
@dmitri-d
Copy link
Contributor Author

dmitri-d commented Mar 7, 2019

close_callback_(close_callback) {
if (request_callback) {
request_callback_ = [this, &request_callback](
instrumented_request_callback_ = [this](
Copy link

Choose a reason for hiding this comment

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

Ah! Super cool. I wonder if an equivalent fix would have been to capture the request_callback lambda by value?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Didn't think of that, brain == fried. definitely worth a try!

Copy link
Contributor

Choose a reason for hiding this comment

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

Great catch! If you fllow @duderino advice, could you try capture using expression? It might cost less while absolutely never more expensive. Something like

request_callback_ = [this, request_callback = std::move(request_callback) ](

@duderino
Copy link

duderino commented Mar 7, 2019

@dmitri-d thank you so much for fixing my bug. I really appreciate it.

Technically, I can't merge this until after 1.1 goes out. https://discuss.istio.io/t/istio-1-1-lockdown-release-status/1275 . Let me talk to the other admins and see if the no merge rule applies to test cases. Seems like it shouldn't but....

Also, if not merging this for a week or so has any adverse impact for you please let me know.

/lgtm

@istio-testing
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: dmitri-d, duderino

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@knrc
Copy link

knrc commented Mar 7, 2019

@duderino this shouldn't impact us, we'll apply it locally until it gets merged.

@dmitri-d
Copy link
Contributor Author

dmitri-d commented Mar 7, 2019

@duderino: updated to pass callbacks to lambdas by value as you suggested.

@dmitri-d
Copy link
Contributor Author

dmitri-d commented Mar 8, 2019

/retest

1 similar comment
@dmitri-d
Copy link
Contributor Author

dmitri-d commented Mar 8, 2019

/retest

@dmitri-d
Copy link
Contributor Author

The fix has been merged into master, closing the PR here.

@dmitri-d dmitri-d closed this Mar 20, 2019
@duderino duderino reopened this Mar 22, 2019
@duderino
Copy link

It'd be nice to have this in 1.1 too for subsequent 1.1.x releases, so reopening it. Thanks @dmitri-d

@duderino duderino merged commit 9d52640 into istio:release-1.1 Mar 22, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla: yes Set by the Google CLA bot to indicate the author of a PR has signed the Google CLA.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants