Skip to content

[Enhancement] Async task context support#88

Merged
kezhenxu94 merged 1 commit into
apache:masterfrom
tom-pytel:master
Nov 24, 2020
Merged

[Enhancement] Async task context support#88
kezhenxu94 merged 1 commit into
apache:masterfrom
tom-pytel:master

Conversation

@tom-pytel

@tom-pytel tom-pytel commented Nov 23, 2020

Copy link
Copy Markdown
Contributor
  • Async task context usage for Python 3.7+ for things like Tornado.
  • Also grpc reconnect traceback print only in DEBUG mode.

This will allow async frameworks and apps to mostly work properly - where with only thread-local storage they could not as the individual async tasks would interfere with each other's context. A new task-local context is created on get_context() for each task and all subtasks inherit this to be able to correlate entry and exit spans.

This is not a complete and final solution as there will still be problems with a single entry point executing multiple async exit requests simultaneously. Also if a context is created BEFORE the async handler loop starts then all the handlers would share the same parent context, but this does not happen in Tornado.

@kezhenxu94 kezhenxu94 added core enhancement New feature or request labels Nov 24, 2020
@kezhenxu94 kezhenxu94 added this to the 0.5.0 milestone Nov 24, 2020

@kezhenxu94 kezhenxu94 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks

@kezhenxu94 kezhenxu94 merged commit 28cfe9b into apache:master Nov 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants