Open sourcerist opened 1 year ago
thanks for update pls share allrepro steps
pls share function name timestamp region etc .
EntityBugRepro.zip
@bhagyshricompany here are the repro steps:
1.) open the attached EntityBugRepro.zip project in VS2022
2.) Run the project either with or without debugging
3.) Get the route prefix for the StartLongRunningTask
function (in my case it was http://localhost:7084/api/StartLongRunningTask/)
4.) Tell the task to run for 30 seconds by going to e.g. http://localhost:7084/api/StartLongRunningTask/30 and note that the 'LongRunningTask' function executes once:
5.) Tell the task to run for 10 minutes by going to e.g. http://localhost:7084/api/StartLongRunningTask/600 and note that it executes 'LongRunningTask' repeatedly. Note also that 'StartLongRunningTask' only executes once despite 'LongRunningTask' executing many times, and that "(Reason='(null)" appears in the logs on executions after the first:
thanks for input will check at our end and update you asap
@bhagyshricompany I reproduced it using a fresh install of Visual Studio 2022 Community Edition: Here are the complete logs: durable_entity_logs.txt
I have found the cause of the bug. It appears the AzureStorage provider (the default storage provider backend) does not renew the pop receipts for the message that is being processed, so by the time the work item commits, it fails when it tries to delete the message. This then causes the whole thing to run again.
We will need to fix this by adding code to renew the pop receipt. Something similar may already be in place for actitivies, I believe.
@sebastianburckhardt that's great! Do you have a timeline for when it will be released?
@sebastianburckhardt I see you merged this 3 weeks ago, but the latest release is still from Feb 1. Can you let me know when a release with this fix will be available?
There have been delays in getting both of the required packages released. I believe @davidmrdavid is still working on releasing an update.
Yes, apologies for the delay. I expect these packages to release this week though, as the validation has succeeded.
I have a long running task that needs to only have one instance running at a time. I chose Azure Durable Entities based on the documentation that these are designed for this sort of situation, but it seems that past a certain threshold the entity will re-run the task after execution has completed. It does the job of single threading the task beautifully, but never seems to recognize that it has completed.
Here is an example with the Sleep call representing the long running task execution:
If I tell it to wait 30 seconds, it behaves as expected:
But if I tell it to wait 10 minutes, it enters an endless loop where it doesn't recognize the successful completion of the previous iteration. Note the state at the beginning of each attempt stays at "runCount": 1:
I have the function timeout set to 4 hours in my host.json file and a premium app service plan that allows for longer running functions.