Comments (4)
It's looke like some issue is here
log.Printf("callback: publish confirmed status [%v] from queue [%s]\n", confirm.Ack, ch.Queue())
channel.Queue method has a lock
func (ch *Channel) Queue() string {
ch.baseChan.mu.RLock()
defer ch.baseChan.mu.RUnlock()
return ch.queue
}
If you change ch.Queue() for simple string, for example "queueName" - all is good
from garagemq.
It looks like lock/unluck on ch.Queue is useless and make some decrease in performance
from garagemq.
@valinurovam Thank you for response.
So you mean, If I remove lock, it might work?
Question: Is lock necessary there? Because I don't see any operations that might cause deadlock
from garagemq.
Looks like deadlock somewhere. If you change method like this
// Queue returns the active (as indicated by [IsDestination] option in topology options) queue name.
// Useful for finding the server assigned name.
func (ch *Channel) Queue() string {
fmt.Println("try to get lock... ")
ch.baseChan.mu.RLock()
fmt.Println(" locked.")
defer func() {
fmt.Println(" unlocked.\n")
ch.baseChan.mu.RUnlock()
}()
return ch.queue
}
Logs
try to get lock...
2023/12/29 19:11:40 going to send: test number 1623
locked.
unlocked.
callback: publish confirmed status [true] from queue [workload]
try to get lock...
2023/12/29 19:11:40 going to send: test number 1624
locked.
unlocked.
callback: publish confirmed status [true] from queue [workload]
2023/12/29 19:11:40 going to send: test number 1625
2023/12/29 19:11:40 going to send: test number 1626
2023/12/29 19:11:40 going to send: test number 1627
2023/12/29 19:11:40 going to send: test number 1628
try to get lock...
2023/12/29 19:11:40 going to send: test number 1629
locked.
unlocked.
callback: publish confirmed status [true] from queue [workload]
try to get lock...
from garagemq.
Related Issues (19)
- Concern Regarding Code Quality of Badger
- Support buntdb's wrapper new iterate methods
- Heartbeats
- AMQP rules checks
- Changes for ARM HOT 8
- Support signaling readiness to systemd
- copyright/licensing feedback HOT 1
- Pluggable backend support? HOT 1
- Does this MQ brocker support cluster? HOT 1
- Is it possible to use GarageMQ as an embedded RabbitMQ/AMQP server? HOT 3
- Replace unmaintained 'github.com/streadway/amqp' library with the standard 'github.com/rabbitmq/amqp091-go' HOT 1
- Please review and merge #81 HOT 1
- Any way to silence/reformat the logs? HOT 1
- Support for durable queues? HOT 7
- [QUESTION] - Any Golang example for Consumer and Publisher? HOT 1
- [POSSIBLE BUG] - Server or badger seems to freeze when consumer is rerun when using Topic Exchange HOT 3
- [FEATURE REQUEST] - Support for plugins like Shovel HOT 2
- [POSSIBLE BUG] - Consumer gets auto shutdown at random when publisher publishes multiple times HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from garagemq.