Skip to content

Transaction was discarded to prevent inconsistency: one or more of active distributed locks were abandoned. Are you hitting Redis memory limits? #98

Open
@c5racing

Description

@c5racing

While using the progressbar per the example implementaion, we seeing Redis errors:

public void TaskMethod(PerformContext context)
{
    var bar = context.WriteProgressBar();
    
    foreach (var item in collection.WithProgress(bar))
    {
        // do work
    }
}

System.InvalidOperationException: Transaction was discarded to prevent inconsistency: one or more of active distributed locks were abandoned. Are you hitting Redis memory limits?
at Hangfire.Pro.Redis.RedisConnection.ExecuteTransaction(ITransaction transaction, CommandFlags flags)
at Hangfire.Pro.Redis.RedisTransaction.Commit()
at Hangfire.Console.Storage.ConsoleStorage.AddLine(ConsoleId consoleId, ConsoleLine line)
at Hangfire.Console.Server.ConsoleContext.AddLine(ConsoleLine line)
at Hangfire.Console.Progress.DefaultProgressBar.SetValue(Double value)
at Hangfire.Console.Progress.ProgressEnumerable`1.Enumerator.MoveNext()

We've validated there are no redis issues and these occurs didn't crop up until starting to use the StatusBar. Could there be issues when the foreach is too fast? Each of our ForEach loops has about 1000 objects in them.

image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions