Re: [Django] #35618: response.close() in a TestCase prematurely closes PostgreSQL connection and leads to psycopg2.InterfaceError

2024-07-18 Thread Django
#35618: response.close() in a TestCase prematurely closes PostgreSQL connection 
and
leads to psycopg2.InterfaceError
-+-
 Reporter:  Anders Kaseorg   |Owner:  (none)
 Type:  Uncategorized|   Status:  new
Component:  Database layer   |  Version:  5.0
  (models, ORM)  |
 Severity:  Normal   |   Resolution:
 Keywords:   | Triage Stage:
 |  Unreviewed
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Comment (by Simon Charette):

 In order to prevent this problem from happening under normal circumstances
 `django.test.Client`
 
[https://github.com/django/django/blob/6b3f55446fdc62bd277903fd188a1781e4d92d29/django/test/client.py#L195-L208
 unregisters this signal handler] before calling `request.close`.

 I feel like if you're testing something as low level as `HttpRequest`
 closing in the context of database connection handling
 
[https://github.com/django/django/blob/6b3f55446fdc62bd277903fd188a1781e4d92d29/django/test/client.py#L158C7-L210
 you should be using] `ClientHandler`?
-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/01070190c7f3f806-4253db3b-203e-478c-b8a0-a3d544c0c9f3-00%40eu-central-1.amazonses.com.


Re: [Django] #35618: response.close() in a TestCase prematurely closes PostgreSQL connection and leads to psycopg2.InterfaceError

2024-07-18 Thread Django
#35618: response.close() in a TestCase prematurely closes PostgreSQL connection 
and
leads to psycopg2.InterfaceError
-+-
 Reporter:  Anders Kaseorg   |Owner:  (none)
 Type:  Uncategorized|   Status:  new
Component:  Database layer   |  Version:  5.0
  (models, ORM)  |
 Severity:  Normal   |   Resolution:
 Keywords:   | Triage Stage:
 |  Unreviewed
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Comment (by Anders Kaseorg):

 The streaming case is the one that motivated me to call `response.close`
 in the first place. Currently there’s no way to get
 `closing_iterator_wrapper` to close the response itself without first
 consuming the entire stream, and leaving it unclosed results in various
 `ResourceWarning`s when warnings are enabled.
-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/01070190c7fe38e0-e45b79f1-3080-481a-ae42-46645149c2f3-00%40eu-central-1.amazonses.com.


Re: [Django] #35618: response.close() in a TestCase prematurely closes PostgreSQL connection and leads to psycopg2.InterfaceError

2024-07-19 Thread Django
#35618: response.close() in a TestCase prematurely closes PostgreSQL connection 
and
leads to psycopg2.InterfaceError
-+-
 Reporter:  Anders Kaseorg   |Owner:  (none)
 Type:  Uncategorized|   Status:  new
Component:  Database layer   |  Version:  5.0
  (models, ORM)  |
 Severity:  Normal   |   Resolution:
 Keywords:   | Triage Stage:
 |  Unreviewed
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Changes (by Carlton Gibson):

 * cc: Carlton Gibson, Jon Janzen (added)

Comment:

 We had a similar issue in Channels, which we've addressed by (similarly)
 disabling the close_old_connections handler during tests.

 [https://github.com/django/channels/pull/2101 You can see the PR here].

 We have this down as related to #30448.
-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/01070190ca00cec1-f6d70d2d-8ee4-4cb9-a158-2968c86a5ac6-00%40eu-central-1.amazonses.com.


Re: [Django] #35618: response.close() in a TestCase prematurely closes PostgreSQL connection and leads to psycopg2.InterfaceError

2024-07-19 Thread Django
#35618: response.close() in a TestCase prematurely closes PostgreSQL connection 
and
leads to psycopg2.InterfaceError
-+-
 Reporter:  Anders Kaseorg   |Owner:  (none)
 Type:  Uncategorized|   Status:  new
Component:  Database layer   |  Version:  5.0
  (models, ORM)  |
 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 Anders Kaseorg):

 * has_patch:  0 => 1

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/01070190ccb99cde-ead7c217-86a7-4357-8cc3-8c1efdcfcf1d-00%40eu-central-1.amazonses.com.


Re: [Django] #35618: response.close() in a TestCase prematurely closes PostgreSQL connection and leads to psycopg2.InterfaceError

2024-07-19 Thread Django
#35618: response.close() in a TestCase prematurely closes PostgreSQL connection 
and
leads to psycopg2.InterfaceError
-+-
 Reporter:  Anders Kaseorg   |Owner:  (none)
 Type:  Uncategorized|   Status:  new
Component:  Database layer   |  Version:  5.0
  (models, ORM)  |
 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
-+-
Comment (by Anders Kaseorg):

 Created ​https://github.com/django/django/pull/18393.
-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/01070190ccba2012-7bdb4bb7-f4b2-4e8c-a6b8-cd417b606b6e-00%40eu-central-1.amazonses.com.


Re: [Django] #35618: response.close() in a TestCase prematurely closes PostgreSQL connection and leads to psycopg2.InterfaceError

2024-07-19 Thread Django
#35618: response.close() in a TestCase prematurely closes PostgreSQL connection 
and
leads to psycopg2.InterfaceError
-+-
 Reporter:  Anders Kaseorg   |Owner:  (none)
 Type:  Uncategorized|   Status:  new
Component:  Database layer   |  Version:  5.0
  (models, ORM)  |
 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
-+-
Comment (by Simon Charette):

 Should we close as duplicate of #30448, this seems like the exact same
 problem.
-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/01070190cd1b8c80-e5405906-698f-42c3-88e7-3661292033e5-00%40eu-central-1.amazonses.com.


Re: [Django] #35618: response.close() in a TestCase prematurely closes PostgreSQL connection and leads to psycopg2.InterfaceError

2024-07-19 Thread Django
#35618: response.close() in a TestCase prematurely closes PostgreSQL connection 
and
leads to psycopg2.InterfaceError
-+-
 Reporter:  Anders Kaseorg   |Owner:  (none)
 Type:  Uncategorized|   Status:  closed
Component:  Database layer   |  Version:  5.0
  (models, ORM)  |
 Severity:  Normal   |   Resolution:  duplicate
 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 Carlton Gibson):

 * resolution:   => duplicate
 * status:  new => closed

Comment:

 Yes, agreed. Duplicate of #30448.
-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/01070190cedf9726-7cc2-3e44-492d-845d-588eb1489549-00%40eu-central-1.amazonses.com.