Comments (9)
It is doing check that port is available and if yes bind to this port, but since there 50 nodes doing it in parallel there is a race condition between the check and binding.
For test purpose I recommend to either start each node on specific port or at least configure starting port different for each node in order to avoid contention for the ports at all.
Here is a transport config example how to start each node on different fixed port:
TransportConfig conf = TransportConfig.builder()
.port(TransportConfig.DEFAULT_PORT + nodeIndex)
.portAutoIncrement(false)
.build()
from scalecube-services.
i understand there are ways to workaround this issue but i think that its better to locate port until success
users might fall on taken ports even if they are not taken by cluster code it self and still would like to start a node successfully - not only because of this specific case but also by the desire to run several nodes under same container or just by mistake try to connect on already used port.
from scalecube-services.
Just for clarity, if you try to connect on already used port it will not fail with port already used exception since it will select next available one, the issue is specific for the case when you start many cluster nodes on same machine at same moment of time and all of them trying to bind to the same port range. So outside of the code snippet above it would pretty difficult to reproduce it otherwise.
from scalecube-services.
ok so can it be same situation that someone take my port at this exact moment of time?
my process starts and someone take the port... is it really matters who?
from scalecube-services.
It's possible only in case if they start practically in the same moment of time like in the range of some nano seconds or so.
from scalecube-services.
yep - exactly.
so need to fail-over and not fail
from scalecube-services.
Yes, but it's practically impossible outside of the code snippet above where you start several nodes in the for-loop concurrently.
from scalecube-services.
i didnt understand why its not possible
i start just one node and someone in some rare moment of time just take this port...
from scalecube-services.
Fixed in PR: #117
from scalecube-services.
Related Issues (20)
- Unstable test ServiceCallRemoteTest.test_many_stream_block_first()
- Investigate warnings due to java.nio.channels.ClosedChannelException from rsocket client HOT 3
- Reconsider/refactor/simplify code in .toResponse HOT 3
- Change error qualifer format HOT 4
- Create settings function for `headers` in ServiceCall HOT 1
- Refactor ServiceMethodInvoker.authenticate line 158 HOT 1
- Support qualifier format with version HOT 1
- Headers Naming Convention
- Why Service interface and qualifier has one-to-one relationship HOT 5
- NoSuchElementException from Microservices#discovery HOT 4
- Incorrect REQUEST_CHANNEL method
- Move ConnectionSetupCodec to scalecube-services-api
- Is there any up to date documentation anywhere? HOT 1
- Website expired? HOT 2
- Measure performance with java 17 + loom enabled HOT 1
- How to dynamically register services HOT 6
- Java 9+ Module Support HOT 1
- Add AutoCloseable on Microservices HOT 3
- kubernetes
- Dynamic service registration after Microservices instance is started
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 scalecube-services.