-
Notifications
You must be signed in to change notification settings - Fork 662
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Asyncronous read from deliveryChan timeouts #466
Comments
Try to make the deliveryChan buffered and see if it helps |
It didn't help. It looks like the fact that the channel is shared simultaneously between different calls causes the problem. |
I tried this code:
It still gets stuck occasionally. There is something I don't understand about kafka driver, but I can't quite make out what. |
It looks like people report various issues with cgo performance: golang/go#19574 |
Looking at your code it seems that if produce fails (with anything but QueueFull) it will either get stuck or panic in that go-routine where it sends to the sync channel, since the caller is just reading one err event from sync and then returning. |
@edenhill I rewrote the code without any goroutines: This code takes 200 microseconds for the batches of 1-2 records.
This code takes 50 milliseconds and occasionally jumps to 50 seconds. As you can see this code is synchronous except it waits for the results at the end:
|
Sorry, I misplaced the call that retrieves the results:
It should have been outside the for loop. Closing the ticket. |
Description
Consuming from delivery channel occasionally gets stuck when we consume from the channel
in a separate go routing.
If I read from deliveryChannel every time after I send a message the problem disappears.
================
Checklist
Please provide the following information:
LibraryVersion()
): 1.1.0ConfigMap{...}
: ck.NewProducer(&ck.ConfigMap{"bootstrap.servers": strings.Join(kafkaBrokers, ",")})158679003618.04~600aeb5-Ubuntu SMP Mon Apr 13 17:47:15 UTC x86_64 x86_64 x86_64 GNU/Linux"debug": ".."
as necessary)The text was updated successfully, but these errors were encountered: