Comments (6)
Can you please let me know the reason of removal of above code as due to the same, the scenario mentioned in the description is not working.
The reason is the separation of concerns between the MongoDB driver and the code using that driver (STH itself). The reconnection is a job for the driver, not for STH.
With regards to the use case you describe, I have two doubts, pls:
- Which
reconnectTries
andreconnectInterval
values are you using? - With regards to step 4, if MongoDB is started before
reconnectTries
have been exhausted, is STH reconnecting and responding correctly?
from fiware-sth-comet.
The reason is the separation of concerns between the MongoDB driver and the code using that driver (STH itself). The >reconnection is a job for the driver, not for STH.
If MongoDB is started after
reconnectTries
is exhausted, Then in this scenario both the STH and MongoDB are running but user will receive error 500 which doesn't seem a good behavior. Please let me know your opinion.With regards to the use case you describe, I have two doubts, pls:
- Which
reconnectTries
andreconnectInterval
values are you using?We are using default values i.e., reconnectTries: 30 and reconnectInterval: 1000
- With regards to step 4, if MongoDB is started before
reconnectTries
have been exhausted, is STH reconnecting and responding correctly?Yes, STH is reconnecting and responding correctly when MongoDB is started before
reconnectTries
value is getting exhausted.
Thank you for your feedback!
Under my understanding, STH is behaving as expected. The reconnectTries/reconnectInterval configuration specifies the time you want to wait for reconnections. Expired that time, STH "gives up" so it's normal that even in the case MongoDB gets up again, STH doesn't longer tries to reconnect. In fact, maybe the behaviour should be that after that time STH process stops with a FATAL error, so an administrator can take the proper administrative actions.
If you what STH try to reconnect forever, then use "infinite" reconnectTries/reconnectInterval time. Of course, infinite doesn't exist in computer science, but a time absurdly high (e.g. 100 years :) has an equivalent effect.
With regards to
Can you please let me know what could be the minimum and maximum values for
reconnectTries
andreconnectInterval
?
I think it has been already answered by @AlvaroVega at #572 (comment)
from fiware-sth-comet.
@fgalan @mapedraza
This scenario was covered in PR #574 and we observed that the following code of the patch has been removed in PR #583
} else {
client.connect(function(err) {
if(err) {
return callback(err,null);
}
});
}
}
Can you please let me know the reason of removal of above code as due to the same, the scenario mentioned in the description is not working.
from fiware-sth-comet.
The reason is the separation of concerns between the MongoDB driver and the code using that driver (STH itself). The >reconnection is a job for the driver, not for STH.
If MongoDB is started after reconnectTries
is exhausted, Then in this scenario both the STH and MongoDB are running but user will receive error 500 which doesn't seem a good behavior. Please let me know your opinion.
With regards to the use case you describe, I have two doubts, pls:
- Which
reconnectTries
andreconnectInterval
values are you using?
We are using default values i.e., reconnectTries: 30 and reconnectInterval: 1000
- With regards to step 4, if MongoDB is started before
reconnectTries
have been exhausted, is STH reconnecting and responding correctly?
Yes, STH is reconnecting and responding correctly when MongoDB is started before reconnectTries
value is getting exhausted.
from fiware-sth-comet.
@fgalan , What can be minimum and maximum values for reconnectTries
and reconnectInterval
?
As per my investigation only default values are provided in standard document and source code. Please find the below references:
https://mongodb.github.io/node-mongodb-native/3.3/reference/connecting/connection-settings/ https://github.com/mongodb/node-mongodb-native/blob/v3.6.12/lib/mongo_client.js#L117-L118
Can you please let me know what could be the minimum and maximum values for reconnectTries
and reconnectInterval
?
from fiware-sth-comet.
Btw, could you provide some detail about your use case with STH? I mean, in which application are you using it?
from fiware-sth-comet.
Related Issues (20)
- non enough permissions over temp directory HOT 1
- Configured Cygnus with STH-comet, but unable to retrieve data from Mongo DB HOT 18
- Issue with some parameters of the STH API HOT 4
- Response gets mixed when multiple requests are executed simultaneously with filetype=csv HOT 11
- Incorrect Response format when filetype=csv is used with hLimit and hOffset HOT 3
- Problem when querying Raw Data with STH-Comet - Returns empty HOT 3
- Seen sth collections with double slash HOT 3
- SemVer Docker images missing HOT 11
- Missleading trace information HOT 1
- Sth-Comet does not reconnect with MongoDB. HOT 17
- migrate mongo driver from 2.2.X to 3.6.Y HOT 1
- Return 500 when DB is not connected HOT 16
- MongoDB 5.0 errores running unit tests (maybe something in STH implementation should be fixed?)
- Cannot create seperate records per update or sth tables on MongoDB. HOT 3
- Problem on persisting first data payload on MongoDB when creating a new collection at the same time HOT 4
- TRUNCATION_EXPIRE_AFTER_SECONDS doesn't work HOT 7
- How to configure CORS in docker environment variables HOT 6
- RDT. Action required? HOT 2
- Support Status of MongoDB HOT 2
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 fiware-sth-comet.