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 2020/07/01 15:29:53 UTC

[GitHub] [skywalking-python] kezhenxu94 opened a new pull request #29: [Core][Defect] Validate carrier before using it

kezhenxu94 opened a new pull request #29:
URL: https://github.com/apache/skywalking-python/pull/29


   


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



[GitHub] [skywalking-python] kezhenxu94 commented on a change in pull request #29: [Core][Defect] Validate carrier before using it

Posted by GitBox <gi...@apache.org>.
kezhenxu94 commented on a change in pull request #29:
URL: https://github.com/apache/skywalking-python/pull/29#discussion_r448454910



##########
File path: skywalking/trace/carrier/__init__.py
##########
@@ -74,14 +74,26 @@ def val(self, val: str):
         if not val:
             return
         parts = val.split('-')
+        if len(parts) != 8:
+            return
         self.trace_id = b64decode(parts[1])
         self.segment_id = b64decode(parts[2])
-        self.span_id = int(parts[3])
+        self.span_id = int(parts[3]) if parts[3].isnumeric() else -1

Review comment:
       > Use a default -1 span could be mislinking the parent.
   
   If it falls through to `-1`, the `is_valid` always return false, and there's no chance that the carrier is used, anyway, just update the commit to dismiss the concern




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



[GitHub] [skywalking-python] kezhenxu94 commented on a change in pull request #29: [Core][Defect] Validate carrier before using it

Posted by GitBox <gi...@apache.org>.
kezhenxu94 commented on a change in pull request #29:
URL: https://github.com/apache/skywalking-python/pull/29#discussion_r448454910



##########
File path: skywalking/trace/carrier/__init__.py
##########
@@ -74,14 +74,26 @@ def val(self, val: str):
         if not val:
             return
         parts = val.split('-')
+        if len(parts) != 8:
+            return
         self.trace_id = b64decode(parts[1])
         self.segment_id = b64decode(parts[2])
-        self.span_id = int(parts[3])
+        self.span_id = int(parts[3]) if parts[3].isnumeric() else -1

Review comment:
       > Use a default -1 span could be mislinking the parent.
   
   If it falls back to `-1`, the `is_valid` always return false, and there's no chance that the carrier is used, anyway, just update the commit to dismiss the concern




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



[GitHub] [skywalking-python] kezhenxu94 commented on a change in pull request #29: [Core][Defect] Validate carrier before using it

Posted by GitBox <gi...@apache.org>.
kezhenxu94 commented on a change in pull request #29:
URL: https://github.com/apache/skywalking-python/pull/29#discussion_r448454910



##########
File path: skywalking/trace/carrier/__init__.py
##########
@@ -74,14 +74,26 @@ def val(self, val: str):
         if not val:
             return
         parts = val.split('-')
+        if len(parts) != 8:
+            return
         self.trace_id = b64decode(parts[1])
         self.segment_id = b64decode(parts[2])
-        self.span_id = int(parts[3])
+        self.span_id = int(parts[3]) if parts[3].isnumeric() else -1

Review comment:
       > Use a default -1 span could be mislinking the parent.
   
   If it falls through to `-1`, the `is_valid` always return false, and there's no chance that the carrier is used, anyway, just updated the commit to dismiss the concern




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



[GitHub] [skywalking-python] wu-sheng merged pull request #29: [Core][Defect] Validate carrier before using it

Posted by GitBox <gi...@apache.org>.
wu-sheng merged pull request #29:
URL: https://github.com/apache/skywalking-python/pull/29


   


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