Skip to content

Connection reset with large amounts of documents #137

@TrollWarlord

Description

@TrollWarlord

It seems that the more documents you have, the higher chance of a disconnect. Then the lack of any retry policy causes your application to die.

Example query that causes this:


func DomainDocument(ctx *rethinkdb.Context) r.Term {
    return r.Db(ctx.Config.Database).Table("domains")
}

func FindDomainByDomain(ctx *rethinkdb.Context, domain string) (*Domain, error) {
    var err error
    var cursor *r.Cursor

    if cursor, err = DomainDocument(ctx).Filter(r.Row.Field("Domain").Eq(domain)).Run(ctx.Session); err != nil {
        return nil, err
    }
    defer cursor.Close()

    if cursor.IsNil() {
        return nil, nil
    }

    var d Domain
    if err = cursor.One(&d); err != nil {
        return nil, err
    }

    return &d, nil
}

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