Closed hquangthinh closed 2 years ago
@hquangthinh - thank you for your time to investigate the issue and also for the fix. I will put some time during the weekend to accept and release the package
Waiting for this fix. I am getting this exception
{"status":500,"code":"ERR_INTERNAL_SERVER_ERROR","message":"Internal server error","failure":"System.Collections.Generic.KeyNotFoundException: The given key 'EnqueuedAt' was not present in the dictionary.\r\n at TValue System.Collections.Generic.Dictionary<TKey, TValue>.get_Item(TKey key)\r\n at JobList
This might be unrelated, but might also fix:
FAIL|1643677788979|BackgroundExecution|9e652624df2a4d06860d579e476d112d|0|0|0|Execution RecurringJobScheduler is in the Failed state now due to an exception, execution will be retried no more than in 00:00:16
XMSG|9e652624df2a4d06860d579e476d112d|System.ArgumentException: An item with the same key has already been added. Key: Queue
XMSG|9e652624df2a4d06860d579e476d112d| at System.Collections.Generic.Dictionary`2.TryInsert(TKey key, TValue value, InsertionBehavior behavior)
XMSG|9e652624df2a4d06860d579e476d112d| at System.Collections.Generic.Dictionary`2.Add(TKey key, TValue value)
XMSG|9e652624df2a4d06860d579e476d112d| at System.Linq.Enumerable.ToDictionary[TSource,TKey,TElement](IEnumerable`1 source, Func`2 keySelector, Func`2 elementSelector, IEqualityComparer`1 comparer)
XMSG|9e652624df2a4d06860d579e476d112d| at System.Linq.Enumerable.ToDictionary[TSource,TKey,TElement](IEnumerable`1 source, Func`2 keySelector, Func`2 elementSelector)
XMSG|9e652624df2a4d06860d579e476d112d| at Hangfire.Azure.CosmosDbConnection.GetAllEntriesFromHash(String key)
XMSG|9e652624df2a4d06860d579e476d112d| at Hangfire.RecurringJobExtensions.GetRecurringJob(IStorageConnection connection, String recurringJobId, ITimeZoneResolver timeZoneResolver, DateTime now)
XMSG|9e652624df2a4d06860d579e476d112d| at Hangfire.Server.RecurringJobScheduler.TryEnqueueBackgroundJob(BackgroundProcessContext context, IStorageConnection connection, String recurringJobId, DateTime now)
XMSG|9e652624df2a4d06860d579e476d112d| at Hangfire.Server.RecurringJobScheduler.<>c__DisplayClass18_0.<EnqueueNextRecurringJobs>b__0(IStorageConnection connection)
XMSG|9e652624df2a4d06860d579e476d112d| at Hangfire.Server.RecurringJobScheduler.UseConnectionDistributedLock[T](JobStorage storage, Func`2 action)
XMSG|9e652624df2a4d06860d579e476d112d| at Hangfire.Server.RecurringJobScheduler.EnqueueNextRecurringJobs(BackgroundProcessContext context)
XMSG|9e652624df2a4d06860d579e476d112d| at Hangfire.Server.RecurringJobScheduler.Execute(BackgroundProcessContext c
ontext)
XMSG|9e652624df2a4d06860d579e476d112d| at Hangfire.Server.BackgroundProcessDispatcherBuilder.ExecuteProcess(Guid executionId, Object state)
XMSG|9e652624df2a4d06860d579e476d112d| at Hangfire.Processing.BackgroundExecution.Run(Action`2 callback, Object state)
@imranmomin did you review this PR?
I was able to review. The only issue is the order of the document return and it may not always be at the top. But anyway give it a try if that helps
Thanks!
@hquangthinh does the document return order look ok to you?
Thanks!
@hquangthinh does the document return order look ok to you?
We moved to Hangfire redis as the fix still cannot be guaranteed in multiple servers environment
Hi @imranmomin appreciate it if you could spend sometimes to look at my PR for this issue https://github.com/imranmomin/Hangfire.AzureCosmosDb/issues/21