Commit 31adc8b
committed
Do not let the definitions read flush a caller's pending write
Cross-family review raised that catching SQLAlchemyError around an autoflushing
query is broader than the failure being handled. If a caller's session is
carrying a pending mutation, our SELECT flushes it first, so an unrelated
IntegrityError would surface inside this helper, get swallowed as "no custom
columns", and leave the session needing a rollback for the rest of the request
-- silent, and a long way from its cause.
None of the five callers stage a write before calling this, so it is not
reachable today. Reading the definitions under no_autoflush closes it anyway,
since flushing someone else's work was never part of what this method needs.
Also closes two gaps the review found in the tests: nothing proved the request
could keep querying after a swallowed failure (the property that makes
degrading worth doing at all -- a poisoned session would still satisfy an
assertion of []), and every test asserted [], so an unconditional return []
would have left them all green while hiding custom columns from every healthy
library. Both are now pinned; the second is mutation-verified to fail against
that exact regression.
For #1153.1 parent 22aa25c commit 31adc8b
2 files changed
Lines changed: 85 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1904 | 1904 | | |
1905 | 1905 | | |
1906 | 1906 | | |
1907 | | - | |
1908 | | - | |
| 1907 | + | |
| 1908 | + | |
| 1909 | + | |
| 1910 | + | |
| 1911 | + | |
| 1912 | + | |
| 1913 | + | |
| 1914 | + | |
| 1915 | + | |
| 1916 | + | |
| 1917 | + | |
| 1918 | + | |
1909 | 1919 | | |
1910 | | - | |
1911 | | - | |
| 1920 | + | |
| 1921 | + | |
| 1922 | + | |
| 1923 | + | |
1912 | 1924 | | |
1913 | 1925 | | |
1914 | 1926 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| 21 | + | |
21 | 22 | | |
22 | 23 | | |
23 | | - | |
| 24 | + | |
24 | 25 | | |
25 | 26 | | |
26 | 27 | | |
| |||
95 | 96 | | |
96 | 97 | | |
97 | 98 | | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
98 | 166 | | |
99 | 167 | | |
100 | 168 | | |
| |||
0 commit comments