<div style="display: flex; flex-wrap: wrap; white-space: pre-wrap; align-items: center; "><img height="20" width="20" style="border-radius:50%; margin-right: 4px;" decoding="async" src="https://avatars.githubusercontent.com/u/7535628?s=20&v=4" /><strong>rkoeze</strong> left a comment <a href="https://github.com/openstreetmap/openstreetmap-website/pull/6476#issuecomment-3575449588">(openstreetmap/openstreetmap-website#6476)</a></div>
<p dir="auto">Sorry for the late reply here. I think the idea behind the monkey patching is that it allows timeout exceptions to be propagated without wrapping the exception (ActiveRecord's default behavior) so we <a href="https://github.com/openstreetmap/openstreetmap-website/blob/1515df8ce98e2de3e1cfdbd20681ecbe86cd1417/app/controllers/application_controller.rb#L228">can handle the timeout case explicitly</a>.</p>
<p dir="auto">With that said, <code class="notranslate">Timeout::Error</code> is a runtime error, so it looks like <a href="https://github.com/rails/rails/blob/dcb29df5b25006dd92f4fc10295f0177a33db93c/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb#L1226">ActiveRecord should let that bubble up</a> anyway.</p>
<p dir="auto">Generally using Timeout to wrap critical operations <a href="https://www.mikeperham.com/2015/05/08/timeout-rubys-most-dangerous-api/?utm_source=chatgpt.com" rel="nofollow">is not recommended</a>. With that in mind, how do we feel about the following?</p>
<ol dir="auto">
<li>We remove this initializer. It's never worked. And fixing it would lean into a pattern that is not recommended.</li>
<li>We explore setting a database timeout around some of these longer running queries we're concerned about.</li>
</ol>
<p dir="auto">I'm sure I'm missing some historical context here so <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/tomhughes/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/tomhughes">@tomhughes</a> please correct me on what I'm missing.</p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />Reply to this email directly, <a href="https://github.com/openstreetmap/openstreetmap-website/pull/6476#issuecomment-3575449588">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AAK2OLK7RROWSUYYY6AQZQL36REVBAVCNFSM6AAAAACKG3K24SVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZTKNZVGQ2DSNJYHA">unsubscribe</a>.<br />You are receiving this because you are subscribed to this thread.<img src="https://github.com/notifications/beacon/AAK2OLOMTRTTHAMU53RVQ5336REVBA5CNFSM6AAAAACKG3K24SWGG33NNVSW45C7OR4XAZNMJFZXG5LFINXW23LFNZ2KUY3PNVWWK3TUL5UWJTWVDUD7I.gif" height="1" width="1" alt="" /><span style="color: transparent; font-size: 0; display: none; visibility: hidden; overflow: hidden; opacity: 0; width: 0; height: 0; max-width: 0; max-height: 0; mso-hide: all">Message ID: <span><openstreetmap/openstreetmap-website/pull/6476/c3575449588</span><span>@</span><span>github</span><span>.</span><span>com></span></span></p>

<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/openstreetmap/openstreetmap-website/pull/6476#issuecomment-3575449588",
"url": "https://github.com/openstreetmap/openstreetmap-website/pull/6476#issuecomment-3575449588",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>