IBM / event-streams

IBM Event Streams issues repository. For more details, see the website:
https://ibm.github.io/event-streams/
Apache License 2.0
12 stars 16 forks source link

KafkaProducer nil pointer reference issued when rolling Kafka brokers #77

Closed JEFFLUFC closed 3 years ago

JEFFLUFC commented 4 years ago

Issue Description Messages fail to be produced using the Rest Producer and the following error is seen in the Rest Producer logs:

http: panic serving n.n.n.n:12345: runtime error: invalid memory address or nil pointer dereference goroutine 8294 [running]: net/http.(conn).serve.func1(0xc00010a000) /usr/local/go/src/net/http/server.go:1769 +0x139 panic(0x8f0ec0, 0xdf6af0) /usr/local/go/src/runtime/panic.go:522 +0x1b5 github.ibm.com/mhub/rest-producer/pkg/producer.(singleTenant).Produce(0xc0001335c0, 0xc00037e5d0, 0xc00010a1e0, 0x6fc23ac00, 0x0, 0x0, 0x0, 0x0) /home/jenkins/go/src/github.ibm.com/mhub/rest-producer/pkg/producer/singletenant.go:85 +0x194 github.ibm.com/mhub/rest-producer/pkg/api.(KafkaRestAPI).Produce(0xc00011ece0, 0xc0003920cd, 0x6, 0xa47da0, 0xc00038a000, 0xc0001d8200) /home/jenkins/go/src/github.ibm.com/mhub/rest-producer/pkg/api/api.go:210 +0x187f github.ibm.com/mhub/rest-producer/pkg/api.(KafkaRestAPI).produceKafkaHandler(0xc00011ece0, 0xa47da0, 0xc00038a000, 0xc0001d8200) /home/jenkins/go/src/github.ibm.com/mhub/rest-producer/pkg/api/api.go:374 +0x96 net/http.HandlerFunc.ServeHTTP(0xc000133690, 0xa47da0, 0xc00038a000, 0xc0001d8200) /usr/local/go/src/net/http/server.go:1995 +0x44 github.ibm.com/mhub/rest-producer/vendor/github.com/gorilla/mux.(Router).ServeHTTP(0xc0001700c0, 0xa47da0, 0xc00038a000, 0xc0001d8000) /home/jenkins/go/src/github.ibm.com/mhub/rest-producer/vendor/github.com/gorilla/mux/mux.go:212 +0xe3 net/http.serverHandler.ServeHTTP(0xc000123ba0, 0xa47da0, 0xc00038a000, 0xc0001d8000) /usr/local/go/src/net/http/server.go:2774 +0xa8 net/http.(conn).serve(0xc00010a000, 0xa48ee0, 0xc00002e2c0) /usr/local/go/src/net/http/server.go:1878 +0x851 created by net/http.(*Server).Serve /usr/local/go/src/net/http/server.go:2884 +0x2f4 {"error":"kafka: client has run out of available brokers to talk to (Is your cluster reachable?)","ibm_datetime":"Jun 10 12:54:37.832","ibm_fileName":"api.go","ibm_lineNumber":215,"kafka_error_code":null,"loglevel":"DEBUG","message":"error producing to topic1 : 500 kafka: client has run out of available brokers to talk to (Is your cluster reachable?)","message_template":"error producing to [topic] : [status_code] [error]","module":"RestProducer","status_code":500,"topic":"topic1","transaction_id":"e3175c78-1749-4e1e-8223-9b3d83a2396c","type":"IES","verbose":true}

Issue Resolution The Nil Pointer was seen when the REST Producer code attempted to reuse a failed connection to the broker. The code has been updated to remove failed connections.

Workaround None available

Fix details IBM Internal issue number - 3310 Fix target - Release after 2019.4.2

Steve-Dare commented 3 years ago

Internal issue 3310 has been closed as fixed, therefore closing this issue.