- [Fix] Stop
#flushfrom running middleware twice on messages re-buffered after a failed flush (regression of #474 reintroduced by the failure/requeue path), which double-encrypted/compressed/serialized payloads and duplicated headers on retry. - [Fix] Re-check the producer liveness under
@buffer_mutexin#buffer/#buffer_many, so a producer closed between the liveness check and the append raisesProducerClosedErrorinstead of accepting the message into a closed producer's buffer and losing it silently. - [Fix] Restore both buffers when
#flushfails before anything is dispatched (a middleware step raising, for example) instead of discarding the whole batch. OnlyProduceManyErrorandMessageInvalidErrorwere covered before.