valyala / gozstd

go wrapper for zstd
MIT License
420 stars 60 forks source link

`NewWriterParams` fails when `confluent-kafka-go` is in dependencies #38

Closed nurlybekovnt closed 2 years ago

nurlybekovnt commented 2 years ago

I got a panic in this code

package main

import (
    "bytes"

    "github.com/confluentinc/confluent-kafka-go/kafka"
    "github.com/valyala/gozstd"
)

func main() {
    var _ kafka.ConfigMap
    gozstd.NewWriterParams(&bytes.Buffer{}, &gozstd.WriterParams{})
}

Trace:

panic: BUG: unexpected error in ZSTD_CCtx_setParameter: Operation not authorized at current processing stage

goroutine 1 [running]:
github.com/valyala/gozstd.ensureNoError(0x8bf4e4, 0x16, 0xffffffffffffffc4)
        /home/iwfg/go/src/confluentkafka-zstd/vendor/github.com/valyala/gozstd/gozstd.go:332 +0x13f
github.com/valyala/gozstd.initCStream(0x1c95820, 0x0, 0x0, 0x0)
        /home/iwfg/go/src/confluentkafka-zstd/vendor/github.com/valyala/gozstd/writer.go:232 +0x96
github.com/valyala/gozstd.NewWriterParams(0x8dde18, 0xc0001001b0, 0xc000055f60, 0x0)
        /home/iwfg/go/src/confluentkafka-zstd/vendor/github.com/valyala/gozstd/writer.go:161 +0x66
main.main()
        /home/iwfg/go/src/confluentkafka-zstd/main.go:12 +0x70
exit status 2
azubkokshe commented 2 years ago

Try to update confluent-kafka-go to 1.8.2 version. I got it

nurlybekovnt commented 2 years ago

@azubkokshe, it helped. Thanks, buddy