Skip to content

spans correctly reference finished parents #161

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

Merged
merged 2 commits into from
Sep 11, 2021

Conversation

tom-pytel
Copy link
Contributor

@tom-pytel tom-pytel commented Sep 10, 2021

Spans will now correctly create a new context and reference a parent when that parent context had already finished and the segment was archived. For example, previously, the tornado handler below did not correctly record the requests.get() because it executed after the parent task had already finished. Now it does:

import asyncio
import requests

import tornado.ioloop
import tornado.web

from skywalking import agent; agent.start()

class Dead(tornado.web.RequestHandler):
    async def out(self):
        await asyncio.sleep(1)
        requests.get('http://www.google.com/')

    async def get(self):
        asyncio.create_task(self.out())
        self.write('Hello from dead link')

def make_app():
    return tornado.web.Application([
        (r"/dead", Dead),
    ])

if __name__ == "__main__":
    app = make_app()
    app.listen(8002)
    tornado.ioloop.IOLoop.current().start()

@tom-pytel tom-pytel added the enhancement New feature or request label Sep 10, 2021
@tom-pytel tom-pytel added this to the 1.0.0 milestone Sep 10, 2021
@kezhenxu94 kezhenxu94 merged commit 91c315b into apache:master Sep 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants