Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BulkIndexer reads whole buffer before writing to ErrorChannel #198

Open
gburgett opened this issue May 19, 2015 · 0 comments
Open

BulkIndexer reads whole buffer before writing to ErrorChannel #198

gburgett opened this issue May 19, 2015 · 0 comments

Comments

@gburgett
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant