Azure / azure-event-hubs-go

Golang client library for Azure Event Hubs https://azure.microsoft.com/services/event-hubs
MIT License
89 stars 69 forks source link

Go routine leak in azure-event-hubs-go/v2/eph.(*leasedReceiver).Run #140

Open jonnylangefeld opened 5 years ago

jonnylangefeld commented 5 years ago

Expected Behavior

Amount of go routines for Go routine leak in azure-event-hubs-go/v2/eph.(*leasedReceiver).Run.func1 doesn't increase over time

Actual Behavior

the go routines are leaking and memory footprint grows

Analysis

This is basically the same issue as described ind #136. Here are two screenshots taken 1:40 hrs apart from each other indicating a significant increase of go routines for the described function:

Screen Shot 2019-09-03 at 11 38 02 AM

Screen Shot 2019-09-03 at 1 19 17 PM

Environment

gavinfish commented 5 years ago

@jonnylangefeld do you call (*leasedReceiver).Close for each lr?

elsesiy commented 5 years ago

@gavinfish We don't. We're using the almost exact code as in the readme for EPH which doesn't manually close the leasecheckpointer at all. Our setup differs only in that we write the incoming events to a channel to be processed concurrently later on. The application runs continuously as there will be always events in the EventHubs namespace in our case. Does this answer your question?

hoenirvili commented 5 years ago

I'm experiencing the same behavior in my production setup. Is this resolved?

birdayz commented 4 years ago

are there any plans to fix this?

elsesiy commented 4 years ago

We ended up migrating to shopify/sarama and using the Kafka interface. The library is not only much more efficient but also well maintained. Maybe that works for you too?