Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Translate Trilogy syscall errors as conn failed
At GitHub we get a fair number of Trilogy `ETIMEDOUT` errors (for known reasons that we might be able to improve somewhat, but I doubt we'll make them go away entirely). These are very much retryable network errors, so it'd be handy if these `ETIMEDOUT` errors were translated to `ConnectionFailed` instead of `StatementInvalid`, making them `retryable_connection_error`s. https://github.com/rails/rails/blob/ed2bc92b82ddc111150cdf48bb646fd97b3baacb/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb#L1077 We're already translating `ECONNRESET` (via matching on the error message) and `EPIPE` to `ConnectionFailed`. Rather than adding another case, this commit treats all of the Trilogy `SystemCallError` subclasses as `ConnectionFailed`. This commit also drops `TRILOGY_INVALID_SEQUENCE_ID`, `TRILOGY_UNEXPECTED_PACKET` as `ConnectionFailed`. These are not transient network errors we might want to retry. These are MySQL client/server protocol errors, likely indicating something we need to fix in Trilogy. We should be able to simplify this exception translation further once we bump the required Trilogy version to 2.6, but I figured I'd start out with this minimal change that works on Trilogy 2.4 as well.
- Loading branch information