Comments (8)
Thanks @cgillum! This certainly is a bit more complicated but we will work with you for any approaches we have and of course test locally before and after hand as well.
from durabletask-mssql.
@cgillum - Would it be OK for me and Misha to attempt to fix this issue and propose a solution?
Btw, Misha is my manager and we work together and are trying to use DTF for workflows.
from durabletask-mssql.
@microrama yes, if youβre able to find and submit a solution for this, we would be more than happy to accept it. It would be great to have a fix for this issue.
from durabletask-mssql.
This is what's happening:
DurableTask.SqlServer.SqlUtils.WithRetry() gets called by SqlOrchestrationService.LockNextTaskOrchestrationWorkItemAsync() method. This has the DBCommand passed to it.
The first run when the network is out, we get the SqlException which is checked by IsTransient() method and is logged in the method as traceHelper.TransientDatabaseFailure(). This is the first DurableTask.SqlServer error that we see as a warning.
Now, while the retry loop is being executed, the second time around it appears we get an System.InvalidOperationException that is not evaluated as transient by the IsTransient() method.
This exception is thrown back to the calling DurableTask.Core caller and that is logged as an error.
Subsequent calls work great because the network blip worked out.
POC:
With a simple console application, we were able to reproduce the InvalidOperationException by forcibly closing the SqlConnection before calling the ExecuteReaderAsync.
It was hard to reproduce the first transient SqlException in the VM machine where we develop.
Bottomline:
The first error is a SqlException error and is considered a transient but by the second attempt, it turns into a InvalidOperationException since the SqlConnection is closed at this point.
Fix:
Pass the DBCommand to the WithRetry() method and let the method check the DBCommand connection state and open if needed before attempting executor again. If there is a SqlException opening the connection again, existing logic will retry or return fatal error back.
Next Steps:
We will try out the code in our Sandbox environment and monitor.
from durabletask-mssql.
The code change was tested in our cert environment and it appears the issue is now fixed. We will still see the Warning but the Error is gone since we check for SqlConnection State and open the connection on the command object as needed.
This was tested in the CERT environment where on an average there is a network blip once or twice a day.
Attaching screenshots:
Next steps - I will create a PR for this issue for your review. Thx @cgillum!
from durabletask-mssql.
@cgillum - FYI. I created the PR few days back. Please review when you have time.
#221
from durabletask-mssql.
@cgillum - Greatly appreciate any help with reviewing the PR :-)
#221
from durabletask-mssql.
@microrama taking a look now - thanks!
from durabletask-mssql.
Related Issues (20)
- Automate database schema upgrade testing HOT 1
- SqlException Transaction (Process ID 66) was deadlocked on lock resources with another process and has been chosen as the deadlock victim. Rerun the transaction. HOT 4
- Connection String question HOT 12
- NewEvents stuck due to InvalidCastException HOT 6
- MaxActiveOrchestrations set to 1 does not work, mutliple Orchestrations are running HOT 1
- SqlOrchestrationService is not visible when referencing Microsoft.Azure.Functions.Worker.Extensions.DurableTask.SqlServer HOT 1
- Update Microsoft.Data.SqlClient and related dependencies
- Durable Entity creates NullReferenceException with Microsoft.Azure.Functions.Worker.Extensions.DurableTask.SqlServer HOT 5
- Recommendations on storing large payloads HOT 4
- NullReferenceException in SqlORchestrationService HOT 7
- Orchestration execution retry due to OperationCanceledException? HOT 4
- Error propagation is not working properly even after upgrading to latest version of Sql server HOT 1
- Non-Deterministic workflow detected HOT 4
- NU1605: Warning As Error: Detected package downgrade: Microsoft.Azure.WebJobs.Extensions.DurableTask from 2.13.2 to 2.13.1 HOT 1
- Under what circumstance does DTF SQL provider throws Duplicate execution error HOT 5
- Always encrypted support for python HOT 2
- Dt.CreateInstance stored proc is causing deadlocks (proposed ROLLBACK change that fixes the issue) HOT 11
- Change task scheduling to give more even flow of orchestrations
- Azure Durable Isolated Function - PurgeAllInstancesAsync HOT 7
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from durabletask-mssql.