Removes manual establish_connection from the interceptor. It seems like it was added here to support Rails 5.
Why?
This should occur automatically if/when during the request processing in the grpc service, ActiveRecord is used to perform a query.
For when sql server is unavailable. By checking connection.active? for each request and subsequently attempting to establish_connection, we are currently raising an exception (Can't connect to MySQL server etc.) in the interceptor before we can execute the Check 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.
6.1 - commit that includes current PR as dependency.
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.
https://github.com/bigcommerce/gruf/assets/107909200/505a9f32-b14e-45fe-bb25-f838e5d3f105
https://github.com/bigcommerce/gruf/assets/107909200/4aeac637-8034-473c-a75f-33f7b6b59d80
https://github.com/bigcommerce/gruf/assets/107909200/39220841-0ad7-4b63-9e95-804200130bc5