xuther / go-message-router Goto Github PK
View Code? Open in Web Editor NEWA simple message router written in pure go, mainly for use as an event router.
A simple message router written in pure go, mainly for use as an event router.
Hi there!
I was looking at the packages and decided to run the tests (in race mode) in each. Unfortunately I didn't make it past the router tests before hitting a race condition and a separate deadlock.
The race occurred between:
go-message-router/subscriber/subscriber.go
Line 159 in cf7acc8
go-message-router/router/router.go
Line 84 in cf7acc8
I didn't look into the deadlock, but it occurred during TestLoad, I had to kill the test after 7 minutes.
=== RUN TestLoad
2019/02/27 11:00:31 Testing load
2019/02/27 11:00:31 Publisher: Starting publisher
2019/02/27 11:00:31 Publisher: Publisher ready.
2019/02/27 11:00:31 ERROR starting publisher listener: listen tcp :60010: bind: address already in use
2019/02/27 11:00:31 Starting distribution Channel
2019/02/27 11:00:31 Router: starting router
2019/02/27 11:00:31 Reciever: staring reciever
2019/02/27 11:00:31 Starting distribution Channel
2019/02/27 11:00:31 ERROR starting publisher listener: listen tcp :60011: bind: address already in use
2019/02/27 11:00:31 Starting subscription Manager.
2019/02/27 11:00:31 Reciever: reciever ready
2019/02/27 11:00:31 Reciever: Starting connection with localhost:60010
2019/02/27 11:00:31 Starting subscription Manager.
2019/02/27 11:00:31 Subscribed to localhost:60011.
2019/02/27 11:00:31 Starting listener
2019/02/27 11:00:31 Receiver: subscription to localhost:60010 added
2019/02/27 11:00:31 Subscribed to localhost:60010.
2019/02/27 11:00:31 Starting listener
^Csignal: interrupt
FAIL github.com/xuther/go-message-router/router 436.926s
This may or may not be the cause of this deadlock, but I suspect passing the sync.WaitGroup by value is causing the issue. As the vet tool points out, passing sync types by value results in misuse as the internal data structure is copied and the atomic operations for synchronization no longer work (each goroutine essentially has it's own copy of the WaitGroup, defeating the purpose of the WaitGroup).
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.