Removes manual establish_connection in interceptor #209
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.
What?
Removes manual
establish_connection
from the interceptor. It seems like it was added here to support Rails 5.Why?
connection.active?
for each request and subsequently attempting toestablish_connection
, we are currently raising an exception (Can't connect to MySQL server
etc.) in the interceptor before we can execute theCheck
inside health check endpoints. That seems incorrect.How was it tested?
It has been tested against 3 rails versions
[6.1, 7.0, 7.1]
using gruf-demo repo. In all three tests, we have a gruf server running and rake task provided in the demo repo is used to exercise the GRPC service that executes sql queries.I've recorded videos for testing against all 3 versions. We can see in the tests that sql query gets executed as expected and we are able to view results from the DB without manual connection establishment that comes from the interceptor.
Rails-6-1-ruby-3.1.2-gruf.mov
Rails-7-0-ruby-3.1.2-gruf.mov
Rails-7-1-ruby-3.1.2-gruf.mov