Skip to content

Possible bug: SearchCommands.SearchAsync() occasionally throws an IndexOutOfRange exception #448

@MartBentNedap

Description

@MartBentNedap

What version of NRedisStack are you using?
0.13.2

What version of Redis are you using?
7.4

What did you do?
We are doing a SearchCommands.SearchAsync() command on our Redis server.

What did you expect to see?
A valid search result returned by the function.

What did you see instead?
An IndexOutOfRangeException is thrown inside the SearchAsync() command. This exception is do documented anywhere as far as I am aware.

Sometimes our production environment logs a IndexOutOfRange exception when doing a SearchAsync call to our Redis server. We have had trouble reproducing it locally, so we added some temporary code to make sure it happened in the driver:

        SearchResult searchResult;
        try
        {
            searchResult = await searchCommands.SearchAsync(indexName, queryParams);
        }
        catch (IndexOutOfRangeException)
        {
            Log.Error("IndexOutOfRange occured with Query: {Query} SORTBY {SortBy} LIMIT 0 {Limit}", queryParams.QueryString, queryParams.SortBy, limit ?? 51);
            throw;
        }

This logs the follow result:
IndexOutOfRange occured with Query: "@workspaceId:{ID} @test:{false} @locationId:{LOC_ID} @sequenceId:[33483 9223372036854775807] " SORTBY "sequenceId" LIMIT 0 1001

We have already tried several ways of reproducing the error locally, by dropping indexes, corrupting indexes, invalidating keys. But nothing seems to trigger the exception. We are not familiar with the underlying driver codebase/implementation so it is only guesswork. We were also unable to find any documentation regarding this exception.

Is this a bug in the driver or are we doing something wrong on our end?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions