Shopify/sarama — pull request #82 by patricklucas (2014-04-30 18:45:19+00:00)
Title: Fix two minor bugs in producer.go

- Remove a second superfluous call to bp.flush when bp.flushNow is
triggered.
- Release delivery lock after use instead of deferring until end of
function.

Regarding the second: a deferred call is deferred until the end of the function, not the end of the scope, and it appears the delivery lock can be released after the delete instead of later at the end of the function.