You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pegasus.apache.org by GitBox <gi...@apache.org> on 2021/10/19 01:29:49 UTC

[GitHub] [incubator-pegasus] padmejin commented on pull request #828: fix: coredump when table name contains '_' and prometheus is enabled

padmejin commented on pull request #828:
URL: https://github.com/apache/incubator-pegasus/pull/828#issuecomment-946292504


   As this picture shows below, when core dumps it was trying to analyze metric naming `replica_econ_replica_table_level_RPC_RRDB_RRDB_REMOVE_latency_ns_:impala_historical_profile_p999`, where `impala_historical_profile` is a table we created earlier that contains multiple underscore.
   
   ![wecom-temp-979f68e2dd409e3c69aadc62fab16057](https://user-images.githubusercontent.com/89557328/137827981-12c630e0-77d1-497c-953a-cab1bd3fe74d.png)
   
   As the code shown below on line 256, it tries to split metrics_name by `:` first, then split the last part by `_` and put the splited tokens in an array that length is 3. Because this table already contains underscore, there are more than 3 tokens, so it got core dumped after at line 259 trying to set the fourth element of the array.
   ![wecom-temp-b491dd1192d580d28b13da889d23196e](https://user-images.githubusercontent.com/89557328/137828313-d25dd0cd-bc00-4868-8825-8ef86be0ef5d.png)
   
   This patch fix it by switching these format order: 
   Firstly, it try to parse gpid as prometheus labels by spliting the foramted name by `:` or `@`.
   Then, it  formated the table name by replacing special charactor to `_` or "@".
   
   In this order tables that contains `_` can be parsed expectedly in the first step.
   
   


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

To unsubscribe, e-mail: dev-unsubscribe@pegasus.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@pegasus.apache.org
For additional commands, e-mail: dev-help@pegasus.apache.org