Skip to content

BulkIndexer reads whole buffer before writing to ErrorChannel #198

@gburgett

Description

@gburgett

Currently, in startHttpSender(), if an error occurs then the buffer which was sent is queued to the ErrorChannel. Unfortunately, with the default Send implementation, this buffer has been fully read. My application code is reading from the ErrorChannel to perform more complex error handling, and I need to read that buffer.

I'm working around it right now with this code where I instantiate the indexer:

indexer.Sender = func(buf *bytes.Buffer) error {
        //clone the buffer before we send
        return indexer.Send(bytes.NewBuffer(buf.Bytes()))
    }

If I have some time later I may submit a pull request, it should be a simple change.

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