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

Bail out of the loop when the stub Input stream is done #231

Merged
merged 2 commits into from Dec 18, 2018

Conversation

Projects
None yet
5 participants
@chaosbox
Copy link
Contributor

chaosbox commented Oct 17, 2018

This PR fixes

  • the OOM caused by unnecessary creation of timer objects even after the request/response is completed.
    Find pprof attached that shows before and after the fix.

Before:
image

After:
image

@xthexder

This comment has been minimized.

Copy link
Collaborator

xthexder commented Oct 17, 2018

Thanks for the fix! < 2MB is definitely a much more reasonable amount of memory usage.

I'll take a closer look later tonight and get this merged.

@chaosbox chaosbox referenced this pull request Oct 18, 2018

Open

Out of Memory Error #232

@fantayeneh

This comment has been minimized.

Copy link

fantayeneh commented Oct 24, 2018

Ola @xthexder, can we merge this?

@chaosbox

This comment has been minimized.

Copy link
Contributor

chaosbox commented Nov 9, 2018

@jpittis @xthexder
hi guys,
any feedback on this PR?
thanks

@jpittis
Copy link
Collaborator

jpittis left a comment

This LGTM.

@pgeorgiev333

This comment has been minimized.

Copy link

pgeorgiev333 commented Dec 17, 2018

Can you guys merge this and create a new release? This is pretty important as we cannot simulate network failures for longer periods of time.
Thanks in advance

case <-stub.Input:
case c := <-stub.Input:
if c == nil {
return

This comment has been minimized.

@jpittis

jpittis Dec 17, 2018

Collaborator

I'm pretty sure this needs a stub.Close().

@probot-shopify probot-shopify bot added the cla-needed label Dec 17, 2018

@jpittis

This comment has been minimized.

Copy link
Collaborator

jpittis commented Dec 17, 2018

So I'm pretty sure this is good to merge now.

Any chance you can sanity check @xthexder?

Unfortunately, our company recently rolled out this contributor license agreement stuff so I can't merge this until the original contributor has clicked through the agreement. @chaosbox

I'm so sorry this has taken so long to ship, I'll release this as soon as we merge.

@chaosbox

This comment has been minimized.

Copy link
Contributor

chaosbox commented Dec 17, 2018

@jpittis I have accepted the CLA for the emailID tied to my public github account.

@jpittis

This comment has been minimized.

Copy link
Collaborator

jpittis commented Dec 17, 2018

I think you're going to have to change your commit to be authored by the same public email.

@xthexder

This comment has been minimized.

Copy link
Collaborator

xthexder commented Dec 17, 2018

This looks good to me.
I haven't really had much time to look over Toxiproxy recently, I may try to find some time over the holidays to do a pass and fix any outstanding issues.

@xthexder xthexder self-requested a review Dec 17, 2018

@chaosbox chaosbox force-pushed the chaosbox:timeout_toxic_creates_unnecessary_timers branch from 11d4968 to 1390d99 Dec 18, 2018

@probot-shopify probot-shopify bot removed the cla-needed label Dec 18, 2018

@jpittis jpittis merged commit 7eb6f30 into Shopify:master Dec 18, 2018

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment