Opened 5 years ago

Closed 5 years ago

Last modified 5 years 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 by Andrew Godwin, 5 years ago

Has patch: set

comment:2 by Andrew Godwin, 5 years ago

Triage Stage: UnreviewedAccepted

comment:3 by Mariusz Felisiak, 5 years ago

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

comment:4 by Mariusz Felisiak, 5 years ago

Has patch: set

comment:5 by Mariusz Felisiak, 5 years ago

Severity: NormalRelease blocker
Type: New featureBug

comment:6 by Mariusz Felisiak <felisiak.mariusz@…>, 5 years ago

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 by Mariusz Felisiak <felisiak.mariusz@…>, 5 years ago

In c90ab30f:

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

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