I am running web job sdk (v 2.0.0) and using QueueTrigger attribute. I wanted to give my messages more time when I am stopping/deploying web job, so I used { "stopping_wait_time": 60 } setting in settings.job file which works great. Unfortunately I observed that messages that complete in that extra time when web job is shutting down are not treated as executed correctly (and they appear on the queue again after sometime) even though they are fully processed.
My code looks like that:
public async Task ProcessQueueMessage([QueueTrigger("Queue1")] string message, TextWriter log, CancellationToken cancellationToken)
{
var stopwatch = Stopwatch.StartNew();
Logger.LogDebug("New message from queue: {Message}", message);
var seconds = int.Parse(message);
await Task.Delay(TimeSpan.FromSeconds(seconds));
Logger.LogDebug("Finished processing message: {Message}. Duration: {Duration}ms", message, stopwatch.ElapsedMilliseconds);
}
So this is problematic not just because of the state shown in the dashboard but because the messages were put back on the queue, which definitely does not seem correct.
I am running web job sdk (v 2.0.0) and using QueueTrigger attribute. I wanted to give my messages more time when I am stopping/deploying web job, so I used { "stopping_wait_time": 60 } setting in settings.job file which works great. Unfortunately I observed that messages that complete in that extra time when web job is shutting down are not treated as executed correctly (and they appear on the queue again after sometime) even though they are fully processed.
My code looks like that:
Dashboard shows that messages never finished:
But from logs I see they finished:
Am I missing something here?