Repository navigation
fix(model): retry a failed SQL Server probe after a back-off - #4332
Merged
Merged
Conversation
The SQL Server adapter reads two facts once per datasource and keeps them in application.wheels: the database's compatibility level (STRING_SPLIT, #4321) and the types the driver binds dates as (#4329). A failed read was kept too, so one transient error disabled STRING_SPLIT, or date-list splitting, until the next reload. A failed read is no longer kept. Its time is recorded, the answer is "not supported" until $probeRetrySeconds() (60) have passed, and then the probe runs again; a good read is kept as before. The back-off stops a broken probe from running before every long statement. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Peter Amiri <peter@alurium.com>
Collaborator
Author
Review @ a057e68: source looks good. Final verdict after matrix 37290287029 and PR CIThe back-off is per datasource and per probe
Concurrency is harmless
Cost of a permanently failing probe
Spec (
Findings
On the matrix I'll read |
Contributor
Wheels Test Results221 959 tests 217 049 ✅ 1h 23m 44s ⏱️ Results for commit a057e68. |
Collaborator
Author
Final: APPROVE @ a057e68 (matrix 37290287029, all 32 legs read; PR CI read)Matrix
PR CI: 18 pass, 3 skipping (Deploy CLI tests, Reviewer, Update docs), 0 fail, 0 pending. No open findings. The INFO about a burst of probes at expiry stands as a note only. |
This was referenced Oct 5, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
On SQL Server, Wheels reads two facts once per datasource and keeps them in the application's Wheels settings:
STRING_SPLIT(feat(model): run IN lists past SQL Server's parameter limit as one STRING_SPLIT parameter #4321);A failed read was kept as well: compatibility level
0, or no bind types. So one transient error, such as a dropped connection or a permission hiccup during the first long query, turned the feature off for that datasource until the next application reload. This came up as an INFO in the review of #4329, for both reads.Change (
MicrosoftSQLServerModel.cfc)A good read is kept, as before. That includes a compatibility level below 130, which is a real answer, not a failure.
A failed read isn't kept. Its time is recorded in
application.wheels.sqlServerProbeFailures(keyedprobe|dataSource), and until$probeRetrySeconds()(60) have passed:$supportsStringSplit()returnsfalse;$stringSplitDateCasts()returns{}.Long statements behave exactly as they do with an unsupported database in the meantime. The probe then runs again, and a success clears the recorded failure.
Why a back-off. It stops a broken probe from running before every long statement.
New helpers:
$probeFailedRecently(),$noteProbeResult(),$probeFailures()and$probeRetrySeconds(). Only$supportsStringSplit()and$stringSplitDateCasts()call them.No changelog fragment: both reads are new in the unreleased 4.2.
The PR for #4326 / #4327 edits other functions of the same adapter. dev1-core confirmed there's no overlap; whichever merges second merges develop in.
Tests
New
vendor/wheels/tests/specs/model/sqlServerProbeRetrySpec.cfc. It stubs the two reads with MockBox (prepareMock()on a SQL Server adapter for a datasource no other spec uses), so it runs on every database:0) isn't kept and isn't retried within the back-off: a second call doesn't read again. After the back-off it's read again (150), kept, and the failure is cleared.{}thendatetime2/7/date/0.120) is kept after one read, not treated as a failure.RED (this spec on develop, Lucee 7 + SQLite): both retry specs fail with "a failed read was kept". The below-130 spec passes on develop too, as it should.
GREEN,
modeldirectory (pass / fail / error):sqlServerProbeRetrySpecpasses 3/3 on every engine.internalspecs: 113 passed.🤖 Generated with Claude Code