|
225 KB
|
105 KB
|
164 KB
|
79 KB
|
68 KB
The problem exists in MongoShell as well & is reproducible in v16.
Desired behavior: similar to Mongo CLI, an error message is displayed that ADS couldn't connect. In addition, the db variable still references the "older" / valid connection.
From Jenny:
From Jenny:
The connect()
MongoJS function is basically just a helper that ultimately invokes new Mongo(...).getDB()
, therefore the same observations posted on issue #13889 about Mongo Java Driver's lazy socket communication apply here.
The connect()
MongoJS function is basically just a helper that ultimately invokes new Mongo(...).getDB()
, therefore the same observations posted on issue #13889 about Mongo Java Driver's lazy socket communication apply here.
Ideally, we should detect that the connect call has failed and not re-assign the connection information to the invalid value specified by the user.
In order to achieve this behaviour with MongoJS and ADS MongoShell, the patch described on issue #13889 should be applied. However, I am not sure if such change would be safe to apply for ADS v17. Extended MongoJS test sessions should be performed in order to ensure that this change does not cause regressions.
Ideally, we should detect that the connect call has failed and not re-assign the connection information to the invalid value specified by the user.
In order to achieve this behaviour with MongoJS and ADS MongoShell, the patch described on issue #13889 should be applied. However, I am not sure if such change would be safe to apply for ADS v17. Extended MongoJS test sessions should be performed in order to ensure that this change does not cause regressions.
Update: we're evaluating a couple of patches sent by Emil & will decide tomorrow on what approach to take.
Update: we're evaluating a couple of patches sent by Emil & will decide tomorrow on what approach to take.
Applied Emil's patch on Mongo.java to trigger a socket connection to be opened, thus ensuring that the new Mongo connection is valid. This fixes both MongoJS and MongoShell.
When the connect command fails, an error is returned and the connection information isn't re-assigned to the invalid value specified in the connect command. The connection remains valid with the existing host.
I've also updated Query Analyzer code to handle the error when updating the auto-complete configurator fails. If we run into a scenario where the connection has become bad and the auto-complete configurator update fails, we'll just log and error and then continue to process the buttons and status icon so that the Query Analyzer window doesn't look as if it were in an infinite loop.
Note to QA team: Please run regression testing using different server environments - standalone, replica set, sharded cluster, and verify that connections to valid and invalid servers are working properly.
Applied Emil's patch on Mongo.java to trigger a socket connection to be opened, thus ensuring that the new Mongo connection is valid. This fixes both MongoJS and MongoShell.
When the connect command fails, an error is returned and the connection information isn't re-assigned to the invalid value specified in the connect command. The connection remains valid with the existing host.
I've also updated Query Analyzer code to handle the error when updating the auto-complete configurator fails. If we run into a scenario where the connection has become bad and the auto-complete configurator update fails, we'll just log and error and then continue to process the buttons and status icon so that the Query Analyzer window doesn't look as if it were in an infinite loop.
Note to QA team: Please run regression testing using different server environments - standalone, replica set, sharded cluster, and verify that connections to valid and invalid servers are working properly.
Verified in ADS17.0.0-GA-5
Please refer screenshot:Fixed-17GA5
Verified in ADS17.0.0-GA-5
Please refer screenshot:Fixed-17GA5
Verified in ADS-18.0.0-DEVI-88.
Please refer screenshot: verify13987.png.
Verified in ADS-18.0.0-DEVI-88.
Please refer screenshot: verify13987.png.
Verified in ADS-18.0.-RC-15. Refer updated screenshot 'verified#13987.png'
Verified in ADS-18.0.-RC-15. Refer updated screenshot 'verified#13987.png'
Issue #13987 |
Closed |
Fixed |
Resolved |
Completion |
No due date |
Fixed Build ADS 18.0.0-devi-83 (mongo-jdbc 2.4.8.2) |
No time estimate |
1 issue link |
duplicates #13889
Issue #13889db = new Mongo().getDB("Customer") commands connect to DB, where Mongo CLI returns error message. |
The problem exists in MongoShell as well & is reproducible in v16.
Desired behavior: similar to Mongo CLI, an error message is displayed that ADS couldn't connect. In addition, the db variable still references the "older" / valid connection.