You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The developer should be able to return any type of entity as part of a workflow activity payload.
Actual Behavior
When using .NET SDK to execute a workflow activity, if the payload contains an entity that was added to an Entity Framework DbContext, the activity will fail silently and then the workflow system will retry it. There is no obvious indication that the activity has failed at all other than the retry.
Steps to Reproduce the Problem
Create an activity that contains a DbContext
Create an entity and add it to a table in the context and save
Return the same entity in the activity payload
Observe that the activity is retried a minute later
NOTE: The issue only occurs when the entity is added to the context via the Add method. Querying an entity and returning works as expected.
Release Note
RELEASE NOTE:
The text was updated successfully, but these errors were encountered:
clintsinger
changed the title
[Workflows] Returning an entity that was added to an EF context causes the activity retry.
[Workflows] Returning an entity that was added to an EF context causes the activity to retry.
Dec 20, 2023
@clintsinger Which version of the Dapr .NET SDK are you using, and do you happen to have a small repro project?
Is the DbContext disposed when the activity completes (before the entity is returned)? I'm curious whether the context's entity tracking is perhaps interfering with serialization of the data on return of the activity. If run inside a debugger, are any exceptions being thrown (perhaps not by the activity itself, but elsewhere in the SDK post-activity)?
I don't have a ready to go repro project but I'm pretty sure it would be pretty easy to put into any project the team has. Just return an entity that is added to the DbContext. I expect the DbContext is being cleaned up at the time of the return.
I didn't notice any errors at all. The activity would just repeat itself.
Marking as P0 since it causes the activity to continually repeat itself, and because it seems like it may be easy to run into this problem. More investigation is needed to determine if this is an SDK issue or if there's a larger runtime issue.
In what area(s)?
/area runtime
What version of Dapr?
1.12 (.NET SDK)
Expected Behavior
The developer should be able to return any type of entity as part of a workflow activity payload.
Actual Behavior
When using .NET SDK to execute a workflow activity, if the payload contains an entity that was added to an Entity Framework DbContext, the activity will fail silently and then the workflow system will retry it. There is no obvious indication that the activity has failed at all other than the retry.
Steps to Reproduce the Problem
NOTE: The issue only occurs when the entity is added to the context via the
Add
method. Querying an entity and returning works as expected.Release Note
RELEASE NOTE:
The text was updated successfully, but these errors were encountered: