Re: [Django] #27074: connection.is_usable() raises AttributeError after the connection is closed

2021-10-28 Thread Django
#27074: connection.is_usable() raises AttributeError after the connection is 
closed
-+-
 Reporter:  Chris Jerdonek   |Owner:  (none)
 Type:   |   Status:  new
  Cleanup/optimization   |
Component:  Database layer   |  Version:  1.10
  (models, ORM)  |
 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 Mariusz Felisiak):

 * owner:  Chris Jerdonek => (none)
 * status:  assigned => new


-- 
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/067.146c32f9bd6b5226e3f9493c6860426b%40djangoproject.com.


Re: [Django] #27074: connection.is_usable() raises AttributeError after the connection is closed

2016-10-07 Thread Django
#27074: connection.is_usable() raises AttributeError after the connection is 
closed
-+-
 Reporter:  Chris Jerdonek   |Owner:  Chris
 Type:   |  Jerdonek
  Cleanup/optimization   |   Status:  assigned
Component:  Database layer   |  Version:  1.10
  (models, ORM)  |
 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 Chris Jerdonek):

 * needs_better_patch:  1 => 0
 * has_patch:  1 => 0


Comment:

 I will now put together a PR for this, which is what I was originally
 planning to do when I first created this ticket (but someone else opened
 one before me).

--
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 post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/067.2489109303797f10319e73e48c296f0b%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #27074: connection.is_usable() raises AttributeError after the connection is closed

2016-10-07 Thread Django
#27074: connection.is_usable() raises AttributeError after the connection is 
closed
-+-
 Reporter:  Chris Jerdonek   |Owner:  Chris
 Type:   |  Jerdonek
  Cleanup/optimization   |   Status:  assigned
Component:  Database layer   |  Version:  1.10
  (models, ORM)  |
 Severity:  Normal   |   Resolution:
 Keywords:   | Triage Stage:  Accepted
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  1
Easy pickings:  0|UI/UX:  0
-+-
Changes (by Chris Jerdonek):

 * owner:  nobody => Chris Jerdonek
 * status:  new => assigned


--
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 post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/067.7a3e989957f655f0897ae350ef704dfe%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #27074: connection.is_usable() raises AttributeError after the connection is closed

2016-09-02 Thread Django
#27074: connection.is_usable() raises AttributeError after the connection is 
closed
-+-
 Reporter:  cjerdonek|Owner:  nobody
 Type:   |   Status:  new
  Cleanup/optimization   |
Component:  Database layer   |  Version:  1.10
  (models, ORM)  |
 Severity:  Normal   |   Resolution:
 Keywords:   | Triage Stage:  Accepted
Has patch:  1|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  1
Easy pickings:  0|UI/UX:  0
-+-
Changes (by timgraham):

 * needs_better_patch:  0 => 1
 * 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 post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/067.ad1005ca44522be08982877dd21bc748%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #27074: connection.is_usable() raises AttributeError after the connection is closed

2016-08-22 Thread Django
#27074: connection.is_usable() raises AttributeError after the connection is 
closed
-+-
 Reporter:  cjerdonek|Owner:  nobody
 Type:   |   Status:  new
  Cleanup/optimization   |
Component:  Database layer   |  Version:  1.10
  (models, ORM)  |
 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
-+-

Comment (by aaugustin):

 This is a private API that Django primarily calls inside an `if
 self.connection is not None:` block (and secondarily in testing tools
 where database connection breakage isn't a concern and will abort tests in
 general). For this reason, I don't expect this issue to appear through the
 use of public APIs.

 I'm -0 on making that change but I understand that we might have to add a
 useless check just to stop these bugs reports. The performance impact will
 be negligible.

--
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 post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/067.eba50979c045aa18fbffdb5f75eddba4%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #27074: connection.is_usable() raises AttributeError after the connection is closed

2016-08-18 Thread Django
#27074: connection.is_usable() raises AttributeError after the connection is 
closed
-+-
 Reporter:  cjerdonek|Owner:  nobody
 Type:   |   Status:  new
  Cleanup/optimization   |
Component:  Database layer   |  Version:  1.10
  (models, ORM)  |
 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
-+-

Comment (by cjerdonek):

 Also, for future reference, an argument for putting the logic in the base
 implementation is that it's the base implementation that sets
 `self.connection` to `None` in the first place (in the finally block of
 its `close()` method, when not in an atomic block). See
 
[https://github.com/django/django/blob/76ab8851181675a59425f9637bdbf3f2de95f6f1/django/db/backends/base/base.py#L266
 here] for the code.

--
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 post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/067.e4476c447e094e2412fcb9eb3d37aad5%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #27074: connection.is_usable() raises AttributeError after the connection is closed

2016-08-18 Thread Django
#27074: connection.is_usable() raises AttributeError after the connection is 
closed
-+-
 Reporter:  cjerdonek|Owner:  nobody
 Type:   |   Status:  new
  Cleanup/optimization   |
Component:  Database layer   |  Version:  1.10
  (models, ORM)  |
 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
-+-

Comment (by cjerdonek):

 Also, rather than checking for `connection is None` in advance, using
 [https://docs.python.org/3/glossary.html#term-eafp EAFP] and checking for
 `None` in an `except` block (e.g. handling AttributeError) is probably
 more Pythonic.

--
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 post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/067.e37f1395c50df17261f287e02a87c848%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #27074: connection.is_usable() raises AttributeError after the connection is closed

2016-08-18 Thread Django
#27074: connection.is_usable() raises AttributeError after the connection is 
closed
-+-
 Reporter:  cjerdonek|Owner:  nobody
 Type:   |   Status:  new
  Cleanup/optimization   |
Component:  Database layer   |  Version:  1.10
  (models, ORM)  |
 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
-+-

Comment (by boblefrag):

 PR: https://github.com/django/django/pull/7114

--
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 post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/067.96adad0d76e5eb52a2e9c9c5a7c6e0aa%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #27074: connection.is_usable() raises AttributeError after the connection is closed

2016-08-18 Thread Django
#27074: connection.is_usable() raises AttributeError after the connection is 
closed
-+-
 Reporter:  cjerdonek|Owner:  nobody
 Type:   |   Status:  new
  Cleanup/optimization   |
Component:  Database layer   |  Version:  1.10
  (models, ORM)  |
 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
-+-

Comment (by cjerdonek):

 I believe the trickiest part of the patch will be handling / dealing with
 the fact that there are multiple backend implementations of `is_usable()`.

 Ideally, I think one would want to put the logic in the base
 implementation and call `super()` as appropriate. Alternatively, it looks
 like it would be sufficient to include the logic in all three non-trivial
 implementations: mysql, oracle, and postgresql. Those each look like the
 following:

 {{{#!python
 def is_usable(self):
 try:
 self.connection.ping()
 except Database.Error:
 return False
 else:
 return True
 }}}

--
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 post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/067.e59269861825cf608740e4e6755f0a4e%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #27074: connection.is_usable() raises AttributeError after the connection is closed

2016-08-18 Thread Django
#27074: connection.is_usable() raises AttributeError after the connection is 
closed
-+-
 Reporter:  cjerdonek|Owner:  nobody
 Type:   |   Status:  new
  Cleanup/optimization   |
Component:  Database layer   |  Version:  1.10
  (models, ORM)  |
 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
-+-

Comment (by boblefrag):

 My bad, I was testing with sqlite3. I can reproduce with postgresql

--
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 post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/067.52b45dcb1f7611fb0e018f74fab15afe%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #27074: connection.is_usable() raises AttributeError after the connection is closed

2016-08-18 Thread Django
#27074: connection.is_usable() raises AttributeError after the connection is 
closed
-+-
 Reporter:  cjerdonek|Owner:  nobody
 Type:   |   Status:  new
  Cleanup/optimization   |
Component:  Database layer   |  Version:  1.10
  (models, ORM)  |
 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
-+-

Comment (by aaugustin):

 Unless I missed something, this code matches the trackback reported above,
 so the issue likely still exists.

 The fix might be as simple as returning False `if self.connection is None`
 (assuming that doesn't break tests).

--
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 post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/067.cb873a3ccceb2daab03d069e357b6f95%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #27074: connection.is_usable() raises AttributeError after the connection is closed

2016-08-18 Thread Django
#27074: connection.is_usable() raises AttributeError after the connection is 
closed
-+-
 Reporter:  cjerdonek|Owner:  nobody
 Type:   |   Status:  new
  Cleanup/optimization   |
Component:  Database layer   |  Version:  1.10
  (models, ORM)  |
 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 boblefrag):

 * cc: boblefrag@… (added)


Comment:

 This is no longer the case on django master branch:

 {{{
 def is_usable(self):
 try:
 # Use a psycopg cursor directly, bypassing Django's utilities.
 self.connection.cursor().execute("SELECT 1")
 except Database.Error:
 return False
 else:
 return True
 }}}

--
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 post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/067.e88a121c7fc51fc0dbfa00dcaea6df30%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #27074: connection.is_usable() raises AttributeError after the connection is closed (was: connection.is_usable() can raise AttributeError in natural uses)

2016-08-17 Thread Django
#27074: connection.is_usable() raises AttributeError after the connection is 
closed
-+-
 Reporter:  cjerdonek|Owner:  nobody
 Type:   |   Status:  new
  Cleanup/optimization   |
Component:  Database layer   |  Version:  1.10
  (models, ORM)  |
 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 timgraham):

 * needs_better_patch:   => 0
 * needs_tests:   => 0
 * needs_docs:   => 0
 * type:  Uncategorized => Cleanup/optimization
 * stage:  Unreviewed => Accepted


--
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 post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/067.7f85edaca05a8a928d2a8110e5583ba4%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.