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 2021/05/07 06:33:18 UTC

[GitHub] [skywalking] Ax1an edited a comment on pull request #6863: Fix possible NullPointerException in agent's ES plugin.

Ax1an edited a comment on pull request #6863:
URL: https://github.com/apache/skywalking/pull/6863#issuecomment-834101517


   **Why NPE2 happens?**
   
   ![image](https://user-images.githubusercontent.com/28091237/117406459-aae70780-af3f-11eb-898f-ab73cba91077.png)
   
   First, we need to make it clear that skywalking sets dynamic fields when enhancing the constructors in `org.elasticsearch.client.RestHighLevelClient` class.
   
   ![image](https://user-images.githubusercontent.com/28091237/117407424-21383980-af41-11eb-9c18-3053d72d6fbe.png)
   
   Secondly, we need to know that the exception occurred in the `org.apache.skywalking.apm.plugin.elasticsearch.v6.interceptor.RestHighLevelClientSearchMethodsInterceptor` class of enhanced the `org.elasticsearch.client.RestHighLevelClient.search` method.
   
   I checked the full agent log and found the following exception:
   
   ![image](https://user-images.githubusercontent.com/28091237/117406497-b803f680-af3f-11eb-8b44-ae6af1ad2bda.png)
   
   After asking related colleagues, I found that they used version 5.6.12 ES SDK.
   
   However, the argument types of constructors in version 5.x are different from those in version 6.x and 7.x.
   
   5.x constructors:
   
   ![image](https://user-images.githubusercontent.com/28091237/117406516-c05c3180-af3f-11eb-8b00-29ecc3a6319e.png)
   
   6.x and 7.x constructors:
   
   ![image](https://user-images.githubusercontent.com/28091237/117406552-ceaa4d80-af3f-11eb-8f1c-f970b3737974.png)
   
   So we need to add witness class to the `org.apache.skywalking.apm.plugin.elasticsearch.v6.define.RestHighLevelClientInstrumentation` class of elasticsearch-6.x-plugin to avoid enhancing the incompatible version.
   
   And later, I will create a new PR to add `RestHighLevelClient` related enhancement for elaticsearch-5.x-plugin.
   
   
   
   
   
   
   
   
   
   
   


-- 
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