Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Function "_safe_header" reuse the "_headers" attribute which caused the 1st inbound trace ID to be reused forever #34

Open
RunzhongHuang opened this issue Oct 22, 2021 · 0 comments

Comments

@RunzhongHuang
Copy link

In function "_safe_header", it has the following logic:

def _safe_headers(self, headers):
    if hasattr(self, "_headers"):
        return self._headers
    self._headers = dict((k.lower(), v) for k, v in headers.__iter__())
    return self._headers

If the 1st request contains "X-B3*" headers, it will assign to self._headers. Then for every inbound request after that, it reuse the _headers based on the 1st request instead of parsing from the new header. This will cause all the newly created spans are chained with the 1st trace id. Therefore for any python app which is in the middle of any process, the zipkin tracing could be incorrect.

I am not sure if this is an actual bug, or I implemented in a wrong way which caused this issue. Please have a review, I would love to hear your reply on this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant