Skip to content

fix(python): Remove legacy channels section from Troubleshooting #6266

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 1 commit into from
Feb 9, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 5 additions & 17 deletions src/platforms/python/common/troubleshooting.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,11 @@ taken. This is specially true when working with a code base doing concurrency
outside of the provided framework integrations.

The general recommendation is to have one hub per "concurrency unit"
(thread/coroutine/etc). The SDK ensures every thread has an independent hub. If
you do concurrency with `asyncio` coroutines, clone the current hub for use
within a block that runs concurrent code:
(thread/coroutine/etc). The SDK ensures every thread has an independent hub via the `ThreadingIntegration`.
If you do concurrency with `asyncio` coroutines, make sure to use the `AsyncioIntegration`
that will clone the current hub in your `Task`s.

The general pattern of usage for cloning the hub is:

```python
with Hub(Hub.current):
Expand All @@ -40,10 +42,6 @@ with Hub(Hub.current):
# the same initial scope data.
```

Issues with `asyncio` have then an easy workaround: every `asyncio` coroutine
that really does run concurrently with other coroutines needs to be made into a
task, then the hub needs to be cloned and reassigned.

See the [Threading](../configuration/integrations/default-integrations/#threading) section
for a more complete example that involves cloning the current hub.

Expand Down Expand Up @@ -114,13 +112,3 @@ be fixed from within the SDK.

This [issue has been fixed with gevent 20.5](https://github.com/gevent/gevent/issues/1407) but continues to be one for
eventlet.

<PlatformSection supported={["python.django"]}>

## Django Channels

A Django application using Channels 2.0 will be correctly instrumented under Python 3.7. For older versions of Python, install `aiocontextvars` from PyPI or your application will not start.

If you experience memory leaks in your channels' consumers while using the SDK, you need to wrap your entire application in [Sentry's ASGI middleware](/platforms/python/guides/asgi/). Unfortunately the SDK is not able to do so by itself, as [Channels is missing some hooks for instrumentation](https://github.com/django/channels/issues/1348).

</PlatformSection>