Opened 17 months ago

Closed 17 months ago

Last modified 17 months ago

#31056 closed Bug (fixed)

Add ability to override "async unsafe" checks.

Reported by: Andrew Godwin Owned by: Andrew Godwin
Component: Core (Other) Version: dev
Severity: Release blocker Keywords:
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

It's been reported that Jupyter, at least, executes apparently-synchronous code in an async environment (https://forum.djangoproject.com/t/is-there-a-way-to-disable-the-synchronousonlyoperation-check-when-using-the-orm-in-a-jupyter-notebook/548/3) and we're going to have people running headlong into this soon.

The "right" way of wrapping code in sync_to_async works, but is an undue burden on notebook authors as it would have to be in every cell, so it's suggested that we add a flag that disables the async-unsafe check. Either a setting or an environment variable could work; I slightly prefer an environment variable (as it's hard to forget about) provided this works well with Jupyter.

Change History (7)

comment:1 Changed 17 months ago by Andrew Godwin

Has patch: set

comment:2 Changed 17 months ago by Andrew Godwin

Triage Stage: UnreviewedAccepted

comment:3 Changed 17 months ago by Mariusz Felisiak

Has patch: unset
Summary: Add ability to override "async unsafe" checksAdd ability to override "async unsafe" checks.
Version: 3.0master

comment:4 Changed 17 months ago by Mariusz Felisiak

Has patch: set

comment:5 Changed 17 months ago by Mariusz Felisiak

Severity: NormalRelease blocker
Type: New featureBug

comment:6 Changed 17 months ago by Mariusz Felisiak <felisiak.mariusz@…>

Resolution: fixed
Status: assignedclosed

In 9243435b:

[3.0.x] Fixed #31056 -- Allowed disabling async-unsafe check with an environment variable.

Backport of c90ab30fa1305481024b9c3c50b5a6ed6cd9a2f5 from master

comment:7 Changed 17 months ago by Mariusz Felisiak <felisiak.mariusz@…>

In c90ab30f:

Fixed #31056 -- Allowed disabling async-unsafe check with an environment variable.

Note: See TracTickets for help on using tickets.
Back to Top