Skip to content
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

Use local variables in rack middleware to prevent instance state changes #151

Merged
merged 2 commits into from
Mar 25, 2020

Conversation

bumi
Copy link
Contributor

@bumi bumi commented Mar 3, 2020

see: #150

@bumi bumi requested review from kangguru and DonSchado March 3, 2020 18:31
Copy link
Collaborator

@DonSchado DonSchado left a comment

Choose a reason for hiding this comment

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

@bumi
Copy link
Contributor Author

bumi commented Mar 11, 2020

@kspe @kangguru what do you think? can we merge this? I think such a fix should be released asap!

@kspe
Copy link
Contributor

kspe commented Mar 11, 2020

I'm only unsure about @handlers variable which is still there.

@bumi
Copy link
Contributor Author

bumi commented Mar 19, 2020

@DonSchado handlers should not have request state, do they?

@DonSchado @kangguru can we either merge this one or #150 and release a new patch version?

@DonSchado
Copy link
Collaborator

because I'm not completely sure and don't have the time to investigate this further, maybe then we merge #150 because @kspe already know's that it works. :) ack?

@bumi
Copy link
Contributor Author

bumi commented Mar 21, 2020

then let's merge both. those instance variables for sure should not be there. And then we got the dup also in - not sure what that does to memory consumption, but we will see.

@kspe
Copy link
Contributor

kspe commented Mar 21, 2020

not sure what that does to memory consumption, but we will see.

After deploying this change to prod we did not see any significant increase in memory usage (which was a bit surprising given this happens on each request). It might be this object is very lightweight and is garbage collected quite efficiently but I haven't done a detailed analysis of it.

@bumi
Copy link
Contributor Author

bumi commented Mar 21, 2020

ok, that's good to hear! thanks for that.
@DonSchado ok? do you want to go ahead with both PRs and release a new patch? <3

@DonSchado DonSchado merged commit f599f71 into master Mar 25, 2020
@DonSchado DonSchado deleted the local-vars-in-middleware branch March 25, 2020 05:58
@DonSchado
Copy link
Collaborator

new version released

jclusso added a commit to cacheventures/rack-tracker that referenced this pull request Mar 29, 2020
…session

* railslove/master:
  version up
  Use local variables in rack middleware to prevent instance state changes (railslove#151)
  Make middleware thread safe
jclusso added a commit to cacheventures/rack-tracker that referenced this pull request Apr 17, 2021
* railslove/master:
  Use leftmost match to inject head to avoid one line html bug
  version up
  Use local variables in rack middleware to prevent instance state changes (railslove#151)
  Make middleware thread safe
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.

3 participants