You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using trilogy >= 2.5.0 with Vitess and connected to a vtgate (the proxy that mysql clients connect to), trilogy raises trilogy_query_recv: SSL Error: (null) (Trilogy::SSLError) when the vtgate shuts down and closes the connection on the server side. This issue did not occur in Trilogy v2.4.1, which raised trilogy_query_recv: TRILOGY_CLOSED_CONNECTION (Trilogy::QueryError).
This error makes it hard for clients to know whether they should reconnect and retry the query.
e.g. with 2.6.0
irb(main):001:0> vtgate_client = Trilogy.new(host: "127.0.0.1", port: 23306, ssl: true, ssl_mode: Trilogy::SSL_REQUIRED_NOVERIFY)
=> #<Trilogy:0x00007f855c19eb30 @connection_options={:host=>"127.0.0.1", :port=>23306, :ssl=>true, :ssl_mode=>3}>
# vtgate is stopped
irb(main):002:0> vtgate_client.query("SELECT 1")
(irb):2:in `query': trilogy_query_recv: SSL Error: (null) (Trilogy::SSLError)
from (irb):2:in `<main>'
from /opt/rubies/ruby-3.1.4-pshopify1/lib/ruby/gems/3.1.0/gems/irb-1.4.1/exe/irb:11:in `<top (required)>'
from /usr/local/bin/irb:25:in `load'
from /usr/local/bin/irb:25:in `<main>'
mysql2 raises this as a Mysql2::Error::ConnectionError, e.g.
irb(main):002:0> mysql2_vtgate_client = Mysql2::Client.new(host: "127.0.0.1", port: 23306, ssl_mode: :required)
=>
#<Mysql2::Client:0x00007f275fcd7480
# vtgate is stopped
irb(main):003:0> mysql2_vtgate_client.query("SELECT 1")
/home/spin/.local/share/gem/ruby/3.1.0/gems/mysql2-0.5.5/lib/mysql2/client.rb:151:in `_query': Lost connection to MySQL server during query (Mysql2::Error::ConnectionError)
from /home/spin/.local/share/gem/ruby/3.1.0/gems/mysql2-0.5.5/lib/mysql2/client.rb:151:in `block in query'
from /home/spin/.local/share/gem/ruby/3.1.0/gems/mysql2-0.5.5/lib/mysql2/client.rb:150:in `handle_interrupt'
from /home/spin/.local/share/gem/ruby/3.1.0/gems/mysql2-0.5.5/lib/mysql2/client.rb:150:in `query'
from (irb):3:in `<main>'
from /opt/rubies/ruby-3.1.4-pshopify1/lib/ruby/gems/3.1.0/gems/irb-1.4.1/exe/irb:11:in `<top (required)>'
from /usr/local/bin/irb:25:in `load'
from /usr/local/bin/irb:25:in `<main>'
Running a git bisect, it looks like this behavior was introduced in #112
If you're interested in reproducing locally, I've added an SSL-enabled vtgate to docker-compose.yml in this branch.
The text was updated successfully, but these errors were encountered:
Thanks for the report and especially reproduction! We may have had the desired behaviour prior to #112, but that would have been due to a bug (two wrongs making a right 😅) and may not have been consistent (it relied on us attempting to read/write on that closed connection after we'd seen an error).
Also worth noting is that in Trilogy 2.6.0 TRILOGY_CLOSED_CONNECTION now has a proper error class Trilogy::EOFError instead of the generic Trilogy::QueryError, hope that helps 😊!
When using trilogy >= 2.5.0 with Vitess and connected to a vtgate (the proxy that mysql clients connect to), trilogy raises
trilogy_query_recv: SSL Error: (null) (Trilogy::SSLError)
when the vtgate shuts down and closes the connection on the server side. This issue did not occur in Trilogy v2.4.1, which raisedtrilogy_query_recv: TRILOGY_CLOSED_CONNECTION (Trilogy::QueryError)
.This error makes it hard for clients to know whether they should reconnect and retry the query.
e.g. with 2.6.0
mysql2 raises this as a
Mysql2::Error::ConnectionError
, e.g.Running a
git bisect
, it looks like this behavior was introduced in #112If you're interested in reproducing locally, I've added an SSL-enabled vtgate to docker-compose.yml in this branch.
The text was updated successfully, but these errors were encountered: