Skip to content

Execution context - use thread locals if gevent/eventlet has monkey patched it #454

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
Apr 10, 2019

Conversation

ramshaw888
Copy link
Contributor

Re-PR of #453

  • Extract out logic to decide which backing to use for execution_context
    into a function init_execution_context
  • Check if gevent or eventlet has monkey patched _threading.local, if it
    has then use elasticapm.context.threadlocal as the backing.

…atched it elastic#453

* Extract out logic to decide which backing to use for execution_context
into a function init_execution_context
* Check if gevent or eventlet has monkey patched _threading.local, if it
has then use elasticapm.context.threadlocal as the backing.
@ramshaw888
Copy link
Contributor Author

@beniwohli I've added the eventlet check as well. I've squashed my commits with the black/isort/flake8 stuff fixed up (as well as some commit signing stuff).

Jenkins seems to be erroring on the checkout stage for this and other PRs - is that intentional?

While travis reported OK in the status check, looks like theres something failing with django versions on master https://travis-ci.org/elastic/apm-agent-python/jobs/518036683

@beniwohli
Copy link
Contributor

Awesome, thanks @ramshaw888.

I had to fix another small linting issue, all code files require a license header. I added that to the two files you created.

The "failure" on Jenkins is a security precaution. It'll fail automatically for PRs that aren't from members of the elastic Github org, and needs to be re-run manually after reviewing the code. This should avoid things like bad actors submitting PRs that run cryptominers on our infrastructure.

The failure on Django master can be ignored for now. After releasing Django 2.2 recently, they bumped the minimal Python version for the next Django version.

@beniwohli beniwohli merged commit 090b938 into elastic:master Apr 10, 2019
@ramshaw888
Copy link
Contributor Author

Checks out! Thanks for the review and merge :)

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

Successfully merging this pull request may close these issues.

2 participants