Commit ef3b678
authored
Update the retry policy for tsql query execution (#2285)
## Changes
1. Updates retry policy for QueryExecutor to attempt 3 times instead of
5 times as per guidance
2. Remove sql error number 18456 from the list of transient exceptions
which would result in retries. 18456 is a fatal error.
## Why make this change?
Sql Error 18456 occurs when using invalid authentication methods such as
invalid audience or expired token or credentials. There is a permanent
error hence no benefit from retrying.
Ref:
https://learn.microsoft.com/en-us/sql/relational-databases/errors-events/mssqlserver-18456-database-engine-error?view=sql-server-ver16
Additionally, the number of retries of 5 means that it would take
considerable for user to see the error returned. This does not bode well
for GraphQL queries which are an interactive scenario.
Ref:
https://learn.microsoft.com/en-us/azure/architecture/best-practices/retry-service-specific#retry-usage-guidance-3
## How was this tested?
- Manual testing to ensure retry attempts down to 2 down from 5 via
breakpoints
- Manual testing to reproduce error 18456 and ensure no retries via
breakpoints
- Unit tests1 parent 73098a9 commit ef3b678
File tree
3 files changed
+3
-7
lines changed- src
- Core/Resolvers
- Service.Tests/Unittests
3 files changed
+3
-7
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
51 | | - | |
52 | | - | |
53 | | - | |
54 | | - | |
55 | | - | |
| 51 | + | |
56 | 52 | | |
57 | 53 | | |
58 | 54 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
33 | | - | |
| 33 | + | |
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
140 | 140 | | |
141 | 141 | | |
142 | 142 | | |
143 | | - | |
| 143 | + | |
144 | 144 | | |
145 | 145 | | |
146 | 146 | | |
| |||
0 commit comments