-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MongoDB should connect to STH sever after reconnectTries value is exhausted #592
Comments
@fgalan @mapedraza
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:
|
If MongoDB is started after
We are using default values i.e., reconnectTries: 30 and reconnectInterval: 1000
Yes, STH is reconnecting and responding correctly when MongoDB is started before |
@fgalan , What can be minimum and maximum values for As per my investigation only default values are provided in standard document and source code. Please find the below references: Can you please let me know what could be the minimum and maximum values for |
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
I think it has been already answered by @AlvaroVega at #572 (comment) |
Btw, could you provide some detail about your use case with STH? I mean, in which application are you using it? |
Issue Description:
This issue originates from issue #570.
When MongoDB is down, reconnect functionality starts working and make attempts till
reconnectTries
value reaches 30. If thereconnectTries
value is exhausted and after that MongoDB starts running then STH server could not connect to MongoDB.Reproduction Steps:
Make sure that STH server and MongoDB are running and connected together.
Stop the MongoDB.
Start the MongoDB when the
reconnectTries
value is exhausted.Execute the GET API.
Expected Result :
MongoDB should connect to STH server.
GET API should respond with attribute values.
Actual Result :
MongoDB is not connected to STH server.
GET API respond with:
The text was updated successfully, but these errors were encountered: