{"payload":{"feedbackUrl":"https://github.com/orgs/community/discussions/53140","repo":{"id":80567043,"defaultBranch":"master","name":"rails","ownerLogin":"composerinteralia","currentUserCanPush":false,"isFork":true,"isEmpty":false,"createdAt":"2017-01-31T22:03:29.000Z","ownerAvatar":"https://avatars.githubusercontent.com/u/13696143?v=4","public":true,"private":false,"isOrgOwned":false},"refInfo":{"name":"","listCacheKey":"v0:1706291576.0","currentOid":""},"activityList":{"items":[{"before":"03248055e61577cc737ca9cc344691d67ce3a35f","after":"adfdbf8c29e488b68f60ab4f3cd30511c61e75bf","ref":"refs/heads/trilogy-error-translate","pushedAt":"2024-01-26T17:59:16.000Z","pushType":"force_push","commitsCount":0,"pusher":{"login":"composerinteralia","name":"Daniel Colson","path":"/composerinteralia","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/13696143?s=80&v=4"},"commit":{"message":"Clean up trilogy error translation\n\nThis commit makes a few changes to our trilogy error translation:\n\n* https://github.com/trilogy-libraries/trilogy/pull/118 introduced\n `Trilogy::EOFError` which we can use instead of matching on\n `TRILOGY_CLOSED_CONNECTION`.\n* https://github.com/trilogy-libraries/trilogy/pull/15 introduced\n `Trilogy::ConnectionClosed`, which inherits from `IOError` for\n backwards compatibility. As far as I can tell that's the only\n `IOError` trilogy can raise, so this commit rescues the\n trilogy-specific error instead.\n* As far as I can tell Trilogy does not raise `SocketError`, so don't\n bother translating that\n* Don't treat TRILOGY_UNEXPECTED_PACKET as a connection error. If we get\n this, it's probably a bug in trilogy that we should fix. I'd like to\n eventually get rid of TRILOGY_INVALID_SEQUENCE_ID too, but we're\n currently relying on it in a few tests (related to trilogy missing\n caching_sha2_password auth support, if I recall correctly)\n\nI'm kinda hoping we'll eventually be able to simplify this to something\nlike:\n\n```rb\nif exception.is_a?(Trilogy::ConnectionError)\n ConnectionFailed.new(message, connection_pool: @pool)\nelse\n super\nend\n```\n\nbut we'd need more changes to trilogy before that is possible.","shortMessageHtmlLink":"Clean up trilogy error translation"}},{"before":null,"after":"03248055e61577cc737ca9cc344691d67ce3a35f","ref":"refs/heads/trilogy-error-translate","pushedAt":"2024-01-26T17:52:56.000Z","pushType":"branch_creation","commitsCount":0,"pusher":{"login":"composerinteralia","name":"Daniel Colson","path":"/composerinteralia","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/13696143?s=80&v=4"},"commit":{"message":"Clean up trilogy error translation\n\nThis commit makes a few changes to our trilogy error translation:\n\n* https://github.com/trilogy-libraries/trilogy/pull/118 introduced\n `Trilogy::EOFError` which we can use instead of matching on\n `TRILOGY_CLOSED_CONNECTION`.\n* https://github.com/trilogy-libraries/trilogy/pull/15 introduced\n `Trilogy::ConnectionClosed`, which inherits from `IOError` for\n backwards compatibility. As far as I can tell that's the only\n `IOError` trilogy can raise, so this commit rescues the\n trilogy-specific error instead.\n* As far as I can tell Trilogy does not raise `SocketError`, so don't\n bother translating that\n* Don't treat TRILOGY_UNEXPECTED_PACKET as a connection error. If we get\n this, it's probably a bug in trilogy that we should fix. I'd like to\n eventually get rid of TRILOGY_INVALID_SEQUENCE_ID too, but we're\n currently relying on it in a few tests (related to trilogy missing\n caching_sha2_password auth support, if I recall correctly)\n\nI'm kinda hoping we'll eventually be able to simplify this to something\nlike:\n\n```rb\nif exception.is_a?(Trilogy::ConnectionError)\n ConnectionFailed.new(message, connection_pool: @pool)\nelse\n super\nend\n```\n\nbut we'd need more changes to trilogy before that is possible.","shortMessageHtmlLink":"Clean up trilogy error translation"}},{"before":null,"after":"c616fe29bef072b96cc8ac4f34e77782a51cb870","ref":"refs/heads/move-server-shutdown-translation","pushedAt":"2024-01-25T18:04:03.000Z","pushType":"branch_creation","commitsCount":0,"pusher":{"login":"composerinteralia","name":"Daniel Colson","path":"/composerinteralia","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/13696143?s=80&v=4"},"commit":{"message":"Move server shutdown translation to abstract mysql\n\n1053 is the server shutdown error code. We see these fairly often at\nGitHub when, for example, shutting down Vitess vtage processes for\nmaintenance. Translating the error to `ConnectionFailed` allows us to\ntreat these as retryable connection error, so we can reconnect and hit a\nnew vtage process.\n\nThis is all true regardless of whether the adapter is trilogy or mysql2\nor whatever, so this commit moves the translation out into the abstract\nmysql adapter.","shortMessageHtmlLink":"Move server shutdown translation to abstract mysql"}},{"before":"69b7fb3c7de12a477daea258c92b7ec796383440","after":"6616770ec9cc7c52ae4283ff6ae84fbc5a405b3d","ref":"refs/heads/trilogy-syscallerror-translate","pushedAt":"2024-01-23T21:20:07.000Z","pushType":"force_push","commitsCount":0,"pusher":{"login":"composerinteralia","name":"Daniel Colson","path":"/composerinteralia","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/13696143?s=80&v=4"},"commit":{"message":"Translate Trilogy syscall errors as conn failed\n\nAt GitHub we get a fair number of Trilogy `ETIMEDOUT` errors (for known\nreasons that we might be able to improve somewhat, but I doubt we'll\nmake them go away entirely). These are very much retryable network\nerrors, so it'd be handy if these `ETIMEDOUT` errors were translated to\n`ConnectionFailed` instead of `StatementInvalid`, making them\n`retryable_connection_error`s.\n\nhttps://github.com/rails/rails/blob/ed2bc92b82ddc111150cdf48bb646fd97b3baacb/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb#L1077\n\nWe're already translating `ECONNRESET` (via matching on the error\nmessage) and `EPIPE` to `ConnectionFailed`. Rather than adding another\ncase, this commit treats all of the Trilogy `SystemCallError` subclasses\nas `ConnectionFailed`.\n\nThis requires bumping trilogy 2.7 so we can get\nhttps://github.com/trilogy-libraries/trilogy/pull/143","shortMessageHtmlLink":"Translate Trilogy syscall errors as conn failed"}},{"before":"cde260504b4933047f17404759ed23ba6c7421df","after":"69b7fb3c7de12a477daea258c92b7ec796383440","ref":"refs/heads/trilogy-syscallerror-translate","pushedAt":"2024-01-23T21:06:41.000Z","pushType":"force_push","commitsCount":0,"pusher":{"login":"composerinteralia","name":"Daniel Colson","path":"/composerinteralia","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/13696143?s=80&v=4"},"commit":{"message":"Translate Trilogy syscall errors as conn failed\n\nAt GitHub we get a fair number of Trilogy `ETIMEDOUT` errors (for known\nreasons that we might be able to improve somewhat, but I doubt we'll\nmake them go away entirely). These are very much retryable network\nerrors, so it'd be handy if these `ETIMEDOUT` errors were translated to\n`ConnectionFailed` instead of `StatementInvalid`, making them\n`retryable_connection_error`s.\n\nhttps://github.com/rails/rails/blob/ed2bc92b82ddc111150cdf48bb646fd97b3baacb/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb#L1077\n\nWe're already translating `ECONNRESET` (via matching on the error\nmessage) and `EPIPE` to `ConnectionFailed`. Rather than adding another\ncase, this commit treats all of the Trilogy `SystemCallError` subclasses\nas `ConnectionFailed`.\n\nThis requires bumping trilogy 2.7 so we can get\nhttps://github.com/trilogy-libraries/trilogy/pull/143","shortMessageHtmlLink":"Translate Trilogy syscall errors as conn failed"}},{"before":"7f01c8ccc3a319d2dbb5a456fc175a39ebccfbdc","after":"cde260504b4933047f17404759ed23ba6c7421df","ref":"refs/heads/trilogy-syscallerror-translate","pushedAt":"2023-11-28T19:31:01.000Z","pushType":"force_push","commitsCount":0,"pusher":{"login":"composerinteralia","name":"Daniel Colson","path":"/composerinteralia","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/13696143?s=80&v=4"},"commit":{"message":"Translate Trilogy syscall errors as conn failed\n\nAt GitHub we get a fair number of Trilogy `ETIMEDOUT` errors (for known\nreasons that we might be able to improve somewhat, but I doubt we'll\nmake them go away entirely). These are very much retryable network\nerrors, so it'd be handy if these `ETIMEDOUT` errors were translated to\n`ConnectionFailed` instead of `StatementInvalid`, making them\n`retryable_connection_error`s.\n\nhttps://github.com/rails/rails/blob/ed2bc92b82ddc111150cdf48bb646fd97b3baacb/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb#L1077\n\nWe're already translating `ECONNRESET` (via matching on the error\nmessage) and `EPIPE` to `ConnectionFailed`. Rather than adding another\ncase, this commit treats all of the Trilogy `SystemCallError` subclasses\nas `ConnectionFailed`.\n\nUnfortunately `Trilogy::TimeoutError` is a subclass of `ETIMEDOUT`, so\nwe have to move the `AdapterTimeout` check into the case statement so we\ncan break out to the `super` call in the case of `Trilogy::TimeoutError`\nthat does have an error code (1205, i.e. lock timeout). Cleaning up the\nvarious Trilogy timeout errors is a project for another day.\n\nWe should be able to simplify this exception translation further once we\nbump the required Trilogy version to 2.6, but I figured I'd start out\nwith this minimal change that works on Trilogy 2.4 as well.","shortMessageHtmlLink":"Translate Trilogy syscall errors as conn failed"}},{"before":"a6c3c506298f217ee8a626f027eb487f559f8918","after":"7f01c8ccc3a319d2dbb5a456fc175a39ebccfbdc","ref":"refs/heads/trilogy-syscallerror-translate","pushedAt":"2023-11-28T18:27:14.000Z","pushType":"force_push","commitsCount":0,"pusher":{"login":"composerinteralia","name":"Daniel Colson","path":"/composerinteralia","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/13696143?s=80&v=4"},"commit":{"message":"Translate Trilogy syscall errors as conn failed\n\nAt GitHub we get a fair number of Trilogy `ETIMEDOUT` errors (for known\nreasons that we might be able to improve somewhat, but I doubt we'll\nmake them go away entirely). These are very much retryable network\nerrors, so it'd be handy if these `ETIMEDOUT` errors were translated to\n`ConnectionFailed` instead of `StatementInvalid`, making them\n`retryable_connection_error`s.\n\nhttps://github.com/rails/rails/blob/ed2bc92b82ddc111150cdf48bb646fd97b3baacb/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb#L1077\n\nWe're already translating `ECONNRESET` (via matching on the error\nmessage) and `EPIPE` to `ConnectionFailed`. Rather than adding another\ncase, this commit treats all of the Trilogy `SystemCallError` subclasses\nas `ConnectionFailed`.\n\nUnfortunately `Trilogy::TimeoutError` is a subclass of `ETIMEDOUT`, so\nwe have to move the `AdapterTimeout` check into the case statement so we\ncan break out to the `super` call in the case of `Trilogy::TimeoutError`\nthat does have an error code (1205, i.e. lock timeout). Cleaning up the\nvarious Trilogy timeout errors is a project for another day.\n\nWe should be able to simplify this exception translation further once we\nbump the required Trilogy version to 2.6, but I figured I'd start out\nwith this minimal change that works on Trilogy 2.4 as well.","shortMessageHtmlLink":"Translate Trilogy syscall errors as conn failed"}},{"before":"e4286bdb204616ad981b07e518547d45d17f55db","after":"a6c3c506298f217ee8a626f027eb487f559f8918","ref":"refs/heads/trilogy-syscallerror-translate","pushedAt":"2023-11-28T17:58:40.000Z","pushType":"force_push","commitsCount":0,"pusher":{"login":"composerinteralia","name":"Daniel Colson","path":"/composerinteralia","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/13696143?s=80&v=4"},"commit":{"message":"Translate Trilogy syscall errors as conn failed\n\nAt GitHub we get a fair number of Trilogy `ETIMEDOUT` errors (for known\nreasons that we might be able to improve somewhat, but I doubt we'll\nmake them go away entirely). These are very much retryable network\nerrors, so it'd be handy if these `ETIMEDOUT` errors were translated to\n`ConnectionFailed` instead of `StatementInvalid`, making them\n`retryable_connection_error`s.\n\nhttps://github.com/rails/rails/blob/ed2bc92b82ddc111150cdf48bb646fd97b3baacb/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb#L1077\n\nWe're already translating `ECONNRESET` (via matching on the error\nmessage) and `EPIPE` to `ConnectionFailed`. Rather than adding another\ncase, this commit treats all of the Trilogy `SystemCallError` subclasses\nas `ConnectionFailed`.\n\nThis commit also drops `TRILOGY_INVALID_SEQUENCE_ID`,\n`TRILOGY_UNEXPECTED_PACKET` as `ConnectionFailed`. These are not\ntransient network errors we might want to retry. These are MySQL\nclient/server protocol errors, likely indicating something we need to\nfix in Trilogy.\n\nWe should be able to simplify this exception translation further once we\nbump the required Trilogy version to 2.6, but I figured I'd start out\nwith this minimal change that works on Trilogy 2.4 as well.","shortMessageHtmlLink":"Translate Trilogy syscall errors as conn failed"}},{"before":null,"after":"e4286bdb204616ad981b07e518547d45d17f55db","ref":"refs/heads/trilogy-syscallerror-translate","pushedAt":"2023-11-28T17:53:26.000Z","pushType":"branch_creation","commitsCount":0,"pusher":{"login":"composerinteralia","name":"Daniel Colson","path":"/composerinteralia","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/13696143?s=80&v=4"},"commit":{"message":"Translate Trilogy syscall errors as conn failed\n\nAt GitHub we get a fair number of Trilogy `ETIMEDOUT` errors (for known\nreasons that we might be able to improve somewhat, but I doubt we'll\nmake them go away entirely). These are very much retryable network\nerrors, so it'd be handy if these `ETIMEDOUT` errors were translated to\n`ConnectionFailed` instead of `StatementInvalid`, making them\n`retryable_connection_error`s.\n\nhttps://github.com/rails/rails/blob/ed2bc92b82ddc111150cdf48bb646fd97b3baacb/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb#L1077\n\nWe're already translating `ECONNRESET` (via matching on the error\nmessage) and `EPIPE` to `ConnectionFailed`. Rather than adding another\ncase, this commit treats all of the Trilogy `SystemCallError` subclasses\nas `ConnectionFailed`.\n\nThis commit also drops `TRILOGY_INVALID_SEQUENCE_ID`,\n`TRILOGY_UNEXPECTED_PACKET` as `ConnectionFailed`. These are not\ntransient network errors we might want to retry. These are MySQL\nclient/server protocol errors, likely indicating something we need to\nfix in Trilogy.\n\nWe should be able to simplify this exception translation further once we\nbump the required Trilogy version to 2.6, but I figured I'd start out\nwith this minimal change that works on Trilogy 2.4 as well.","shortMessageHtmlLink":"Translate Trilogy syscall errors as conn failed"}},{"before":null,"after":"85790302c6ae9e04bc57a1b4393e9fcf0987f437","ref":"refs/heads/reaper-thread-name","pushedAt":"2023-11-08T19:24:11.000Z","pushType":"branch_creation","commitsCount":0,"pusher":{"login":"composerinteralia","name":"Daniel Colson","path":"/composerinteralia","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/13696143?s=80&v=4"},"commit":{"message":"Name the connection pool reaper thread\n\nNaming threads can be helpful for debugging (e.g. getting an overview of\nwhat's running with `Thread.list.map(&:name)` or `ps -T -p PID`.\n\nWe noticed our reaper didn't have a name, so this commit adds one.\n\nWe've intentionally kept the name short (< 15 characters), since there\nare platform limitations on the length of the underlying thread name.\n\nCo-authored-by: John Hawthorn ","shortMessageHtmlLink":"Name the connection pool reaper thread"}},{"before":null,"after":"aecca3d2d4d0991e974ce9c97d10cb3c87e49ae3","ref":"refs/heads/forward-with_raw_connection-params","pushedAt":"2023-11-08T18:22:37.000Z","pushType":"branch_creation","commitsCount":0,"pusher":{"login":"composerinteralia","name":"Daniel Colson","path":"/composerinteralia","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/13696143?s=80&v=4"},"commit":{"message":"Pass along with_raw_connection params in PG adapter\n\nPrior to this commit we were passing `allow_retry` and\n`materialize_transactions` through from `execute_and_clear` to\n`exec_cache`/`exec_no_cache`, but then doing nothing with them.\n\nWe've got a few internal queries using `execute_and_clear` (mostly via\n`internal_exec_query`) that are passing `allow_retry: true` and\n`materialize_transactions: false`. These calls will fail on connection\nerrors that might have been retryable. It's also possible they are\nmaterializing transactions earlier than expected (although probably\nnot—most of the methods look like they would be called only by us,\nalways outside a transaction).\n\nThis commit forwards the arguments through to `with_raw_connection` so\nthe callers get the behavior they likely expect.","shortMessageHtmlLink":"Pass along with_raw_connection params in PG adapter"}},{"before":null,"after":"64e6145a9d208a095465485eaf6bac8e3b7c7851","ref":"refs/heads/backport-postgres-unrecoverable-connection-error","pushedAt":"2023-11-07T16:25:17.000Z","pushType":"branch_creation","commitsCount":0,"pusher":{"login":"composerinteralia","name":"Daniel Colson","path":"/composerinteralia","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/13696143?s=80&v=4"},"commit":{"message":"Merge pull request #49802 from composerinteralia/postgres-unrecoverable-connection-error\n\nRecover from failed connections in PostgreSQL","shortMessageHtmlLink":"Merge pull request rails#49802 from composerinteralia/postgres-unreco…"}},{"before":"2d185d615b4b58cf93a3aa3d418d232a0bb3b632","after":"846bf52c89ea8a5780359b478cb366d191525d29","ref":"refs/heads/connectiontimeouterror-pool","pushedAt":"2023-11-07T12:34:09.000Z","pushType":"force_push","commitsCount":0,"pusher":{"login":"composerinteralia","name":"Daniel Colson","path":"/composerinteralia","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/13696143?s=80&v=4"},"commit":{"message":"Add connection pool to connection timeout errors\n\nAlong the same lines as https://github.com/rails/rails/pull/48295,\nin multi-database applications it's helpful to have access to the pool\nwhen debugging these timeouts. For example, we might send the connection\nclass and role along to an exception tracking system.\n\nConnectionTimeout was already set up to take a connection_pool, so this\ncommit passes it along as needed where we raise the error.","shortMessageHtmlLink":"Add connection pool to connection timeout errors"}},{"before":null,"after":"2d185d615b4b58cf93a3aa3d418d232a0bb3b632","ref":"refs/heads/connectiontimeouterror-pool","pushedAt":"2023-11-07T02:50:14.000Z","pushType":"branch_creation","commitsCount":0,"pusher":{"login":"composerinteralia","name":"Daniel Colson","path":"/composerinteralia","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/13696143?s=80&v=4"}},{"before":"6db4ab5a008a8e63f7961f7718de390514a7f318","after":"a180823195e9716662572c07c687b30d4ac4cbc5","ref":"refs/heads/verify-only-when-connection-exercised","pushedAt":"2023-11-06T16:23:47.000Z","pushType":"force_push","commitsCount":0,"pusher":{"login":"composerinteralia","name":"Daniel Colson","path":"/composerinteralia","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/13696143?s=80&v=4"},"commit":{"message":"Prevent marking broken connections as verified\n\nRelated to https://github.com/rails/rails/pull/49802\n\nPrior to this commit `with_raw_connection` would always mark the\nconnection as `@verified = true` after yielding it. But yielding a\nconnection is not enough to determine that a connection is healthy.\nMarking a broken connection as verified can prevent further reconnects,\nleaving us with a broken connection for longer than expected.\n\nFor example,\n\n* Connection is broken and not verified\n* Quote string succeeds, and marks the broken connection as verified\n* Because the connection is verified, querying will not trigger a\n reconnect\n* Query fails and the connection is no longer verified\n* Repeat ad infinitum (or until we reach a query with `allow_retry:\n true`, or one that isn't preceded by a call to quote string)\n\nThis commit solves the problem by only marking the connection as\nverified if we have definitively exercised that connection. This is\nsafer, but it does put more responsibility on each individual adapter.\nIf a call to `verified!` is missing things should still work OK, but\nwe'll end up pinging the connection more to see if it is active.","shortMessageHtmlLink":"Prevent marking broken connections as verified"}},{"before":"fe2612585b8a160a79ffef2d86c53becab36544c","after":"6db4ab5a008a8e63f7961f7718de390514a7f318","ref":"refs/heads/verify-only-when-connection-exercised","pushedAt":"2023-11-06T15:30:04.000Z","pushType":"force_push","commitsCount":0,"pusher":{"login":"composerinteralia","name":"Daniel Colson","path":"/composerinteralia","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/13696143?s=80&v=4"}},{"before":"671b9eb9316d8da34be865e70f79a7e1bb02770c","after":"fe2612585b8a160a79ffef2d86c53becab36544c","ref":"refs/heads/verify-only-when-connection-exercised","pushedAt":"2023-11-06T15:19:55.000Z","pushType":"force_push","commitsCount":0,"pusher":{"login":"composerinteralia","name":"Daniel Colson","path":"/composerinteralia","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/13696143?s=80&v=4"}},{"before":"6e1a3a67dca93452d7f52616509299f032adc256","after":"671b9eb9316d8da34be865e70f79a7e1bb02770c","ref":"refs/heads/verify-only-when-connection-exercised","pushedAt":"2023-11-06T14:44:35.000Z","pushType":"force_push","commitsCount":0,"pusher":{"login":"composerinteralia","name":"Daniel Colson","path":"/composerinteralia","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/13696143?s=80&v=4"}},{"before":"6498f0bd4e816023e7b5d24ff80ac6bee6cd9e8c","after":"6e1a3a67dca93452d7f52616509299f032adc256","ref":"refs/heads/verify-only-when-connection-exercised","pushedAt":"2023-10-30T14:20:52.000Z","pushType":"force_push","commitsCount":0,"pusher":{"login":"composerinteralia","name":"Daniel Colson","path":"/composerinteralia","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/13696143?s=80&v=4"}},{"before":"83aca8c093c13ef3a038b548a38c50660f7ead5c","after":"6498f0bd4e816023e7b5d24ff80ac6bee6cd9e8c","ref":"refs/heads/verify-only-when-connection-exercised","pushedAt":"2023-10-30T14:19:51.000Z","pushType":"force_push","commitsCount":0,"pusher":{"login":"composerinteralia","name":"Daniel Colson","path":"/composerinteralia","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/13696143?s=80&v=4"}},{"before":"1192dc224b5e85663bd65d0a884115e50c071654","after":"83aca8c093c13ef3a038b548a38c50660f7ead5c","ref":"refs/heads/verify-only-when-connection-exercised","pushedAt":"2023-10-30T14:08:35.000Z","pushType":"force_push","commitsCount":0,"pusher":{"login":"composerinteralia","name":"Daniel Colson","path":"/composerinteralia","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/13696143?s=80&v=4"}},{"before":"45f4eac964f6e1e2ca0e959c3ccf841ae0669005","after":"1192dc224b5e85663bd65d0a884115e50c071654","ref":"refs/heads/verify-only-when-connection-exercised","pushedAt":"2023-10-30T00:30:40.000Z","pushType":"force_push","commitsCount":0,"pusher":{"login":"composerinteralia","name":"Daniel Colson","path":"/composerinteralia","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/13696143?s=80&v=4"}},{"before":"505d42e8e783ba493956dec058f9717a93a474cf","after":"45f4eac964f6e1e2ca0e959c3ccf841ae0669005","ref":"refs/heads/verify-only-when-connection-exercised","pushedAt":"2023-10-30T00:28:42.000Z","pushType":"force_push","commitsCount":0,"pusher":{"login":"composerinteralia","name":"Daniel Colson","path":"/composerinteralia","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/13696143?s=80&v=4"}},{"before":"cfcd1c964555b62f96bcefe66a32c417577e438f","after":"505d42e8e783ba493956dec058f9717a93a474cf","ref":"refs/heads/verify-only-when-connection-exercised","pushedAt":"2023-10-30T00:26:29.000Z","pushType":"force_push","commitsCount":0,"pusher":{"login":"composerinteralia","name":"Daniel Colson","path":"/composerinteralia","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/13696143?s=80&v=4"}},{"before":"45b5087fea9479b6d65a1d6b0cdf097fd52a0922","after":"cfcd1c964555b62f96bcefe66a32c417577e438f","ref":"refs/heads/verify-only-when-connection-exercised","pushedAt":"2023-10-27T16:38:33.000Z","pushType":"force_push","commitsCount":0,"pusher":{"login":"composerinteralia","name":"Daniel Colson","path":"/composerinteralia","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/13696143?s=80&v=4"}},{"before":null,"after":"45b5087fea9479b6d65a1d6b0cdf097fd52a0922","ref":"refs/heads/verify-only-when-connection-exercised","pushedAt":"2023-10-27T15:16:39.000Z","pushType":"branch_creation","commitsCount":0,"pusher":{"login":"composerinteralia","name":"Daniel Colson","path":"/composerinteralia","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/13696143?s=80&v=4"}},{"before":null,"after":"73edae7e6ab0d6c23167ead2d9f06e3faf44d82e","ref":"refs/heads/postgres-unrecoverable-connection-error","pushedAt":"2023-10-26T23:49:00.000Z","pushType":"branch_creation","commitsCount":0,"pusher":{"login":"composerinteralia","name":"Daniel Colson","path":"/composerinteralia","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/13696143?s=80&v=4"},"commit":{"message":"Recover from failed connections in PostgreSQL\n\nFixes https://github.com/rails/rails/issues/49781\n\nPrior to this commit, the PostgreSQL adapter could end up holding onto a\nbroken connection longer than expected, potentially **into the next\nrequest after the executor checkin/checkout**.\n\nThe problem is that the PostgreSQL adapter was using a [two separate\ncalls] to `with_raw_connection` for preparing vs. executing a prepared\nstatement. That's fine when the statement is first prepared, but once it\nis in the statement pool the first call to `with_raw_connection` [does\nnot actually use the connection]. But that doesn't stop it from marking\nthe connection as [`@verified`][verified], preventing the second\n`with_raw_connection` from verifying and getting a chance to reconnect.\n\n[two separate calls]: https://github.com/rails/rails/blob/e33dbe1b3d423143685154b97ae0992f4ab821b8/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb#L910-L917\n[does not actually use the connection]: https://github.com/rails/rails/blob/490b9fc22faefca30565a970a8727c915de589ff/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb#L964-L966\n[verified]: https://github.com/rails/rails/blob/e33dbe1b3d423143685154b97ae0992f4ab821b8/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb#L1032\n\n```rb\nPost.first\n=> prepare_statement verifies the connection (if needed) and populates the statement pool\n=> exec_prepared succeeds\n\n=> Oops!, we lost the connection\n\nPost.first\n=> prepare_statement returns the statement from the statement pool, connection still marked as verified\n=> exec_prepared fails, marks the connection as unverified\n\nPost.first\n=> prepare_statement returns the statement from the statement pool, marks the connection as verified!!!\n=> exec_prepared fails, marks the connection as unverified\n\n=> request finishes, connection gets marked as unverified for the next request\n\nPost.first\n=> prepare_statement returns the statement from the statement pool, marks the connection as verified!!!\n=> exec_prepared fails, marks the connection as unverified\n```\n\nThe only way to recover is to execute a statement that hasn't been\nprepared yet, one that isn't prepared because it has no binds, or one\nthat has `allow_retry: true` (which I think is limited to a few internal\nqueries at the moment—we don't pass the value through to\n`with_raw_connection` for prepared statements anyway).\n\nThis commit fixes the problem by preparing and executing the statement\nwithin a single `with_raw_connection` block. This is what the other\nadapters with prepared statements already do.\n\nIt makes more sense this way—even if we managed to reconnect before\nexecuting the statement in the old code, we'd be referencing a prepared\nstatement from a different connection, so it'd fail anyway. Having the\nprepare and execute in the same `with_raw_connection` means if we do\nneed to reconnect, we'll start from the beginning and prepare the\nstatement again on the fresh connection.\n\nNote that this change does get rid of connection retries on preparing\nstatements, but I think that's OK. It matches the other adapters,\nmatches the Rails 7.0 behavior, and it's still better than ending up\nwith a broken connection.","shortMessageHtmlLink":"Recover from failed connections in PostgreSQL"}},{"before":null,"after":"571f56b6dea97e11fde3712f333619ff39199b08","ref":"refs/heads/trilogy-new-client","pushedAt":"2023-10-25T01:28:17.000Z","pushType":"branch_creation","commitsCount":0,"pusher":{"login":"composerinteralia","name":"Daniel Colson","path":"/composerinteralia","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/13696143?s=80&v=4"},"commit":{"message":"Build trilogy adapter with newer API\n\nPrior to this commit we were using the [older, soft-deprecated\narguments][deprecated args] to initialize a Trilogy adapter.\n\nI don't think the [options array][] we were passing in made any sense\nanyway. It becomes `@connection_options`, which Trilogy doesn't appear\nto use. Trilogy expects hash args so I'm not sure how an array of args\nwould help us anyway. I think we were building that array for no reason.\n\nThis commit switches over to the simpler single-arg construction that\nthe other adapters are already using.\n\n[deprecated args]: https://github.com/rails/rails/blob/4c5c904a212a850c43adb7a3c3a719ca3d2b9159/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb#L128\n[options array]: https://github.com/rails/rails/blob/4c5c904a212a850c43adb7a3c3a719ca3d2b9159/activerecord/lib/active_record/connection_adapters/trilogy_adapter.rb#L24-L32","shortMessageHtmlLink":"Build trilogy adapter with newer API"}},{"before":null,"after":"cf8ab2f4b80add59ecf3ae01630178557fc7e524","ref":"refs/heads/transaction-instrumentation-payload-outcome","pushedAt":"2023-09-13T19:42:28.000Z","pushType":"branch_creation","commitsCount":0,"pusher":{"login":"composerinteralia","name":"Daniel Colson","path":"/composerinteralia","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/13696143?s=80&v=4"},"commit":{"message":"Add outcome to transaction tracking payload\n\nFollowing up on https://github.com/rails/rails/pull/49192, this commit\nadds the transaction `outcome` to the payload, helpful for collecting\nstats on how many transactions commit, rollback, restart, or (perhaps\nmost interestingly) are incomplete because of an error.\n\nThe one quirk here is that we have to modify the payload on finish. It's\nnot the only place this sort of thing happens (instrument mutates the\npayload with exceptions, for example), but it does mean we need to dup\nthe payload we initialize with to avoid mutating it for other tracking.\n\nCo-authored-by: Ian Candy ","shortMessageHtmlLink":"Add outcome to transaction tracking payload"}},{"before":"d5afcc17bcd5070b6b999056c79f552dd72a22bc","after":"229b66d0824ecb942541e0d9c4d5cb3c60fbed4a","ref":"refs/heads/transaction-instrumentation","pushedAt":"2023-09-07T19:05:32.000Z","pushType":"force_push","commitsCount":0,"pusher":{"login":"composerinteralia","name":"Daniel Colson","path":"/composerinteralia","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/13696143?s=80&v=4"},"commit":{"message":"Instrument Active Record transactions\n\nTracking Active Record-managed transactions seems to be a common need,\nbut there's currently not a great way to do it. Here's a few examples\nI've seen:\n\n* GitHub has custom transaction tracking that monkey patches the Active\n Record `TransactionManager` and `RealTransaction`. We use the tracking\n to prevent opening a transaction to one database cluster inside a\n transaction to a different database cluster, and to report slow\n transactions (we get slow transaction data directly from MySQL as well,\n but it's still helpful to report from the application with backtraces to\n help track them down).\n* https://github.com/palkan/isolator tracks transactions to prevent\n non-atomic interactions like external network calls inside a\n transaction. The gem works by subscribing to `sql.active_record`, then\n piecing together the transactions by looking for `BEGIN`, `COMMIT`,\n `SAVEPOINT`, etc., but this is unreliable:\n - https://github.com/palkan/isolator/issues/65\n - https://github.com/palkan/isolator/issues/64\n* It looks like GitLab patches `TransactionManager` and `RealTransaction`\n to track nested savepoints. See https://github.com/palkan/isolator/issues/46\n\nThis commit adds a new `transaction.active_record` event that should\nprovide a more reliable solution for these various use cases. It\nincludes the connection in the payload (useful, for example, in\ndifferentiating transactions to different databases), but if this change\ngets merged we're also planning to add details about what type of\ntransaction it is (savepoint or real) and what the outcome is (commit,\nrollback, restarted, errored).\n\nThis instrumentation needs to start and finish at fairly specific times:\n - start on materialize\n - finish after committing or rolling back, but before the after_commit\n or after_rollback callbacks\n - finish and start again when the transaction restarts (at least for\n real transactions—we've done it for savepoints as well but I'm not\n certain we should)\n - ensure it finishes if commit and rollback fail (e.g. if the\n connection goes away)\nTo make all that work, this commit uses the lower-level `#build-handle`\nAPI instead of `#instrument`.\n\nCo-authored-by: Ian Candy ","shortMessageHtmlLink":"Instrument Active Record transactions"}}],"hasNextPage":true,"hasPreviousPage":false,"activityType":"all","actor":null,"timePeriod":"all","sort":"DESC","perPage":30,"cursor":"djE6ks8AAAAD6hxKpwA","startCursor":null,"endCursor":null}},"title":"Activity · composerinteralia/rails"}