channel.go: avoid race condition by synchronizing ch.send calls#499
channel.go: avoid race condition by synchronizing ch.send calls#499xaka wants to merge 1 commit intostreadway:masterfrom
Conversation
for example calls to Publish and QueueDeclare from multiple goroutines lead to messed up frames and eventual connection failure
| // Performs a request/response call for when the message is not NoWait and is | ||
| // specified as Synchronous. | ||
| func (ch *Channel) call(req message, res ...message) error { | ||
| ch.m.Lock() |
There was a problem hiding this comment.
Isn't there a lock implemented on the connection object c.sendM before writing to the frame. That should be doing the same thing, right?
There was a problem hiding this comment.
This is indeed typically done at connection level by various clients. We have to be really careful here as throughput effects of locking on the hot path can be very serious or even catastrophic for some systems.
|
Hey folks, I'm posting this on behalf of the core team. As you have noticed, this client hasn't seen a lot of activity recently. Because this client has a long tradition of "no breaking public API changes", certain We would like to thank @streadway Team RabbitMQ has adopted a "hard fork" of this client What do we mean by "hard fork" and what does it mean for you? The entire history of the project What does change is that this new fork will accept reasonable breaking API changes according If your PR hasn't been accepted or reviewed, you are welcome to re-submit it for Note that it is a high season for holidays in some parts of the world, so we may be slower Thank you for using RabbitMQ and contributing to this client. On behalf of the RabbitMQ core team, |
PublishandQueueDeclarefrom multiple goroutines lead to messed up frames and eventual connection failurePublish/QueueDeclarecalls using the same channelch.sendneeds to be wrapped bych.m.Lock/ch.m.Unlock