Skip to content

IndexOutOfRangeException from BetterCache in UUIDNext #40

@tim-basic-fit

Description

@tim-basic-fit

I am seeing some incidental hard-to-reproduce exceptions being thrown from my backend from the UUIDNext library. I have a lot of instances running, with heavy threading/tasks, so it might be something related to thread-safety. I did see locking around BetterCache, so it looks like it's supposed to be threadsafe.

I am replacing the UUID generation with the new .NET 10 version (Guid.CreateVersion7), but I thought I'd pass this error on, there might be some issues in the BetterCache implementation.

Code:

Guid id = UUIDNext.Tools.UuidToolkit.CreateUuidV7FromSpecificDate(dateTime);

Stacktrace:

[
{"assembly":"System.Private.CoreLib, Version=10.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e","method":"Internal.Runtime.CompilerHelpers.ThrowHelpers.ThrowIndexOutOfRangeException","level":0,"line":0},
{"assembly":"UUIDNext, Version=4.2.2.0, Culture=neutral, PublicKeyToken=21e3efdd005d67ea","method":"UUIDNext.Tools.BetterCache`2.AddOrUpdate","level":1,"line":0},
{"assembly":"UUIDNext, Version=4.2.2.0, Culture=neutral, PublicKeyToken=21e3efdd005d67ea","method":"UUIDNext.Generator.UuidFromSpecificDateGeneratorBase.New","level":2,"line":0}
]

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions