Skip to content

Commit 716fb97

Browse files
committed
fix: enabling gzip was causing eof errors upon decompression
1 parent 92d3e8e commit 716fb97

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

exporter/awskinesisexporter/internal/compress/compresser.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ type bufferedResetWriter interface {
1616
Write(p []byte) (int, error)
1717
Flush() error
1818
Reset(newWriter io.Writer)
19+
Close() error
1920
}
2021

2122
type Compressor interface {
@@ -74,5 +75,11 @@ func (c *compressor) Do(in []byte) ([]byte, error) {
7475
return nil, err
7576
}
7677

78+
if closer, ok := c.compression.(io.Closer); ok {
79+
if err := closer.Close(); err != nil {
80+
return nil, err
81+
}
82+
}
83+
7784
return buf.Bytes(), nil
7885
}

exporter/awskinesisexporter/internal/compress/noop_compression.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,5 @@ func (n noop) Write(p []byte) (int, error) {
2626
func (n noop) Flush() error {
2727
return nil
2828
}
29+
30+
func (n *noop) Close() error { return n.Close() }

0 commit comments

Comments
 (0)