You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by GitBox <gi...@apache.org> on 2019/05/26 11:48:18 UTC

[GitHub] [skywalking] wu-sheng commented on a change in pull request #2756: mongodb-3.x-plugin: add support for previous versions of 3.3

wu-sheng commented on a change in pull request #2756: mongodb-3.x-plugin: add support for previous versions of 3.3
URL: https://github.com/apache/skywalking/pull/2756#discussion_r287594455
 
 

 ##########
 File path: apm-sniffer/apm-sdk-plugin/mongodb-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/mongodb/v3/MongoDBMethodInterceptor.java
 ##########
 @@ -201,7 +201,13 @@ private String limitFilter(String filter) {
     public void onConstruct(EnhancedInstance objInst, Object[] allArguments) {
         Cluster cluster = (Cluster)allArguments[0];
         StringBuilder peers = new StringBuilder();
-        for (ServerDescription description : cluster.getDescription().getServerDescriptions()) {
+        Collection<ServerDescription> descriptions;
+        try {
+            descriptions = cluster.getDescription().getServerDescriptions();
+        } catch (Throwable t) {
+            descriptions = cluster.getDescription().getAll();
 
 Review comment:
   Please use witness class to identify versions, using exception is very bad for performance.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services