-
Notifications
You must be signed in to change notification settings - Fork 4
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
Avoid a memory leak in Excon #1167
Conversation
# connection object to the Nomis API for each Thread. This is to make an | ||
# Excon connection thread safe. | ||
# | ||
# For example if Puma runs with 4 threads, and those threads reuse a |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"and those threads reusing"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think my version is right. @KPobeeNorris can you clarify the English grammar rules in this case?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe that Alan's original comment is the correct case; just need to change the spelling of 'effectively'.
app/services/nomis/client.rb
Outdated
# | ||
# This cache is unnecessary in our case since: | ||
# - we ensure thread safety by using a connection pool | ||
# - we end up opening more sockets than necessary (25 vs 5) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you provide more details, this isn't really clear why
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Better?
84e48fb
to
b92ddb3
Compare
b92ddb3
to
9a176b3
Compare
9a176b3
to
54228e2
Compare
54228e2
to
fe67b56
Compare
Current version of Excon has a memory leak when threads using an Excon connection get destroyed. Applies same fix as ministryofjustice/prison-visits-public#346 The memory leak in pvb2 is slower because Puma is configured to use less threads so they probably get recycled less often. Also sets a constant number of threads for Puma in production as we do in pvb-public.
Current version of Excon has a memory leak when threads using an Excon
connection get destroyed.
Applies same fix as
ministryofjustice/prison-visits-public#346
The memory leak in pvb2 is slower because Puma is configured to use less threads
so they probably get recycled less often.
Also sets a constant number of threads for Puma in production as we do in
pvb-public.