-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Vendor libpq5.12.1 into Slugs - Heroku 18 only #936
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Libpq is the client library used to communicate to postgresql. There was a bug in libpq 5.11 that essentially said if there is a problem with a configuration value, for example if you tried to set `pool` (which should be an integer) to a string, then the value would be silently ignored. In libpq 5.12 this behavior was "fixed" so that if you try to set a value to an incorrect type it will raise an error: ``` PG::UnableToSend: no connection to the server ``` Or ``` CONNECTION_BAD ``` Here is the commit that changed the behavior postgres/postgres@e7a2217 The largest failure mode is when someone accidentally forgets to put a space after their ERB tag in `database.yml` but before their comment. For example: ``` connect_timeout: <%= ENV['DB_CONNECT_TIMEOUT'] || 5 %># seconds ``` Would be evaluated to a string of "5# seconds". This will work in libpq5.11 but fail in libpq5.12. This can be fixed by adding a space between `%>` and `# seconds`. This change was rolled out on our stack image, but then rolled back to customers getting failures in the middle of the night when they had seemingly changed nothing. By vendoring this library in the slug, we have more control around when the update will happen. Rather than breaking changes when the stack image rolls out which might happen in the middle of the night for some developers, this change will only be applied as customers are deploying their apps. If they have a release phase then the error will likely be caught there and prevented from going into production. This behavior introduces a helpful warning message along with URLs for getting more information around this issue. We do not anticipate that a majority of applications will be affected by this change, however those that are affected experience large problems. The intent of rolling this change out in a buildpack is to minimize the exposure of apps that will trigger this failing condition. Eventually libpq5.12.1 will be the default version on the stack. This change works to prepare developers for that change.
e2faeef
to
a8cb5cb
Compare
edmorley
approved these changes
Dec 10, 2019
Adding a cache `fetch` method that will only trigger on the first time it is executed and sees that the key does not exist in the cache. Using this to only warn on the first deploy.
Filed https://gus.my.salesforce.com/a07B00000079prxIAA for removing the vendoring now that the stack image has the latest libpq :-) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Pick up from the work in #935 but removing Heroku-16 support until we can get that working in Docker locally
https://github.com/schneems/libpq_heroku_16_reproduction/tree/schneems/manually-download-install
(Note it's a branch)