<p></p>
<blockquote>
<p dir="auto">Reading between the lines, I guess there's some problem in production then? Like long-running queries not being timed out properly?</p>
</blockquote>
<p dir="auto">Yes I was fighting an extremely persistent trackpoint scraper and gradually began to suspect that part of the problem was timeouts not working properly.</p>
<blockquote>
<p dir="auto">I'd look into stubbing out the query, perhaps with Minitest::Mock, so that you can control precisely how long the 'query' takes to run in the test suite. That could be enough to fire the timeouts and check that the exceptions are being handled. Of course, there's probably some complexity about what part exactly to mock in order to trigger the problem that you are seeing.</p>
</blockquote>
<p dir="auto">Quite a lot of my original concern was that either the timeout was being blocked by the database query in some way or that it was firing but the query wasn't being cancelled properly so I didn't really want to get rid of the query by mocking it...</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/commit/24f579562fbaf1ec9138014b0f2ed8e219eb75f7#commitcomment-138121464">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AAK2OLNDY4PFGRACAAIXZO3YRJI35AVCNFSM6AAAAABCS3KPFKVHI2DSMVQWIX3LMV43OQ3PNVWWS5CDN5WW2ZLOOQ5TCMZYGEZDCNBWGQ">unsubscribe</a>.<br />You are receiving this because you are subscribed to this thread.<img src="https://github.com/notifications/beacon/AAK2OLI3MSAWQZEAR7PSKPDYRJI35A5CNFSM6AAAAABCS3KPFKWGG33NNVSW45C7OR4XAZNNINXW23LJORBW63LNMVXHJKTDN5WW2ZLOORPWSZGOBA5ZB6A.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/commit/24f579562fbaf1ec9138014b0f2ed8e219eb75f7/138121464</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/commit/24f579562fbaf1ec9138014b0f2ed8e219eb75f7#commitcomment-138121464",
"url": "https://github.com/openstreetmap/openstreetmap-website/commit/24f579562fbaf1ec9138014b0f2ed8e219eb75f7#commitcomment-138121464",
"name": "View Commit"
},
"description": "View this Commit on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>