[Django] #31056: Add ability to override "async unsafe" checks

11 views
Skip to first unread message

Django

unread,
Dec 2, 2019, 11:36:35 AM12/2/19
to django-...@googlegroups.com
#31056: Add ability to override "async unsafe" checks
-----------------------------------------+-------------------------------
Reporter: Andrew Godwin | Owner: Andrew Godwin
Type: New feature | Status: assigned
Component: Core (Other) | Version: 3.0
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-----------------------------------------+-------------------------------
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.

--
Ticket URL: <https://code.djangoproject.com/ticket/31056>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Dec 2, 2019, 3:04:36 PM12/2/19
to django-...@googlegroups.com
#31056: Add ability to override "async unsafe" checks
-------------------------------+-----------------------------------------

Reporter: Andrew Godwin | Owner: Andrew Godwin
Type: New feature | Status: assigned
Component: Core (Other) | Version: 3.0
Severity: Normal | Resolution:
Keywords: | Triage Stage: Unreviewed
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------+-----------------------------------------
Changes (by Andrew Godwin):

* has_patch: 0 => 1


Comment:

Pull request: https://github.com/django/django/pull/12172

--
Ticket URL: <https://code.djangoproject.com/ticket/31056#comment:1>

Django

unread,
Dec 2, 2019, 3:04:46 PM12/2/19
to django-...@googlegroups.com
#31056: Add ability to override "async unsafe" checks
-------------------------------+-----------------------------------------

Reporter: Andrew Godwin | Owner: Andrew Godwin
Type: New feature | Status: assigned
Component: Core (Other) | Version: 3.0
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------+-----------------------------------------
Changes (by Andrew Godwin):

* stage: Unreviewed => Accepted


--
Ticket URL: <https://code.djangoproject.com/ticket/31056#comment:2>

Django

unread,
Dec 2, 2019, 3:04:57 PM12/2/19
to django-...@googlegroups.com
#31056: Add ability to override "async unsafe" checks.
-------------------------------+-----------------------------------------

Reporter: Andrew Godwin | Owner: Andrew Godwin
Type: New feature | Status: assigned
Component: Core (Other) | Version: master

Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------+-----------------------------------------
Changes (by felixxm):

* has_patch: 1 => 0
* version: 3.0 => master


--
Ticket URL: <https://code.djangoproject.com/ticket/31056#comment:3>

Django

unread,
Dec 2, 2019, 3:05:12 PM12/2/19
to django-...@googlegroups.com
#31056: Add ability to override "async unsafe" checks.
-------------------------------+-----------------------------------------

Reporter: Andrew Godwin | Owner: Andrew Godwin
Type: New feature | Status: assigned
Component: Core (Other) | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------+-----------------------------------------
Changes (by felixxm):

* has_patch: 0 => 1


--
Ticket URL: <https://code.djangoproject.com/ticket/31056#comment:4>

Django

unread,
Dec 2, 2019, 3:35:44 PM12/2/19
to django-...@googlegroups.com
#31056: Add ability to override "async unsafe" checks.
---------------------------------+-----------------------------------------

Reporter: Andrew Godwin | Owner: Andrew Godwin
Type: Bug | Status: assigned
Component: Core (Other) | Version: master
Severity: Release blocker | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
---------------------------------+-----------------------------------------
Changes (by felixxm):

* type: New feature => Bug
* severity: Normal => Release blocker


--
Ticket URL: <https://code.djangoproject.com/ticket/31056#comment:5>

Django

unread,
Dec 3, 2019, 12:08:39 PM12/3/19
to django-...@googlegroups.com
#31056: Add ability to override "async unsafe" checks.
---------------------------------+-----------------------------------------

Reporter: Andrew Godwin | Owner: Andrew Godwin
Type: Bug | Status: closed

Component: Core (Other) | Version: master
Severity: Release blocker | Resolution: fixed
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
---------------------------------+-----------------------------------------
Changes (by Mariusz Felisiak <felisiak.mariusz@…>):

* status: assigned => closed
* resolution: => fixed


Comment:

In [changeset:"9243435b5e7e327d0e1e1271b6dfd4c74ca7120b" 9243435b]:
{{{
#!CommitTicketReference repository=""
revision="9243435b5e7e327d0e1e1271b6dfd4c74ca7120b"
[3.0.x] Fixed #31056 -- Allowed disabling async-unsafe check with an
environment variable.

Backport of c90ab30fa1305481024b9c3c50b5a6ed6cd9a2f5 from master
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/31056#comment:6>

Django

unread,
Dec 3, 2019, 12:08:41 PM12/3/19
to django-...@googlegroups.com
#31056: Add ability to override "async unsafe" checks.
---------------------------------+-----------------------------------------

Reporter: Andrew Godwin | Owner: Andrew Godwin
Type: Bug | Status: closed
Component: Core (Other) | Version: master
Severity: Release blocker | Resolution: fixed
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
---------------------------------+-----------------------------------------

Comment (by Mariusz Felisiak <felisiak.mariusz@…>):

In [changeset:"c90ab30fa1305481024b9c3c50b5a6ed6cd9a2f5" c90ab30f]:
{{{
#!CommitTicketReference repository=""
revision="c90ab30fa1305481024b9c3c50b5a6ed6cd9a2f5"


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

--
Ticket URL: <https://code.djangoproject.com/ticket/31056#comment:7>

Reply all
Reply to author
Forward
0 new messages